From 3594800a4c212228183822ec2db3962635655d83 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 30 Oct 2008 19:03:56 +0000 Subject: [PATCH] tests for 163005: upgraded test for 80571 --- tests/bugs150/pr80571.aj | 4 +-- tests/bugs163/pr163005/Code.java | 25 +++++++++++++++++++ tests/bugs163/pr163005/Code2.java | 14 +++++++++++ .../org/aspectj/systemtest/ajc150/ajc150.xml | 4 ++- .../systemtest/ajc163/Ajc163Tests.java | 12 +++++++++ .../org/aspectj/systemtest/ajc163/ajc163.xml | 22 ++++++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 tests/bugs163/pr163005/Code.java create mode 100644 tests/bugs163/pr163005/Code2.java diff --git a/tests/bugs150/pr80571.aj b/tests/bugs150/pr80571.aj index f7e3bc806..8991d4030 100644 --- a/tests/bugs150/pr80571.aj +++ b/tests/bugs150/pr80571.aj @@ -1,4 +1,4 @@ -public class pr80571 { +public class pr80571 implements I{ public static void main(String[] args) { new pr80571(); @@ -19,4 +19,4 @@ aspect A { System.out.println("after"); return ret; } -} \ No newline at end of file +} diff --git a/tests/bugs163/pr163005/Code.java b/tests/bugs163/pr163005/Code.java new file mode 100644 index 000000000..5ef476c30 --- /dev/null +++ b/tests/bugs163/pr163005/Code.java @@ -0,0 +1,25 @@ +public aspect Code { + + pointcut init(): initialization(Object+.new(..)); + + pointcut staticinit(): staticinitialization(Object+); + + Class around(String className): cflowbelow(init() || staticinit()) && +call(Class Class.forName(String)) && args(className) { + System.out.println("Test"); + return proceed(className); + + } + public static void main(String[] argv) { + new SomeClass(); + } +} + +class SomeClass implements SomeInterface { + +} + +interface SomeInterface { + Class ADAPTER = SomeInterface.class; +} + diff --git a/tests/bugs163/pr163005/Code2.java b/tests/bugs163/pr163005/Code2.java new file mode 100644 index 000000000..35283a0a8 --- /dev/null +++ b/tests/bugs163/pr163005/Code2.java @@ -0,0 +1,14 @@ +interface Foo { + public static final Object dummy = new Object(); +} + +aspect Code2 { + Object around(): call(Object.new(..)) { + return proceed(); + } + + public static void main(String[] args) { + System.out.println(Foo.dummy); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index ff8924788..67ca6e191 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -1090,7 +1090,9 @@ - + + + diff --git a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java index e0dadda18..e2fcbcca2 100644 --- a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java @@ -23,6 +23,18 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testDontAddMethodBodiesToInterface_pr163005() { + runTest("do not add method bodies to an interface"); + } + + public void testDontAddMethodBodiesToInterface_pr163005_2() { + runTest("do not add method bodies to an interface - 2"); + } + + public void testDontAddMethodBodiesToInterface_pr163005_3() { + runTest("do not add method bodies to an interface - 3"); + } + public void testMissingLocalVariableTableEntriesOnAroundAdvice_pr173978() throws Exception { runTest("missing local variable table on around advice"); JavaClass jc = Utils.getClassFrom(ajc.getSandboxDirectory().getAbsolutePath(), "Test"); diff --git a/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml b/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml index 9119c6f5d..39dba19eb 100644 --- a/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml +++ b/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml @@ -2,6 +2,28 @@ + + + + + + + + + + + + + + + + + + + + + + -- 2.39.5