From a06896ea1981bb66838fbb352249eb614b2f2946 Mon Sep 17 00:00:00 2001 From: mwebster Date: Tue, 19 Sep 2006 15:00:21 +0000 Subject: [PATCH] Bug 157474 "Handle duplicate aop.xml definitions more gracefully" (tests for duplicate aop.xml and -Dorg.aspectj.weaver.loadtime.configuration) --- tests/bugs153/pr157474/AbstractTracing.aj | 8 ++++++ tests/bugs153/pr157474/HelloWorld.java | 7 +++++ tests/bugs153/pr157474/ant-server.xml | 27 +++++++++++++++++++ tests/bugs153/pr157474/aop-application.xml | 9 +++++++ tests/bugs153/pr157474/aop-library.xml | 0 .../server-applicationandlibrary.properties | 7 +++++ tests/ltw/Tracing.aj | 6 +++++ tests/ltw/ant-server.xml | 4 +-- tests/ltw/ant.xml | 22 +++++++++++++++ ...-orgaspectjweaverloadtimeconfiguration.xml | 5 ++++ .../systemtest/ajc150/ltw/LTWTests.java | 5 ++++ .../systemtest/ajc150/ltw/ltw-tests.xml | 12 +++++++++ .../systemtest/ajc153/AllTestsAspectJ153.java | 1 + .../systemtest/ajc153/LTWServer153Tests.java | 23 ++++++++++++++++ .../org/aspectj/systemtest/ajc153/ajc153.xml | 14 ++++++++++ .../aspectj/systemtest/tracing/tracing.xml | 1 + 16 files changed, 149 insertions(+), 2 deletions(-) create mode 100644 tests/bugs153/pr157474/AbstractTracing.aj create mode 100644 tests/bugs153/pr157474/HelloWorld.java create mode 100644 tests/bugs153/pr157474/ant-server.xml create mode 100644 tests/bugs153/pr157474/aop-application.xml create mode 100644 tests/bugs153/pr157474/aop-library.xml create mode 100644 tests/bugs153/pr157474/server-applicationandlibrary.properties create mode 100644 tests/ltw/Tracing.aj create mode 100644 tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml create mode 100644 tests/src/org/aspectj/systemtest/ajc153/LTWServer153Tests.java diff --git a/tests/bugs153/pr157474/AbstractTracing.aj b/tests/bugs153/pr157474/AbstractTracing.aj new file mode 100644 index 000000000..1dfd64f57 --- /dev/null +++ b/tests/bugs153/pr157474/AbstractTracing.aj @@ -0,0 +1,8 @@ +public abstract aspect AbstractTracing { + + protected abstract pointcut scope (); + + before () : execution(public static void main(String[])) && scope() { + System.out.println("? " + thisJoinPointStaticPart.getSignature().getName()); + } +} \ No newline at end of file diff --git a/tests/bugs153/pr157474/HelloWorld.java b/tests/bugs153/pr157474/HelloWorld.java new file mode 100644 index 000000000..8e5a1fdd7 --- /dev/null +++ b/tests/bugs153/pr157474/HelloWorld.java @@ -0,0 +1,7 @@ +public class HelloWorld { + + public static void main (String[] args) throws Exception { + System.out.println("Hello World!"); + } + +} \ No newline at end of file diff --git a/tests/bugs153/pr157474/ant-server.xml b/tests/bugs153/pr157474/ant-server.xml new file mode 100644 index 000000000..af315984a --- /dev/null +++ b/tests/bugs153/pr157474/ant-server.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/bugs153/pr157474/aop-application.xml b/tests/bugs153/pr157474/aop-application.xml new file mode 100644 index 000000000..8654ca277 --- /dev/null +++ b/tests/bugs153/pr157474/aop-application.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/tests/bugs153/pr157474/aop-library.xml b/tests/bugs153/pr157474/aop-library.xml new file mode 100644 index 000000000..e69de29bb diff --git a/tests/bugs153/pr157474/server-applicationandlibrary.properties b/tests/bugs153/pr157474/server-applicationandlibrary.properties new file mode 100644 index 000000000..0fc39dc43 --- /dev/null +++ b/tests/bugs153/pr157474/server-applicationandlibrary.properties @@ -0,0 +1,7 @@ +# loader.XXX=Name,Classpath[,Parent] +loader.parent=Library,Application;library.jar +loader.child=Application,Application;application.jar,Library +#loader.child=Application,Application;library.jar;application.jar + +# main=Class,Loader +main=HelloWorld,Application \ No newline at end of file diff --git a/tests/ltw/Tracing.aj b/tests/ltw/Tracing.aj new file mode 100644 index 000000000..74b0e5a8e --- /dev/null +++ b/tests/ltw/Tracing.aj @@ -0,0 +1,6 @@ +public aspect Tracing { + + before () : execution(public static void main(String[])) { + System.out.println("? " + thisJoinPointStaticPart.getSignature().getName()); + } +} \ No newline at end of file diff --git a/tests/ltw/ant-server.xml b/tests/ltw/ant-server.xml index 1bb336ab1..9960962ca 100644 --- a/tests/ltw/ant-server.xml +++ b/tests/ltw/ant-server.xml @@ -14,7 +14,7 @@ - + @@ -27,7 +27,7 @@ - + diff --git a/tests/ltw/ant.xml b/tests/ltw/ant.xml index dfde53635..db38cb16a 100644 --- a/tests/ltw/ant.xml +++ b/tests/ltw/ant.xml @@ -41,6 +41,28 @@ + + + + + + + + + + + + + + + + + + diff --git a/tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml b/tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml new file mode 100644 index 000000000..232c72ee6 --- /dev/null +++ b/tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index 38346279e..cf59b8cb1 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -137,6 +137,11 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testSeparateCompilationDeclareParentsCall_pr133770() { runTest("separate compilation with ltw: declare parents and call"); } + + public void testConfigutationSystemProperty_pr149289 () { + runTest("override default path using -Dorg.aspectj.weaver.loadtime.configuration"); + + } /* * Allow system properties to be set and restored diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml index 816ff27b2..01167c34e 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -227,6 +227,7 @@ + @@ -581,5 +582,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc153/AllTestsAspectJ153.java b/tests/src/org/aspectj/systemtest/ajc153/AllTestsAspectJ153.java index ae1e9a7e9..2951175f3 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/AllTestsAspectJ153.java +++ b/tests/src/org/aspectj/systemtest/ajc153/AllTestsAspectJ153.java @@ -21,6 +21,7 @@ public class AllTestsAspectJ153 { suite.addTest(Ajc153Tests.suite()); suite.addTest(JDTLikeHandleProviderTests.suite()); suite.addTest(PipeliningTests.suite()); + suite.addTest(LTWServer153Tests.suite()); //$JUnit-END$ return suite; } diff --git a/tests/src/org/aspectj/systemtest/ajc153/LTWServer153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/LTWServer153Tests.java new file mode 100644 index 000000000..151af029d --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc153/LTWServer153Tests.java @@ -0,0 +1,23 @@ +package org.aspectj.systemtest.ajc153; + +import java.io.File; + +import junit.framework.Test; + +import org.aspectj.testing.XMLBasedAjcTestCase; + +public class LTWServer153Tests extends XMLBasedAjcTestCase { + + public static Test suite() { + return loadSuite(LTWServer153Tests.class); + } + + protected File getSpecFile() { + return new File("../tests/src/org/aspectj/systemtest/ajc153/ajc153.xml"); + } + + public void testHandleDuplicateConfiguration_pr157474 () { + runTest("TestServer with duplicate configuration"); + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml index 8070cdd30..2beddab01 100644 --- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml +++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml @@ -423,5 +423,19 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/tracing/tracing.xml b/tests/src/org/aspectj/systemtest/tracing/tracing.xml index bed65f12d..eb5998149 100644 --- a/tests/src/org/aspectj/systemtest/tracing/tracing.xml +++ b/tests/src/org/aspectj/systemtest/tracing/tracing.xml @@ -50,6 +50,7 @@ + -- 2.39.5