diff options
author | avasseur <avasseur> | 2005-06-20 13:41:09 +0000 |
---|---|---|
committer | avasseur <avasseur> | 2005-06-20 13:41:09 +0000 |
commit | f5739c0e7b76064306b96e4708655ac3db97c011 (patch) | |
tree | 9ff6d0bb5a171451c40ccd073c22a7c2d8855b0f /tests | |
parent | dba4b6dcbb62659085e8599bd0694049ae56af9d (diff) | |
download | aspectj-f5739c0e7b76064306b96e4708655ac3db97c011.tar.gz aspectj-f5739c0e7b76064306b96e4708655ac3db97c011.zip |
LTW weaver/dump@within option + fix a sout in weaver
Diffstat (limited to 'tests')
6 files changed, 84 insertions, 0 deletions
diff --git a/tests/java5/ataspectj/ajc-ant.xml b/tests/java5/ataspectj/ajc-ant.xml index 0703756e5..e4d4008eb 100644 --- a/tests/java5/ataspectj/ajc-ant.xml +++ b/tests/java5/ataspectj/ajc-ant.xml @@ -51,5 +51,13 @@ </java> </target> + <target name="ltw.DumpTest"> + <java fork="yes" classname="ataspectj.DumpTest" failonerror="yes"> + <classpath refid="aj.path"/> + <jvmarg value="-javaagent:${aj.root}/lib/test/loadtime5.jar"/> + <jvmarg value="-Daj5.def=ataspectj/aop-dump.xml"/> + </java> + </target> + <target name="javac.ltw" depends="compile:javac, ltw"/> </project>
\ No newline at end of file diff --git a/tests/java5/ataspectj/ataspectj/DumpTest.java b/tests/java5/ataspectj/ataspectj/DumpTest.java new file mode 100644 index 000000000..58031604c --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/DumpTest.java @@ -0,0 +1,40 @@ +/******************************************************************************* + * Copyright (c) 2005 Contributors. + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alexandre Vasseur initial implementation + *******************************************************************************/ +package ataspectj; + +import junit.framework.TestCase; + +import java.io.File; + +/** + * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> + */ +public class DumpTest extends TestCase { + + public static void main(String[] args) { + TestHelper.runAndThrowOnFailure(suite()); + } + + public static junit.framework.Test suite() { + return new junit.framework.TestSuite(DumpTest.class); + } + + public void testDump() { + File f = new File("_ajdump/ataspectj/DumpTest.class"); + assertFalse(f.exists()); + + DumpTestTheDump forceLoad = new DumpTestTheDump(); + f = new File("_ajdump/ataspectj/DumpTestTheDump.class"); + assertTrue(f.exists()); + } + +} diff --git a/tests/java5/ataspectj/ataspectj/DumpTestTheDump.java b/tests/java5/ataspectj/ataspectj/DumpTestTheDump.java new file mode 100644 index 000000000..d2f65ff34 --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/DumpTestTheDump.java @@ -0,0 +1,18 @@ +/******************************************************************************* + * Copyright (c) 2005 Contributors. + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://eclipse.org/legal/epl-v10.html + * + * Contributors: + * Alexandre Vasseur initial implementation + *******************************************************************************/ +package ataspectj; + +/** + * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> + */ +public class DumpTestTheDump { +} diff --git a/tests/java5/ataspectj/ataspectj/aop-dump.xml b/tests/java5/ataspectj/ataspectj/aop-dump.xml new file mode 100644 index 000000000..76bfda829 --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/aop-dump.xml @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<aspectj> + <weaver options="-XmessageHolderClass:ataspectj.TestHelper"> + <dump within="ataspectj.DumpTestThe*"/> + </weaver> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java index 145426d70..e6e354de6 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java @@ -66,4 +66,8 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { runTest("AjcLTW AroundInlineMungerTest2"); } + public void testLTWDump() { + runTest("LTW DumpTest"); + } + } diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml index 5a770808a..6cd0caccc 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml @@ -78,4 +78,12 @@ options="-1.5 -Xreweavable"/> <ant file="ajc-ant.xml" target="ltw.AroundInlineMungerTest2" verbose="true"/> </ajc-test> + + <ajc-test dir="java5/ataspectj" title="LTW DumpTest"> + <compile + files="ataspectj/DumpTest.java,ataspectj/DumpTestTheDump.java,ataspectj/TestHelper.java" + options="-1.5"/> + <ant file="ajc-ant.xml" target="ltw.DumpTest" verbose="true"/> + </ajc-test> + </suite>
\ No newline at end of file |