--- /dev/null
+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
--- /dev/null
+public class HelloWorld {
+
+ public static void main (String[] args) throws Exception {
+ System.out.println("Hello World!");
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<!-- ajc-ant script, not to be used from Ant commant line - see AntSpec -->
+<project name="ltw">
+
+ <!-- using this we can debug the forked VM -->
+ <property
+ name="jdwp"
+ value="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"/>
+
+ <target name="TestServer with duplicate configuration">
+ <copy file="${aj.root}/tests/bugs153/pr157474/server-applicationandlibrary.properties"
+ tofile="${aj.sandbox}/server.properties"/>
+
+ <mkdir dir="${aj.sandbox}/Application"/>
+ <copy file="${aj.root}/tests/bugs153/pr157474/aop-application.xml"
+ tofile="${aj.sandbox}/Application/META-INF/aop.xml"/>
+
+ <java fork="yes" classname="org.aspectj.testing.server.TestServer" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
+ <jvmarg value="-Daj.weaving.verbose=true"/>
+ <jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
+<!-- <jvmarg value="-Dorg.aspectj.testing.server.debug=true"/>-->
+ <arg path="${aj.sandbox}"/>
+ </java>
+ </target>
+
+</project>
--- /dev/null
+<aspectj>
+ <aspects>
+ <concrete-aspect name="HelloWorldTracing" extends="AbstractTracing">
+ <pointcut name="scope" expression="within(HelloWorld)"/>
+ </concrete-aspect>
+ </aspects>
+
+ <weaver options="-debug"/>
+</aspectj>
\ No newline at end of file
--- /dev/null
+# 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
--- /dev/null
+public aspect Tracing {
+
+ before () : execution(public static void main(String[])) {
+ System.out.println("? " + thisJoinPointStaticPart.getSignature().getName());
+ }
+}
\ No newline at end of file
<jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
<jvmarg value="-Daj.weaving.verbose=true"/>
<jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
- <jvmarg value="-Dorg.aspectj.testing.server.debug=true"/>
+<!-- <jvmarg value="-Dorg.aspectj.testing.server.debug=true"/>-->
<arg path="${aj.sandbox}"/>
</java>
</target>
<jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
<jvmarg value="-Daj.weaving.verbose=true"/>
<jvmarg value="-Dorg.aspectj.weaver.showWeaveInfo=true"/>
- <jvmarg value="-Dorg.aspectj.testing.server.debug=true"/>
+<!-- <jvmarg value="-Dorg.aspectj.testing.server.debug=true"/>-->
<arg path="${aj.sandbox}"/>
</java>
</target>
<jvmarg value="-Dorg.aspectj.tracing.debug=true"/>
<!-- use META-INF/aop.xml style -->
<!-- <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>-->
+<!-- <jvmarg line="${jdwp}"/>-->
+ </java>
+ </target>
+
+ <!-- We have three JARs files, two containing aspects (ExceptionHandler and Tracing)
+ for which aop-ajc.xml files have been generate. However we supply our own
+ aop.xml which declares only ExceptionHandler. We then override the
+ configuration search path -->
+ <target name="override default path using -Dorg.aspectj.weaver.loadtime.configuration">
+ <copy file="${aj.root}/tests/ltw/aop-orgaspectjweaverloadtimeconfiguration.xml"
+ tofile="${aj.sandbox}/META-INF/aop-random.xml"/>
+ <java fork="yes" classname="HelloWorld" failonerror="yes">
+ <classpath refid="aj.path"/>
+ <classpath>
+ <pathelement path="${aj.sandbox}/hello.jar:${aj.sandbox}/handler.jar:${aj.sandbox}/tracing.jar"/>
+ </classpath>
+ <jvmarg value="-Dorg.aspectj.weaver.loadtime.configuration=META-INF/aop-random.xml"/>
+ <jvmarg value="-Dorg.aspectj.tracing.enabled=true"/>
+ <jvmarg value="-Dorg.aspectj.tracing.factory=default"/>
+ <jvmarg value="-Dorg.aspectj.tracing.messages=true"/>
+ <!-- use META-INF/aop.xml style -->
+ <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/>
<!-- <jvmarg line="${jdwp}"/>-->
</java>
</target>
--- /dev/null
+<aspectj>
+ <aspects>
+ <aspect name="ExceptionHandler"/>
+ </aspects>
+</aspectj>
\ No newline at end of file
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
<line text="info AspectJ Weaver Version"/>
<line text="info register classloader"/>
<line text="info using"/>
+ <line text="info define aspect ConcreteAspect"/>
<line text="debug generating class 'ConcreteAspect'"/>
<line text="debug weaving 'Main'"/>
<line text="AbstractSuperAspect.before_test1"/>
</stdout>
</ant>
</ajc-test>
+
+ <ajc-test dir="ltw" title="override default path using -Dorg.aspectj.weaver.loadtime.configuration" keywords="ltw">
+ <compile files="HelloWorld.java" options="-outjar hello.jar"/>
+ <compile files="ExceptionHandler.aj" options="-outxml -outjar handler.jar"/>
+ <compile files="Tracing.aj" options="-outxml -outjar tracing.jar"/>
+ <ant file="ant.xml" target="override default path using -Dorg.aspectj.weaver.loadtime.configuration" verbose="true">
+ <stdout>
+ <line text="Hello World!"/>
+ </stdout>
+ </ant>
+ </ajc-test>
\ No newline at end of file
suite.addTest(Ajc153Tests.suite());
suite.addTest(JDTLikeHandleProviderTests.suite());
suite.addTest(PipeliningTests.suite());
+ suite.addTest(LTWServer153Tests.suite());
//$JUnit-END$
return suite;
}
--- /dev/null
+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");
+ }
+
+}
<message kind="warning" line="27" text="adviceDidNotMatch"/>
</compile>
</ajc-test>
+
+ <ajc-test dir="bugs153/pr157474" title="TestServer with duplicate configuration" keywords="ltw,server">
+ <compile files="AbstractTracing.aj" options="-outjar library.jar -outxml"/>
+ <compile files="HelloWorld.java" options="-outjar application.jar"/>
+ <ant file="ant-server.xml" target="TestServer with duplicate configuration" verbose="true">
+ <stdout>
+ <line text="Starting ..."/>
+ <line text="Running HelloWorld"/>
+ <line text="? main"/>
+ <line text="Hello World!"/>
+ <line text="Stopping ..."/>
+ </stdout>
+ </ant>
+ </ajc-test>
</suite>
\ No newline at end of file
<line text="info register aspect IncludedAspect"/>
<line text="warning aspect ExcludedAspect exluded"/>
<line text="warning aspect ExcludedAspect exluded"/>
+ <line text="info define aspect IncludedMissingAspect"/>
<line text="error Cannot find m_parent aspect"/>
<line text="error Cannot find m_parent aspect"/>
<line text="error Concrete-aspect 'IncludedMissingAspect' could not be registered"/>