aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoracolyer <acolyer>2004-03-18 14:36:58 +0000
committeracolyer <acolyer>2004-03-18 14:36:58 +0000
commit7d6b500be325633c3057abaf973b8c56464d6706 (patch)
tree66543c61dfaf9c3c83f5eb797f846389be23761b /tests
parent183fc23883289ae42854ce9afcf2d3b0d29b7599 (diff)
downloadaspectj-7d6b500be325633c3057abaf973b8c56464d6706.tar.gz
aspectj-7d6b500be325633c3057abaf973b8c56464d6706.zip
fix for Bugzilla Bug 55134
Incremental compilation does not delete weaver-generated class files
Diffstat (limited to 'tests')
-rw-r--r--tests/ajcTests.xml14
-rw-r--r--tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java26
-rw-r--r--tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java26
-rw-r--r--tests/incremental/initialTests/classWAroundClosureRemoved/Main.java9
4 files changed, 75 insertions, 0 deletions
diff --git a/tests/ajcTests.xml b/tests/ajcTests.xml
index 496db30ab..f0da796c3 100644
--- a/tests/ajcTests.xml
+++ b/tests/ajcTests.xml
@@ -7489,4 +7489,18 @@
<compile files="WeaveLocal.java" aspectpath="notAJar.jar" outjar="notAJar.jar" >
</compile>
</ajc-test>
+
+
+ <ajc-test dir="incremental/initialTests/classWAroundClosureRemoved"
+ title="make sure additional classes generated during weave are deleted with src class file"
+ keywords="incremental-test">
+ <compile staging="true"
+ options="-incremental"
+ sourceroots="."/>
+ <inc-compile tag="20" >
+ <dir-changes removed="AdviceOnIntroduced$AjcClosure1"/>
+ </inc-compile>
+ </ajc-test>
+
+
</suite>
diff --git a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java
new file mode 100644
index 000000000..4da93f0ca
--- /dev/null
+++ b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.delete.20.java
@@ -0,0 +1,26 @@
+import org.aspectj.testing.Tester;
+
+public aspect AdviceOnIntroduced {
+ public static void main(String[] args) { test(); }
+
+ public static void test() {
+ Tester.checkEqual(new Foo(10).foo(5), 6, "foo");
+ }
+
+ int Foo.foo(int n) { return n; }
+ Foo.new(int w) {}
+
+ int around(int n):
+ within(AdviceOnIntroduced) &&
+ (args(n) && execution(int foo(int))) {
+ int result = proceed(n);
+ return result+1;
+ }
+
+ before(): within(Foo) && execution(new(..)) {
+ //System.out.println("before new");
+ }
+}
+
+class Foo {
+}
diff --git a/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java
new file mode 100644
index 000000000..4da93f0ca
--- /dev/null
+++ b/tests/incremental/initialTests/classWAroundClosureRemoved/AdviceOnIntroduced.java
@@ -0,0 +1,26 @@
+import org.aspectj.testing.Tester;
+
+public aspect AdviceOnIntroduced {
+ public static void main(String[] args) { test(); }
+
+ public static void test() {
+ Tester.checkEqual(new Foo(10).foo(5), 6, "foo");
+ }
+
+ int Foo.foo(int n) { return n; }
+ Foo.new(int w) {}
+
+ int around(int n):
+ within(AdviceOnIntroduced) &&
+ (args(n) && execution(int foo(int))) {
+ int result = proceed(n);
+ return result+1;
+ }
+
+ before(): within(Foo) && execution(new(..)) {
+ //System.out.println("before new");
+ }
+}
+
+class Foo {
+}
diff --git a/tests/incremental/initialTests/classWAroundClosureRemoved/Main.java b/tests/incremental/initialTests/classWAroundClosureRemoved/Main.java
new file mode 100644
index 000000000..7c85f90c2
--- /dev/null
+++ b/tests/incremental/initialTests/classWAroundClosureRemoved/Main.java
@@ -0,0 +1,9 @@
+import org.aspectj.testing.Tester;
+
+public class Main {
+
+ public static void main(String[] args) {
+ Tester.checkFailed("Incremental compilation did not appear to (re)weave Main");
+ }
+
+} \ No newline at end of file