From: aclement Date: Tue, 7 Apr 2009 22:20:18 +0000 (+0000) Subject: 271201: inpath handles for jars X-Git-Tag: V1_6_5~77 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fc60b23c788601d1d44ac01dd20fa9f2eded51d6;p=aspectj.git 271201: inpath handles for jars --- diff --git a/tests/model/expected/pr141730_4.txt b/tests/model/expected/pr141730_4.txt index 714d1fba0..805c0fc29 100644 --- a/tests/model/expected/pr141730_4.txt +++ b/tests/model/expected/pr141730_4.txt @@ -23,10 +23,10 @@ NewClass [class] TEST_SANDBOX\NewClass.java:3: === END OF MODEL REPORT ========= === RELATIONSHIPS REPORT ========= After a batch build -(targets=1) - + diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index b528c36c3..101ad0302 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -121,6 +121,13 @@ public class AjdeInteractionTestbed extends TestCase { ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(inpath); } + public static void configureInPath(String projectName, File inpath) { + Set s = new HashSet(); + s.add(inpath); + AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); + ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setInpath(s); + } + public static void configureOutputLocationManager(String projectName, IOutputLocationManager mgr) { AjCompiler compiler = CompilerFactory.getCompilerForProjectWithDir(sandboxDir + File.separator + projectName); ((MultiProjTestCompilerConfiguration) compiler.getCompilerConfiguration()).setOutputLocationManager(mgr); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java index 610e6ba81..3299ee833 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MoreOutputLocationManagerTests.java @@ -308,7 +308,7 @@ public class MoreOutputLocationManagerTests extends AbstractMultiProjectIncremen private void addInpathEntry(String entry) { if (entry == null) { - configureInPath("inpathTesting", null); + configureInPath("inpathTesting", (Set)null); return; } File f = new File(entry); diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index f88dc7ebc..4900c7194 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -2898,42 +2898,76 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa assertNotNull(l); } + private void printModelAndRelationships(String p) { + IProgramElement root = getModelFor(p).getHierarchy().getRoot(); + + dumptree(root, 0); + PrintWriter pw = new PrintWriter(System.out); + try { + getModelFor(p).dumprels(pw); + pw.flush(); + } catch (Exception e) { + } + } + + public void testInpathHandles_IncrementalCompilation_RemovingInpathEntries_271201() throws Exception { + AjdeInteractionTestbed.VERBOSE=true; + String p = "inpathHandles2"; + initialiseProject(p); + + String inpathDir = getWorkingDir() + File.separator + "inpathHandles2" + File.separator + "binpath"; + + // set up the inpath to have the directory on it's path + File f = new File(inpathDir); + configureInPath(p, f); + + // This build will weave a declare parents into the inpath class codep.A and codep.B + build(p); + assertNotNull(getModelFor(p).getRelationshipMap().get("=inpathHandles2/,