diff options
Diffstat (limited to 'tests/incrementalju')
34 files changed, 295 insertions, 0 deletions
diff --git a/tests/incrementalju/defaultPackage/changes/Main.20.java b/tests/incrementalju/defaultPackage/changes/Main.20.java new file mode 100644 index 000000000..ad7e80c40 --- /dev/null +++ b/tests/incrementalju/defaultPackage/changes/Main.20.java @@ -0,0 +1,7 @@ + + +public class Main { + public static void main(String[] args) { + lib.Lib.f(); // bug: unable to resolve lib.Lib after change + } +} diff --git a/tests/incrementalju/defaultPackage/src/Main.java b/tests/incrementalju/defaultPackage/src/Main.java new file mode 100644 index 000000000..2d48a5793 --- /dev/null +++ b/tests/incrementalju/defaultPackage/src/Main.java @@ -0,0 +1,7 @@ + + +public class Main { + public static void main(String[] args) { + lib.Lib.f(); + } +} diff --git a/tests/incrementalju/defaultPackage/src/lib/Lib.java b/tests/incrementalju/defaultPackage/src/lib/Lib.java new file mode 100644 index 000000000..8ac8a0172 --- /dev/null +++ b/tests/incrementalju/defaultPackage/src/lib/Lib.java @@ -0,0 +1,9 @@ + +package lib; + +public class Lib { + public static void main(String[] args) { + } + public static void f(){} +} + diff --git a/tests/incrementalju/full-rebuild/changes/Aspect.20.java b/tests/incrementalju/full-rebuild/changes/Aspect.20.java new file mode 100644 index 000000000..94367bb64 --- /dev/null +++ b/tests/incrementalju/full-rebuild/changes/Aspect.20.java @@ -0,0 +1,4 @@ + +public aspect Aspect { + declare warning : execution(static void main(String[])): "dw"; +}
\ No newline at end of file diff --git a/tests/incrementalju/initialTests/aspectSourceAdded/changes/Detour.20.java b/tests/incrementalju/initialTests/aspectSourceAdded/changes/Detour.20.java new file mode 100644 index 000000000..4cc707b99 --- /dev/null +++ b/tests/incrementalju/initialTests/aspectSourceAdded/changes/Detour.20.java @@ -0,0 +1,7 @@ +public aspect Detour { + + void around() : execution(* Main.main(..)) { + System.out.println("Main class successfully woven"); + } + +}
\ No newline at end of file diff --git a/tests/incrementalju/initialTests/aspectSourceAdded/src/Main.java b/tests/incrementalju/initialTests/aspectSourceAdded/src/Main.java new file mode 100644 index 000000000..7c85f90c2 --- /dev/null +++ b/tests/incrementalju/initialTests/aspectSourceAdded/src/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 diff --git a/tests/incrementalju/initialTests/classAdded/src.20/main/Main.java b/tests/incrementalju/initialTests/classAdded/src.20/main/Main.java new file mode 100644 index 000000000..aae295f7f --- /dev/null +++ b/tests/incrementalju/initialTests/classAdded/src.20/main/Main.java @@ -0,0 +1,11 @@ +package main; + +public class Main { + public static void main (String[] args) { + new Target().run(); + } +} + +class Target { + void run() {} +} diff --git a/tests/incrementalju/initialTests/classAdded/src/main/Main.java b/tests/incrementalju/initialTests/classAdded/src/main/Main.java new file mode 100644 index 000000000..185ed42bf --- /dev/null +++ b/tests/incrementalju/initialTests/classAdded/src/main/Main.java @@ -0,0 +1,7 @@ + +package main; + +public class Main { + public static void main (String[] args) { + } +} diff --git a/tests/incrementalju/initialTests/classRemoved/src.20/main/Main.java b/tests/incrementalju/initialTests/classRemoved/src.20/main/Main.java new file mode 100644 index 000000000..dbe5d38ca --- /dev/null +++ b/tests/incrementalju/initialTests/classRemoved/src.20/main/Main.java @@ -0,0 +1,8 @@ + +package main; + +public class Main { + public static void main (String[] args) { + } +} + diff --git a/tests/incrementalju/initialTests/classRemoved/src/main/Main.java b/tests/incrementalju/initialTests/classRemoved/src/main/Main.java new file mode 100644 index 000000000..aae295f7f --- /dev/null +++ b/tests/incrementalju/initialTests/classRemoved/src/main/Main.java @@ -0,0 +1,11 @@ +package main; + +public class Main { + public static void main (String[] args) { + new Target().run(); + } +} + +class Target { + void run() {} +} diff --git a/tests/incrementalju/initialTests/classUpdated/src.20/main/Main.java b/tests/incrementalju/initialTests/classUpdated/src.20/main/Main.java new file mode 100644 index 000000000..d0b9d37b4 --- /dev/null +++ b/tests/incrementalju/initialTests/classUpdated/src.20/main/Main.java @@ -0,0 +1,8 @@ +package main; + +public class Main { + public static void main (String[] args) { + new Main().run(); + } + void run() {} +} diff --git a/tests/incrementalju/initialTests/classUpdated/src/main/Main.java b/tests/incrementalju/initialTests/classUpdated/src/main/Main.java new file mode 100644 index 000000000..185ed42bf --- /dev/null +++ b/tests/incrementalju/initialTests/classUpdated/src/main/Main.java @@ -0,0 +1,7 @@ + +package main; + +public class Main { + public static void main (String[] args) { + } +} diff --git a/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/AdviceOnIntroduced.java new file mode 100644 index 000000000..4da93f0ca --- /dev/null +++ b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/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/incrementalju/initialTests/classWAroundClosureRemoved/src/Main.java b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/Main.java new file mode 100644 index 000000000..7c85f90c2 --- /dev/null +++ b/tests/incrementalju/initialTests/classWAroundClosureRemoved/src/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 diff --git a/tests/incrementalju/initialTests/defaultPackage/changes/Main.30.java b/tests/incrementalju/initialTests/defaultPackage/changes/Main.30.java new file mode 100644 index 000000000..a46687d78 --- /dev/null +++ b/tests/incrementalju/initialTests/defaultPackage/changes/Main.30.java @@ -0,0 +1,8 @@ + +// default package + +public class Main { + public static void main (String[] args) { + new Target().run(); + } +} diff --git a/tests/incrementalju/initialTests/defaultPackage/changes/Main.50.java b/tests/incrementalju/initialTests/defaultPackage/changes/Main.50.java new file mode 100644 index 000000000..7616df98c --- /dev/null +++ b/tests/incrementalju/initialTests/defaultPackage/changes/Main.50.java @@ -0,0 +1,7 @@ + +// default package + +public class Main { + public static void main (String[] args) { + } +} diff --git a/tests/incrementalju/initialTests/defaultPackage/changes/Target.20.java b/tests/incrementalju/initialTests/defaultPackage/changes/Target.20.java new file mode 100644 index 000000000..d67b06569 --- /dev/null +++ b/tests/incrementalju/initialTests/defaultPackage/changes/Target.20.java @@ -0,0 +1,9 @@ + +// default package + +public class Target { + public static void main(String[] args) { + new Target().run(); + } + void run() {} +} diff --git a/tests/incrementalju/initialTests/defaultPackage/changes/Target.delete.40.java b/tests/incrementalju/initialTests/defaultPackage/changes/Target.delete.40.java new file mode 100644 index 000000000..187c8a8e6 --- /dev/null +++ b/tests/incrementalju/initialTests/defaultPackage/changes/Target.delete.40.java @@ -0,0 +1,2 @@ + +// delete this file
\ No newline at end of file diff --git a/tests/incrementalju/initialTests/defaultPackage/src/Main.java b/tests/incrementalju/initialTests/defaultPackage/src/Main.java new file mode 100644 index 000000000..66b7433e4 --- /dev/null +++ b/tests/incrementalju/initialTests/defaultPackage/src/Main.java @@ -0,0 +1,7 @@ + +// default package + +public class Main { + public static void main (String[] args) { + } +} diff --git a/tests/incrementalju/initialTests/sourceAdded/src.20/main/Target.java b/tests/incrementalju/initialTests/sourceAdded/src.20/main/Target.java new file mode 100644 index 000000000..985587eec --- /dev/null +++ b/tests/incrementalju/initialTests/sourceAdded/src.20/main/Target.java @@ -0,0 +1,9 @@ +package main; + +import org.aspectj.testing.Tester; + +public class Target { + void run() { + Tester.event("Target.run()"); + } +} diff --git a/tests/incrementalju/initialTests/sourceAdded/src.30/main/Main.java b/tests/incrementalju/initialTests/sourceAdded/src.30/main/Main.java new file mode 100644 index 000000000..59564d39c --- /dev/null +++ b/tests/incrementalju/initialTests/sourceAdded/src.30/main/Main.java @@ -0,0 +1,12 @@ + +package main; + +import org.aspectj.testing.Tester; + +public class Main { + public static void main (String[] args) { + new Target().run(); + Tester.expectEvent("Target.run()"); + Tester.checkAllEvents(); + } +} diff --git a/tests/incrementalju/initialTests/sourceAdded/src/main/Main.java b/tests/incrementalju/initialTests/sourceAdded/src/main/Main.java new file mode 100644 index 000000000..185ed42bf --- /dev/null +++ b/tests/incrementalju/initialTests/sourceAdded/src/main/Main.java @@ -0,0 +1,7 @@ + +package main; + +public class Main { + public static void main (String[] args) { + } +} diff --git a/tests/incrementalju/initialTests/sourceDeleted/src.30/delete/Target.java b/tests/incrementalju/initialTests/sourceDeleted/src.30/delete/Target.java new file mode 100644 index 000000000..1678b7055 --- /dev/null +++ b/tests/incrementalju/initialTests/sourceDeleted/src.30/delete/Target.java @@ -0,0 +1,7 @@ + +package delete; + +public class Target { + static void run() { + } +} diff --git a/tests/incrementalju/initialTests/sourceDeleted/src/delete/DeleteMe.java b/tests/incrementalju/initialTests/sourceDeleted/src/delete/DeleteMe.java new file mode 100644 index 000000000..9057235ff --- /dev/null +++ b/tests/incrementalju/initialTests/sourceDeleted/src/delete/DeleteMe.java @@ -0,0 +1,7 @@ + +package delete; + +public class DeleteMe { + static void run() { + } +} diff --git a/tests/incrementalju/initialTests/sourceDeleted/src/delete/Main.java b/tests/incrementalju/initialTests/sourceDeleted/src/delete/Main.java new file mode 100644 index 000000000..e180e46c8 --- /dev/null +++ b/tests/incrementalju/initialTests/sourceDeleted/src/delete/Main.java @@ -0,0 +1,8 @@ + +package delete; + +public class Main { + public static void main(String[] args) { + Target.run(); + } +} diff --git a/tests/incrementalju/initialTests/sourceDeleted/src/delete/Target.java b/tests/incrementalju/initialTests/sourceDeleted/src/delete/Target.java new file mode 100644 index 000000000..a19401904 --- /dev/null +++ b/tests/incrementalju/initialTests/sourceDeleted/src/delete/Target.java @@ -0,0 +1,8 @@ + +package delete; + +public class Target { + static void run() { + DeleteMe.run(); // CE 6 after DeleteMe deleted + } +} diff --git a/tests/incrementalju/interPackage/changes/Main.20.java b/tests/incrementalju/interPackage/changes/Main.20.java new file mode 100644 index 000000000..085cf6f90 --- /dev/null +++ b/tests/incrementalju/interPackage/changes/Main.20.java @@ -0,0 +1,8 @@ + +package app; + +public class Main { + public static void main(String[] args) { + lib.Lib.f(); // bug: unable to resolve lib.Lib after change + } +} diff --git a/tests/incrementalju/interPackage/src/app/Main.java b/tests/incrementalju/interPackage/src/app/Main.java new file mode 100644 index 000000000..c114a1c7e --- /dev/null +++ b/tests/incrementalju/interPackage/src/app/Main.java @@ -0,0 +1,8 @@ + +package app; + +public class Main { + public static void main(String[] args) { + lib.Lib.f(); + } +} diff --git a/tests/incrementalju/interPackage/src/lib/Lib.java b/tests/incrementalju/interPackage/src/lib/Lib.java new file mode 100644 index 000000000..8ac8a0172 --- /dev/null +++ b/tests/incrementalju/interPackage/src/lib/Lib.java @@ -0,0 +1,9 @@ + +package lib; + +public class Lib { + public static void main(String[] args) { + } + public static void f(){} +} + diff --git a/tests/incrementalju/stringliteral/changes/Main.20.java b/tests/incrementalju/stringliteral/changes/Main.20.java new file mode 100644 index 000000000..b2848f051 --- /dev/null +++ b/tests/incrementalju/stringliteral/changes/Main.20.java @@ -0,0 +1,16 @@ + +package packageOne; + +import org.aspectj.testing.Tester; + +public class Main { + public static void main(String[] args) { + for (int i = 0; i < args.length; i++) { + Tester.expectEvent(args[i]); + } + Tester.event("in longer packageOne.Main.main(..)"); + Tester.checkAllEvents(); + } +} + + diff --git a/tests/incrementalju/stringliteral/oneInjar.jar b/tests/incrementalju/stringliteral/oneInjar.jar Binary files differnew file mode 100644 index 000000000..44eaf54bd --- /dev/null +++ b/tests/incrementalju/stringliteral/oneInjar.jar diff --git a/tests/incrementalju/stringliteral/src/TraceMains.java b/tests/incrementalju/stringliteral/src/TraceMains.java new file mode 100644 index 000000000..a2e7f9a39 --- /dev/null +++ b/tests/incrementalju/stringliteral/src/TraceMains.java @@ -0,0 +1,18 @@ + +import org.aspectj.testing.Tester; +import org.aspectj.lang.JoinPoint; + +public aspect TraceMains { + private static String className(JoinPoint.StaticPart jp) { + return jp.getSignature().getDeclaringType().getName(); + } + before() : execution(static void main(String[])) { + Tester.event("before main " + className(thisJoinPointStaticPart)); + } + // this event is submitted after the Tester does its check, + // so it is ignored. + after() returning: execution(static void main(String[])) { + Tester.event("after main " + className(thisJoinPointStaticPart)); + } + +}
\ No newline at end of file diff --git a/tests/incrementalju/stringliteral/src/packageOne/Main.java b/tests/incrementalju/stringliteral/src/packageOne/Main.java new file mode 100644 index 000000000..d8315399f --- /dev/null +++ b/tests/incrementalju/stringliteral/src/packageOne/Main.java @@ -0,0 +1,15 @@ + +package packageOne; + +import org.aspectj.testing.Tester; + +public class Main { + public static void main(String[] args) { + for (int i = 0; i < args.length; i++) { + Tester.expectEvent(args[i]); + } + Tester.event("in packageOne.Main.main(..)"); + Tester.checkAllEvents(); + } +} + diff --git a/tests/incrementalju/stringliteral/twoInjar.jar b/tests/incrementalju/stringliteral/twoInjar.jar Binary files differnew file mode 100644 index 000000000..061a757a2 --- /dev/null +++ b/tests/incrementalju/stringliteral/twoInjar.jar |