diff options
author | aclement <aclement> | 2005-11-24 09:27:06 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-24 09:27:06 +0000 |
commit | 76d7e83c7fdce7555ce9d9c6ca5bfaaf31d234db (patch) | |
tree | 32c15c85d7c0593cfdf3ebc82582e7f3d88970db /tests | |
parent | 96ff35e46ffd3ecf9f437465629e2ec1140c9267 (diff) | |
download | aspectj-76d7e83c7fdce7555ce9d9c6ca5bfaaf31d234db.tar.gz aspectj-76d7e83c7fdce7555ce9d9c6ca5bfaaf31d234db.zip |
matthews patches from 116899
Diffstat (limited to 'tests')
9 files changed, 135 insertions, 8 deletions
diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/Main.java b/tests/java5/ataspectj/ataspectj/ltwlog/Main.java new file mode 100644 index 000000000..7bbffd74b --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/ltwlog/Main.java @@ -0,0 +1,29 @@ +/******************************************************************************* + * 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.ltwlog; + +import java.util.ArrayList; +import java.util.Arrays; + +/** + * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> + */ +public class Main { + + void target() {}; + + public static void main(String args[]) throws Throwable { + new Main().target(); + } + + +} diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/MessageHolder.java b/tests/java5/ataspectj/ataspectj/ltwlog/MessageHolder.java index 4f245ab35..03983cfc4 100644 --- a/tests/java5/ataspectj/ataspectj/ltwlog/MessageHolder.java +++ b/tests/java5/ataspectj/ataspectj/ltwlog/MessageHolder.java @@ -28,6 +28,7 @@ public class MessageHolder extends DefaultMessageHandler { static List s_messages = new ArrayList(); public MessageHolder() { + System.out.println("MessageHolder.MessageHolder()"); } public boolean handleMessage(IMessage message) throws AbortException { diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/aop-messagehandler.xml b/tests/java5/ataspectj/ataspectj/ltwlog/aop-messagehandler.xml new file mode 100644 index 000000000..16ca3d7c8 --- /dev/null +++ b/tests/java5/ataspectj/ataspectj/ltwlog/aop-messagehandler.xml @@ -0,0 +1,6 @@ +<aspectj> + <weaver options="-XmessageHandlerClass:ataspectj.ltwlog.MessageHolder -showWeaveInfo -verbose"/> + <aspects> + <aspect name="ataspectj.ltwlog.Aspect1"/> + </aspects> +</aspectj> diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/aop-silent.xml b/tests/java5/ataspectj/ataspectj/ltwlog/aop-silent.xml index 6e320f1d2..0b0a8622f 100644 --- a/tests/java5/ataspectj/ataspectj/ltwlog/aop-silent.xml +++ b/tests/java5/ataspectj/ataspectj/ltwlog/aop-silent.xml @@ -1,5 +1,4 @@ <aspectj> - <weaver options="-XmessageHandlerClass:ataspectj.ltwlog.MessageHolder"/> <aspects> <aspect name="ataspectj.ltwlog.Aspect1"/> </aspects> diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/aop-verbose.xml b/tests/java5/ataspectj/ataspectj/ltwlog/aop-verbose.xml index c7756c8e5..7cd1b4629 100644 --- a/tests/java5/ataspectj/ataspectj/ltwlog/aop-verbose.xml +++ b/tests/java5/ataspectj/ataspectj/ltwlog/aop-verbose.xml @@ -1,5 +1,5 @@ <aspectj> - <weaver options="-XmessageHandlerClass:ataspectj.ltwlog.MessageHolder -verbose"/> + <weaver options="-verbose"/> <aspects> <aspect name="ataspectj.ltwlog.Aspect1"/> </aspects> diff --git a/tests/java5/ataspectj/ataspectj/ltwlog/aop-verboseandshow.xml b/tests/java5/ataspectj/ataspectj/ltwlog/aop-verboseandshow.xml index 492d6df63..557ad27a5 100644 --- a/tests/java5/ataspectj/ataspectj/ltwlog/aop-verboseandshow.xml +++ b/tests/java5/ataspectj/ataspectj/ltwlog/aop-verboseandshow.xml @@ -1,5 +1,5 @@ <aspectj> - <weaver options="-XmessageHandlerClass:ataspectj.ltwlog.MessageHolder -showWeaveInfo -verbose -Xreweavable"/> + <weaver options="-showWeaveInfo -verbose"/> <aspects> <aspect name="ataspectj.ltwlog.Aspect1"/> </aspects> diff --git a/tests/ltw/aop-abstractaspect.xml b/tests/ltw/aop-abstractaspect.xml index abd54cc96..7f82c94ee 100644 --- a/tests/ltw/aop-abstractaspect.xml +++ b/tests/ltw/aop-abstractaspect.xml @@ -3,6 +3,6 @@ <aspect name="AbstractAspect"/> </aspects> - <weaver options="-showWeaveInfo -verbose"/> + <weaver options="-showWeaveInfo"/> </aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java index 5b0d24e70..27d485d46 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/AtAjLTWTests.java @@ -73,8 +73,20 @@ public class AtAjLTWTests extends XMLBasedAjcTestCase { runTest("Ajc Aspect1 LTW Aspect2 -Xreweavable"); } - public void testLTWLog() { - runTest("LTW Log"); + public void testLTWLogSilent() { + runTest("LTW Log silent"); + } + + public void testLTWLogVerbose() { + runTest("LTW Log verbose"); + } + + public void testLTWLogVerboseAndShow() { + runTest("LTW Log verbose and showWeaveInfo"); + } + + public void testLTWLogMessageHandlerClass() { + runTest("LTW Log messageHandlerClass"); } public void testLTWUnweavable() { diff --git a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml index 7122a2a70..c3d0045d8 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ataspectj/ltw.xml @@ -94,8 +94,88 @@ <ant file="ajc-ant.xml" target="ltw.Aspect2MainTest" verbose="true"/> </ajc-test> - <ajc-test dir="java5/ataspectj" title="LTW Log"> - <ant file="ajc-ant.xml" target="ltwlog.LTWLog" verbose="true"/> + <ajc-test dir="java5/ataspectj" title="LTW Log silent"> + <compile + files="ataspectj/ltwlog/Main.java" + options="-1.5" + /> + <compile + files="ataspectj/ltwlog/Aspect1.java" + options="-1.5 -XnoWeave" + > + </compile> + <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-silent.xml"> + <stdout> + <line text="execution(Main.target())"/> + </stdout> + <stderr> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="java5/ataspectj" title="LTW Log verbose"> + <compile + files="ataspectj/ltwlog/Main.java" + options="-1.5" + /> + <compile + files="ataspectj/ltwlog/Aspect1.java" + options="-1.5 -XnoWeave" + > + </compile> + <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-verbose.xml"> + <stdout> + <line text="execution(Main.target())"/> + </stdout> + <stderr> + <line text="info register aspect ataspectj.ltwlog.Aspect1"/> + <line text="info weaving 'ataspectj.ltwlog.Main'"/> + <line text="info weaving 'ataspectj.ltwlog.Aspect1'"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="java5/ataspectj" title="LTW Log verbose and showWeaveInfo"> + <compile + files="ataspectj/ltwlog/Main.java" + options="-1.5" + /> + <compile + files="ataspectj/ltwlog/Aspect1.java" + options="-1.5 -XnoWeave" + > + </compile> + <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-verboseandshow.xml"> + <stdout> + <line text="execution(Main.target())"/> + </stdout> + <stderr> + <line text="info register aspect ataspectj.ltwlog.Aspect1"/> + <line text="info weaving 'ataspectj.ltwlog.Main'"/> + <line text="weaveinfo Join point 'method-execution(void ataspectj.ltwlog.Main.target())' in Type 'ataspectj.ltwlog.Main' (Main.java:22) advised by before advice from 'ataspectj.ltwlog.Aspect1' (Aspect1.java)"/> + <line text="info weaving 'ataspectj.ltwlog.Aspect1'"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="java5/ataspectj" title="LTW Log messageHandlerClass"> + <compile + files="ataspectj/ltwlog/Main.java, ataspectj/ltwlog/MessageHolder.java" + options="-1.5" + /> + <compile + files="ataspectj/ltwlog/Aspect1.java" + options="-1.5 -XnoWeave" + > + </compile> + <run class="ataspectj.ltwlog.Main" ltw="ataspectj/ltwlog/aop-messagehandler.xml"> + <stdout> + <line text="MessageHolder.MessageHolder()"/> + <line text="execution(Main.target())"/> + </stdout> + <stderr> + </stderr> + </run> </ajc-test> <ajc-test dir="java5/ataspectj" title="LTW Unweavable"> |