From f64c442ec64b878086171722c066ebd648a95977 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 17 Jun 2009 21:25:05 +0000 Subject: [PATCH] 280651, 280658, 280676: testcases --- .../pr280380/inc1/src/g/AnAspect.aj | 3 +- .../base/src/aspects/MixinAspect.java | 18 ++++++ .../base/src/aspects/ParentsAspect.java | 16 ++++++ .../pr280658_target/base/src/test/Foo.class | Bin 0 -> 675 bytes .../pr280658_target/base/src/test/Foo.java | 11 ++++ .../pr280676/base/src/p/A.java | 6 ++ .../pr280676/base/src/p/Foo.aj | 8 +++ .../pr280676/inc1/src/p/Foo.aj | 8 +++ .../pr280676/inc2/src/p/Foo.aj | 8 +++ .../pr280676/inc3/src/p/Foo.aj | 8 +++ .../tools/MultiProjectIncrementalTests.java | 53 ++++++++++++++++++ 11 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 tests/multiIncremental/pr280651_decmix/base/src/aspects/MixinAspect.java create mode 100644 tests/multiIncremental/pr280658_decp/base/src/aspects/ParentsAspect.java create mode 100644 tests/multiIncremental/pr280658_target/base/src/test/Foo.class create mode 100644 tests/multiIncremental/pr280658_target/base/src/test/Foo.java create mode 100644 tests/multiIncremental/pr280676/base/src/p/A.java create mode 100644 tests/multiIncremental/pr280676/base/src/p/Foo.aj create mode 100644 tests/multiIncremental/pr280676/inc1/src/p/Foo.aj create mode 100644 tests/multiIncremental/pr280676/inc2/src/p/Foo.aj create mode 100644 tests/multiIncremental/pr280676/inc3/src/p/Foo.aj diff --git a/tests/multiIncremental/pr280380/inc1/src/g/AnAspect.aj b/tests/multiIncremental/pr280380/inc1/src/g/AnAspect.aj index aea980cbf..c3538cb31 100644 --- a/tests/multiIncremental/pr280380/inc1/src/g/AnAspect.aj +++ b/tests/multiIncremental/pr280380/inc1/src/g/AnAspect.aj @@ -1,9 +1,10 @@ package g; import f.AClass; +import f.*; public aspect AnAspect { - public int f.AClass.xxxx; + public int AClass.xxxx; public int AClass.y() { return 0; diff --git a/tests/multiIncremental/pr280651_decmix/base/src/aspects/MixinAspect.java b/tests/multiIncremental/pr280651_decmix/base/src/aspects/MixinAspect.java new file mode 100644 index 000000000..f8925d162 --- /dev/null +++ b/tests/multiIncremental/pr280651_decmix/base/src/aspects/MixinAspect.java @@ -0,0 +1,18 @@ +package aspects; + +import org.aspectj.lang.annotation.*; + +@Aspect +public class MixinAspect { + @DeclareMixin(value = "test.Foo") + public static Runnable foo(Object target) { + return new DebugDefault(); + } + + public static class DebugDefault implements Runnable { + public void run() { + System.out.println("Hi there from MixinAspect"); + } + } +} + diff --git a/tests/multiIncremental/pr280658_decp/base/src/aspects/ParentsAspect.java b/tests/multiIncremental/pr280658_decp/base/src/aspects/ParentsAspect.java new file mode 100644 index 000000000..7ad95e366 --- /dev/null +++ b/tests/multiIncremental/pr280658_decp/base/src/aspects/ParentsAspect.java @@ -0,0 +1,16 @@ +package aspects; +import org.aspectj.lang.annotation.*; +@Aspect +public class ParentsAspect { + + @DeclareParents(value = "test.Foo", defaultImpl = DebugDefault.class) + public Runnable runnable; + + public static class DebugDefault implements Runnable { + public void run() { + System.out.println("hi there from ParentsAspect"); + } + } +} + + diff --git a/tests/multiIncremental/pr280658_target/base/src/test/Foo.class b/tests/multiIncremental/pr280658_target/base/src/test/Foo.class new file mode 100644 index 0000000000000000000000000000000000000000..5681f16faf0ead28cfdd07e8f2c73bd64217c81a GIT binary patch literal 675 zcmY*X-)|B@5dM|}7LKFE7SR4ws=`q#SAC^1F-=ICG}RPiVtiWYO0GHf%&}*}pQR5_ z+r;?XKgu`@G#oFxJKuaW^UciO|GWJI;4R+RD4?821yzp6HY}74^2Ej#wr%WS*Tx?9 zIi41f$1{!^L-xd1zJAAGxy{cE>C^B^GOVBbN?ydno{T<;UO-5CD160Gb-$ipiyy)Z zgc^8V9rJD`gZoI7X47wDf%FUCX{+fx6?7mP6_#jLA`%EA>O~BgxbxR*GSp zR1Bm(4a8`~u<14v?aV+TtS^f!ctr|1Q(8vfL|;-|*=;80@DMmx7i&N8-baxb6Emm7 z`IHzME3=!+Zzt<7#!0ef0#=1H@b9LLfVNO^6RHzSu%cL@Mtd*Ne*jWoX8v@pk+nxR zqdRjr1^Y=4YLw3G47BJ&l< { + +} + diff --git a/tests/multiIncremental/pr280676/base/src/p/Foo.aj b/tests/multiIncremental/pr280676/base/src/p/Foo.aj new file mode 100644 index 000000000..3c9ab30be --- /dev/null +++ b/tests/multiIncremental/pr280676/base/src/p/Foo.aj @@ -0,0 +1,8 @@ +package p; + +aspect Foo { + + int A.i; + + public void A.m() {} +} diff --git a/tests/multiIncremental/pr280676/inc1/src/p/Foo.aj b/tests/multiIncremental/pr280676/inc1/src/p/Foo.aj new file mode 100644 index 000000000..5e6472f80 --- /dev/null +++ b/tests/multiIncremental/pr280676/inc1/src/p/Foo.aj @@ -0,0 +1,8 @@ +package p; + +aspect Foo { + + int A.i; // removed type vars + + public void A.m() {} +} diff --git a/tests/multiIncremental/pr280676/inc2/src/p/Foo.aj b/tests/multiIncremental/pr280676/inc2/src/p/Foo.aj new file mode 100644 index 000000000..d774d26dd --- /dev/null +++ b/tests/multiIncremental/pr280676/inc2/src/p/Foo.aj @@ -0,0 +1,8 @@ +package p; + +aspect Foo { + + int A.i; // removed type vars + + public void A.m() {} +} diff --git a/tests/multiIncremental/pr280676/inc3/src/p/Foo.aj b/tests/multiIncremental/pr280676/inc3/src/p/Foo.aj new file mode 100644 index 000000000..c51ecc7e0 --- /dev/null +++ b/tests/multiIncremental/pr280676/inc3/src/p/Foo.aj @@ -0,0 +1,8 @@ +package p; + +aspect Foo { + + int A.i; // removed type vars + + public void A.m() {} +} diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 63778f474..9970435a2 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -53,6 +53,59 @@ import org.aspectj.util.FileUtil; */ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementalAjdeInteractionTestbed { + public void testIncrementalGenericItds_pr280676() throws Exception { + String p = "pr280676"; + initialiseProject(p); + build(p); + checkWasFullBuild(); + assertNoErrors(p); + alter(p, "inc1"); // remove type variables from ITD field + build(p); + checkWasFullBuild(); + assertNoErrors(p); + alter(p, "inc2"); // remove type variables from ITD method + build(p); + checkWasFullBuild(); + assertNoErrors(p); + alter(p, "inc3"); // readded type variables on ITD method + build(p); + checkWasFullBuild(); + assertNoErrors(p); + } + + // TODO (asc) these tests don't actually verify anything! + // public void testAtDeclareParents_280658() throws Exception { + // AjdeInteractionTestbed.VERBOSE = true; + // String lib = "pr280658_decp"; + // initialiseProject(lib); + // build(lib); + // checkWasFullBuild(); + // + // String cli = "pr280658_target"; + // initialiseProject(cli); + // + // configureAspectPath(cli, getProjectRelativePath(lib, "bin")); + // build(cli); + // checkWasFullBuild(); + // printModel(cli); + // } + // + // public void testAtDeclareMixin_280651() throws Exception { + // AjdeInteractionTestbed.VERBOSE = true; + // String lib = "pr280651_decmix"; + // initialiseProject(lib); + // build(lib); + // checkWasFullBuild(); + // + // String cli = "pr280658_target"; + // initialiseProject(cli); + // + // configureAspectPath(cli, getProjectRelativePath(lib, "bin")); + // build(cli); + // checkWasFullBuild(); + // printModel(cli); + // } + // public void testIncrementalFqItds_280380() throws Exception { // String p = "pr280380"; // initialiseProject(p); -- 2.39.5