aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authormwebster <mwebster>2006-08-15 15:34:56 +0000
committermwebster <mwebster>2006-08-15 15:34:56 +0000
commit3b517caf402c6d7c52d4bcbdc86c7528ab828ec9 (patch)
tree35747fa504d6694aae47bc22ce4e4f6f9920e5c2 /tests
parent82e3e13c66720ed17399821d478c31151b2d2234 (diff)
downloadaspectj-3b517caf402c6d7c52d4bcbdc86c7528ab828ec9.tar.gz
aspectj-3b517caf402c6d7c52d4bcbdc86c7528ab828ec9.zip
Bug 153907 "Facilitate LTW testing in a custom ClassLoader hierarchy" (TestServer, TestServerTest and LTWServerTests)
Diffstat (limited to 'tests')
-rw-r--r--tests/ltw/Child.java9
-rw-r--r--tests/ltw/Parent.java5
-rw-r--r--tests/ltw/ant-server.xml33
-rw-r--r--tests/ltw/server-helloworld.properties5
-rw-r--r--tests/ltw/server-parentandchild.properties6
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ltw/LTWServerTests.java27
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml27
8 files changed, 114 insertions, 0 deletions
diff --git a/tests/ltw/Child.java b/tests/ltw/Child.java
new file mode 100644
index 000000000..4719933f0
--- /dev/null
+++ b/tests/ltw/Child.java
@@ -0,0 +1,9 @@
+public class Child extends Parent {
+ public Child () {
+ System.out.println("Child");
+ }
+
+ public static void main (String[] args) {
+ new Child();
+ }
+} \ No newline at end of file
diff --git a/tests/ltw/Parent.java b/tests/ltw/Parent.java
new file mode 100644
index 000000000..b239a9829
--- /dev/null
+++ b/tests/ltw/Parent.java
@@ -0,0 +1,5 @@
+public class Parent {
+ public Parent () {
+ System.out.println("Parent");
+ }
+} \ No newline at end of file
diff --git a/tests/ltw/ant-server.xml b/tests/ltw/ant-server.xml
new file mode 100644
index 000000000..15ec3b945
--- /dev/null
+++ b/tests/ltw/ant-server.xml
@@ -0,0 +1,33 @@
+<!-- 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 HelloWorld">
+ <copy file="${aj.root}/tests/ltw/server-helloworld.properties"
+ tofile="${aj.sandbox}/server.properties"/>
+ <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"/>
+ <arg path="${aj.sandbox}"/>
+ </java>
+ </target>
+
+ <target name="TestServer with Parent and Child">
+ <copy file="${aj.root}/tests/ltw/server-parentandchild.properties"
+ tofile="${aj.sandbox}/server.properties"/>
+ <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"/>
+ <arg path="${aj.sandbox}"/>
+ </java>
+ </target>
+
+</project>
diff --git a/tests/ltw/server-helloworld.properties b/tests/ltw/server-helloworld.properties
new file mode 100644
index 000000000..baf42dbe0
--- /dev/null
+++ b/tests/ltw/server-helloworld.properties
@@ -0,0 +1,5 @@
+# loader.XXX=Name,Classpath[,Parent]
+loader.application=Application,hello.jar;handler.jar
+
+# main=Class,Loader
+main=HelloWorld,Application \ No newline at end of file
diff --git a/tests/ltw/server-parentandchild.properties b/tests/ltw/server-parentandchild.properties
new file mode 100644
index 000000000..d0a7af85e
--- /dev/null
+++ b/tests/ltw/server-parentandchild.properties
@@ -0,0 +1,6 @@
+# loader.XXX=Name,Classpath[,Parent]
+loader.parent=Parent,parent.jar
+loader.child=Child,child.jar,Parent
+
+# main=Class,Loader
+main=Child,Child \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
index 472809138..0d83ed149 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/AllTestsAspectJ150.java
@@ -13,6 +13,7 @@ package org.aspectj.systemtest.ajc150;
import org.aspectj.systemtest.ajc150.ataspectj.AtAjSyntaxTests;
import org.aspectj.systemtest.ajc150.ataspectj.AtAjMisuseTests;
import org.aspectj.systemtest.ajc150.ataspectj.AtAjLTWTests;
+import org.aspectj.systemtest.ajc150.ltw.LTWServerTests;
import org.aspectj.systemtest.ajc150.ltw.LTWTests;
import junit.framework.Test;
@@ -55,6 +56,7 @@ public class AllTestsAspectJ150 {
suite.addTest(HasMember.suite());
suite.addTestSuite(LTWTests.class);
+ suite.addTestSuite(LTWServerTests.class);
//$JUnit-END$
return suite;
}
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWServerTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWServerTests.java
new file mode 100644
index 000000000..b187c609b
--- /dev/null
+++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWServerTests.java
@@ -0,0 +1,27 @@
+package org.aspectj.systemtest.ajc150.ltw;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class LTWServerTests extends XMLBasedAjcTestCase {
+
+ public static Test suite() {
+ return loadSuite(LTWServerTests.class);
+ }
+
+ protected File getSpecFile() {
+ return new File("../tests/src/org/aspectj/systemtest/ajc150/ltw/ltw.xml");
+ }
+
+ public void testServerWithHelloWorld () {
+ runTest("TestServer with HelloWorld");
+ }
+
+ public void testServerWithParentAndChild () {
+ runTest("TestServer with Parent and Child");
+ }
+
+}
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 1866789ef..e80293aee 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml
@@ -558,4 +558,31 @@
</ant>
</ajc-test>
+ <ajc-test dir="ltw" title="TestServer with HelloWorld" keywords="ltw,server">
+ <compile files="HelloWorld.java" options="-outjar hello.jar"/>
+ <compile files="ExceptionHandler.aj" options="-outxml -outjar handler.jar"/>
+ <ant file="ant-server.xml" target="TestServer with HelloWorld" verbose="true">
+ <stdout>
+ <line text="Starting ..."/>
+ <line text="Running HelloWorld"/>
+ <line text="Hello World!"/>
+ <line text="Stopping ..."/>
+ </stdout>
+ </ant>
+ </ajc-test>
+
+ <ajc-test dir="ltw" title="TestServer with Parent and Child" keywords="ltw,server">
+ <compile files="Parent.java" options="-outjar parent.jar"/>
+ <compile files="Child.java" options="-classpath parent.jar -outjar child.jar"/>
+ <ant file="ant-server.xml" target="TestServer with Parent and Child" verbose="true">
+ <stdout>
+ <line text="Starting ..."/>
+ <line text="Running Child"/>
+ <line text="Parent"/>
+ <line text="Child"/>
+ <line text="Stopping ..."/>
+ </stdout>
+ </ant>
+ </ajc-test>
+
\ No newline at end of file