From 93f74cbbd62ebdc6d0ae1f050438f94f2f0eb782 Mon Sep 17 00:00:00 2001 From: aclement Date: Mon, 19 Dec 2005 13:51:15 +0000 Subject: [PATCH] more tests. --- tests/java5/decps/Basic2b.java | 2 +- tests/java5/decps/Basic3b.java | 2 +- tests/java5/decps/Basic3c.java | 39 +++++++++++++++++++ .../systemtest/ajc150/Ajc150Tests.java | 3 +- .../org/aspectj/systemtest/ajc150/ajc150.xml | 6 +++ 5 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 tests/java5/decps/Basic3c.java diff --git a/tests/java5/decps/Basic2b.java b/tests/java5/decps/Basic2b.java index 59092e5c6..03c88f80d 100644 --- a/tests/java5/decps/Basic2b.java +++ b/tests/java5/decps/Basic2b.java @@ -14,7 +14,7 @@ public class Basic2b { interface I { } - class IImpl implements I { + static class IImpl implements I { public void m2() { } } diff --git a/tests/java5/decps/Basic3b.java b/tests/java5/decps/Basic3b.java index e2bb111d1..1d4ecfe5a 100644 --- a/tests/java5/decps/Basic3b.java +++ b/tests/java5/decps/Basic3b.java @@ -21,7 +21,7 @@ public class Basic3b { public void m4(); } - class IImpl implements I { + static class IImpl implements I { public void m2() { } public void m3() { } public void m4() { } diff --git a/tests/java5/decps/Basic3c.java b/tests/java5/decps/Basic3c.java new file mode 100644 index 000000000..f050054e4 --- /dev/null +++ b/tests/java5/decps/Basic3c.java @@ -0,0 +1,39 @@ +import org.aspectj.lang.annotation.*; + +public class Basic3c { + public static void main(String []argv) { + Basic3c b = new Basic3c(); + if (!(b instanceof X.I)) throw new RuntimeException("Basic3c should implement I"); + ((X.I)b).m2(); + ((X.I)b).m3(); + ((X.I)b).m2(); + ((X.I)b).m4(); + } +} + + + +@Aspect class X { + + interface I { + public void m2(); + public void m3(); + public void m4(); + } + + class IImpl implements I { + public void m2() { } + public void m3() { } + public void m4() { } + } + + + @DeclareParents(value="Basic3c",defaultImpl=IImpl.class) + private I simplefield; + + + @Before("call(* *(..))") + public void advice1() {} + +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java index 3a972a7c5..75bb203f3 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java @@ -46,7 +46,8 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testDecps2() { runTest("decps - 2");} public void testDecps2b() { runTest("decps - 2b");} public void testDecps3() { runTest("decps - 3");} - // public void testDecps3b() { runTest("decps - 3b");} + public void testDecps3b() { runTest("decps - 3b");} + public void testDecps3c() { runTest("decps - 3c");} public void testVarargsNPE_pr120826() { runTest("varargs NPE");} public void testNamedPointcutPertarget_pr120521() { runTest("named pointcut not resolved in pertarget pointcut");} diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 9eb5da00f..7115d779e 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -160,6 +160,12 @@ + + + + + + -- 2.39.5