diff options
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"> |