From: aclement Date: Wed, 17 Jun 2009 21:25:05 +0000 (+0000) Subject: 280651, 280658, 280676: testcases X-Git-Tag: V1_6_5~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f64c442ec64b878086171722c066ebd648a95977;p=aspectj.git 280651, 280658, 280676: testcases --- 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 000000000..5681f16fa Binary files /dev/null and b/tests/multiIncremental/pr280658_target/base/src/test/Foo.class differ diff --git a/tests/multiIncremental/pr280658_target/base/src/test/Foo.java b/tests/multiIncremental/pr280658_target/base/src/test/Foo.java new file mode 100644 index 000000000..e9f9cb741 --- /dev/null +++ b/tests/multiIncremental/pr280658_target/base/src/test/Foo.java @@ -0,0 +1,11 @@ +package test; +import java.util.Arrays; +public class Foo { + public static void main(String[] args) { + System.out.println(Arrays.toString(new +Foo().getClass().getInterfaces())); + ((Runnable) new Foo()).run(); + } +} + + diff --git a/tests/multiIncremental/pr280676/base/src/p/A.java b/tests/multiIncremental/pr280676/base/src/p/A.java new file mode 100644 index 000000000..766c28800 --- /dev/null +++ b/tests/multiIncremental/pr280676/base/src/p/A.java @@ -0,0 +1,6 @@ +package p; + +public class A { + +} + 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);