diff options
author | aclement <aclement> | 2005-12-06 13:02:38 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-12-06 13:02:38 +0000 |
commit | 1e1bbb3f2e7aab4757d715d76730cb68cceb3b87 (patch) | |
tree | abba06b491b9f90fb43ddb64028ef3d556bab334 /tests | |
parent | f40d02927635b6171083229fe6d48f326da06cc7 (diff) | |
download | aspectj-1e1bbb3f2e7aab4757d715d76730cb68cceb3b87.tar.gz aspectj-1e1bbb3f2e7aab4757d715d76730cb68cceb3b87.zip |
fixes for 118715 from Matthew.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ltw/Aspect3.aj | 19 | ||||
-rw-r--r-- | tests/ltw/Xlint-empty.properties | 0 | ||||
-rw-r--r-- | tests/ltw/Xlint-nomatch.properties | 1 | ||||
-rw-r--r-- | tests/ltw/aop-nomatch.xml | 7 | ||||
-rw-r--r-- | tests/ltw/aop-nomatchxlint.xml | 7 | ||||
-rw-r--r-- | tests/ltw/aop-nomatchxlintfile.xml | 7 | ||||
-rw-r--r-- | tests/ltw/aop-xlintfile.xml | 3 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java | 24 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml | 107 |
9 files changed, 175 insertions, 0 deletions
diff --git a/tests/ltw/Aspect3.aj b/tests/ltw/Aspect3.aj new file mode 100644 index 000000000..c27d9e1c2 --- /dev/null +++ b/tests/ltw/Aspect3.aj @@ -0,0 +1,19 @@ +/******************************************************************************* + * 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: + * Matthew Webster initial implementation + *******************************************************************************/ +import org.aspectj.lang.JoinPoint; + +public aspect Aspect3 { + + before () : execution(void Main.test999()) { + System.err.println("Aspect1.before_" + thisJoinPoint.getSignature().getName()); + } +} diff --git a/tests/ltw/Xlint-empty.properties b/tests/ltw/Xlint-empty.properties new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/tests/ltw/Xlint-empty.properties diff --git a/tests/ltw/Xlint-nomatch.properties b/tests/ltw/Xlint-nomatch.properties new file mode 100644 index 000000000..00f96a1c9 --- /dev/null +++ b/tests/ltw/Xlint-nomatch.properties @@ -0,0 +1 @@ +adviceDidNotMatch = warning diff --git a/tests/ltw/aop-nomatch.xml b/tests/ltw/aop-nomatch.xml new file mode 100644 index 000000000..620a4c77e --- /dev/null +++ b/tests/ltw/aop-nomatch.xml @@ -0,0 +1,7 @@ +<aspectj> + <aspects> + <aspect name="Aspect3"/> + </aspects> + + <weaver options="-verbose -showWeaveInfo"/> +</aspectj> diff --git a/tests/ltw/aop-nomatchxlint.xml b/tests/ltw/aop-nomatchxlint.xml new file mode 100644 index 000000000..4271e394d --- /dev/null +++ b/tests/ltw/aop-nomatchxlint.xml @@ -0,0 +1,7 @@ +<aspectj> + <aspects> + <aspect name="Aspect3"/> + </aspects> + + <weaver options="-verbose -showWeaveInfo -Xlint:warning"/> +</aspectj> diff --git a/tests/ltw/aop-nomatchxlintfile.xml b/tests/ltw/aop-nomatchxlintfile.xml new file mode 100644 index 000000000..35ce126e3 --- /dev/null +++ b/tests/ltw/aop-nomatchxlintfile.xml @@ -0,0 +1,7 @@ +<aspectj> + <aspects> + <aspect name="Aspect3"/> + </aspects> + + <weaver options="-verbose -showWeaveInfo -Xlintfile:Xlint-nomatch.properties"/> +</aspectj> diff --git a/tests/ltw/aop-xlintfile.xml b/tests/ltw/aop-xlintfile.xml new file mode 100644 index 000000000..31d7bad16 --- /dev/null +++ b/tests/ltw/aop-xlintfile.xml @@ -0,0 +1,3 @@ +<aspectj> + <weaver options="-Xlintfile:Xlint-empty.properties"/> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index ffb52a905..57ca49810 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -65,6 +65,30 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("Ensure weaver lint warning issued when an aspect is not used for weaving"); } + public void testXlintfileEmpty () { + runTest("Empty Xlint.properties file"); + } + + public void testXlintfileMissing () { + runTest("Warning with missing Xlint.properties file"); + } + + public void testXlintWarningAdviceDidNotMatchSuppressed () { + runTest("Warning when advice doesn't match suppressed for LTW"); + } + + public void testXlintfile () { + runTest("Override suppressing of warning when advice doesn't match using -Xlintfile"); + } + + public void testXlintDefault () { + runTest("Warning when advice doesn't match using -Xlint:default"); + } + + public void testXlintWarning () { + runTest("Override suppressing of warning when advice doesn't match using -Xlint:warning"); + } + /* * Allow system properties to be set and restored * TODO maw move to XMLBasedAjcTestCase or RunSpec 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 69eff31ee..284357e42 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -1,3 +1,4 @@ + <!-- Load-time weaving tests --> <ajc-test dir="ltw" @@ -215,3 +216,109 @@ </run> </ajc-test> + <ajc-test dir="ltw" + title="Empty Xlint.properties file" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <run class="Main" ltw="aop-xlintfile.xml" xlintfile="Xlint-empty.properties"> + <stderr> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Warning with missing Xlint.properties file" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <run class="Main" ltw="aop-xlintfile.xml"> + <stderr> + <line text="warning Cannot access resource for -Xlintfile:Xlint-empty.properties"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Warning when advice doesn't match suppressed for LTW" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <compile + files="Aspect3.aj" + > + </compile> + <run class="Main" ltw="aop-nomatch.xml"> + <stderr> + <line text="info register aspect Aspect3"/> + <line text="info weaving 'Main'"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Override suppressing of warning when advice doesn't match using -Xlintfile" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <compile + files="Aspect3.aj" + > + </compile> + <run class="Main" ltw="aop-nomatchxlintfile.xml" xlintfile="Xlint-nomatch.properties"> + <stderr> + <line text="info register aspect Aspect3"/> + <line text="info weaving 'Main'"/> + <line text="advice defined in Aspect3 has not been applied [Xlint:adviceDidNotMatch]"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Warning when advice doesn't match using -Xlint:default" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <compile + files="Aspect3.aj" + > + </compile> + <run class="Main" ltw="aop-nomatchxlint.xml"> + <stderr> + <line text="info register aspect Aspect3"/> + <line text="info weaving 'Main'"/> + <line text="advice defined in Aspect3 has not been applied [Xlint:adviceDidNotMatch]"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Override suppressing of warning when advice doesn't match using -Xlint:warning" + keywords="xlint, ltw"> + <compile + files="Main.java" + > + </compile> + <compile + files="Aspect3.aj" + > + </compile> + <run class="Main" ltw="aop-nomatchxlint.xml"> + <stderr> + <line text="info register aspect Aspect3"/> + <line text="info weaving 'Main'"/> + <line text="advice defined in Aspect3 has not been applied [Xlint:adviceDidNotMatch]"/> + </stderr> + </run> + </ajc-test> + |