ExtensionLoader extends AbstractDelegatingTargetDescriptorLoader { public Target load(final String name, final Map<Object, Object> context) throws ADLException { Target target = clientLoader.load(name, context); final Extends[] extendss = target.getExtendss(); if (extendss.length == 0) { return target; } final List<Target> extensions = new ArrayList<Target>(extendss.length); for (final Extends extend : extendss) { extensions.add(recursiveLoader.load(extend.getName(), context)); target.removeExtends(extend); } final Map<String, String> nameAttribute = new HashMap<String, String>(); addNameAttributes(target, nameAttribute); for (final Target superTarget : extensions) { addNameAttributes(superTarget, nameAttribute); } for (final Target superTarget : extensions) { try { target = (Target) nodeMergerItf.merge(target, superTarget, nameAttribute); } catch (final MergeException e) { throw new CompilerError(GenericErrors.INTERNAL_ERROR, e, "Merge error."); } } return target; }  Target load(final String name, final Map<Object, Object> context);  }
@Test(groups = {"functional", "checkin"}) public void test1() throws Exception { final Target target = loader.load("descriptor2", context); assertNotNull(loader); assertEquals("descriptor2", target.getName()); final Compiler compiler = target.getCompiler(); assertNotNull(compiler); assertEquals("gcc", compiler.getPath()); final Linker linker = target.getLinker(); assertNotNull(linker); assertEquals("ld", linker.getPath()); final Flag[] cFlags = target.getCFlags(); assertEquals(3, cFlags.length); assertNull(cFlags[0].getId()); assertEquals("-g", cFlags[0].getValue()); assertEquals("optimization", cFlags[1].getId()); assertEquals("-O1", cFlags[1].getValue()); assertEquals("warning", cFlags[2].getId()); assertEquals("-Wall", cFlags[2].getValue()); }