aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-20 17:37:26 +0000
committeraclement <aclement>2009-03-20 17:37:26 +0000
commit70e7e2fb0bf2408874c36cc489a881cab0c23ba8 (patch)
treeacdd4b0264d3353a5e2a07279ed0f81602e954d5 /tests
parentc4caaab16d00e459bbdb31157dfaf33cd135a11a (diff)
downloadaspectj-70e7e2fb0bf2408874c36cc489a881cab0c23ba8.tar.gz
aspectj-70e7e2fb0bf2408874c36cc489a881cab0c23ba8.zip
268827: tell ajdt about class file removal
Diffstat (limited to 'tests')
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index 354c742e6..7958dbaba 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -23,6 +23,7 @@ import java.util.Map;
import java.util.Set;
import org.aspectj.ajde.core.ICompilerConfiguration;
+import org.aspectj.ajde.core.TestOutputLocationManager;
import org.aspectj.ajdt.internal.compiler.lookup.EclipseFactory;
import org.aspectj.ajdt.internal.core.builder.AjState;
import org.aspectj.ajdt.internal.core.builder.IncrementalStateManager;
@@ -51,6 +52,42 @@ import org.aspectj.util.FileUtil;
*/
public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementalAjdeInteractionTestbed {
+ public void testOutputLocationCallbacks() {
+ String p = "pr268827_ol";
+ initialiseProject(p);
+ CustomOLM olm = new CustomOLM(getProjectRelativePath(p, ".").toString());
+ configureOutputLocationManager(p, olm);
+ build(p);
+ checkCompileWeaveCount(p, 2, 3);
+ alter(p, "inc1"); // this contains a new Foo.java that no longer has Extra class in it
+ build(p);
+ checkCompileWeaveCount(p, 1, 1);
+ assertEquals(1, olm.removeCount);
+ }
+
+ static class CustomOLM extends TestOutputLocationManager {
+
+ public int writeCount = 0;
+ public int removeCount = 0;
+
+ public CustomOLM(String testProjectPath) {
+ super(testProjectPath);
+ }
+
+ public void reportClassFileWrite(String outputfile) {
+ super.reportClassFileWrite(outputfile);
+ writeCount++;
+ // System.out.println("Written " + outputfile);
+ }
+
+ public void reportClassFileRemove(String outputfile) {
+ super.reportClassFileRemove(outputfile);
+ removeCount++;
+ // System.out.println("Removed " + outputfile);
+ }
+
+ }
+
public void testBrokenCodeDeca_268611() {
String p = "pr268611";
initialiseProject(p);