diff options
author | aclement <aclement> | 2005-11-15 14:34:45 +0000 |
---|---|---|
committer | aclement <aclement> | 2005-11-15 14:34:45 +0000 |
commit | e8b6bde2173e74a5969162aee2de59eee9476456 (patch) | |
tree | 1c469d92f242d6299a55a9c47f51782066fd3270 /tests | |
parent | fdfc78fba8bbc7afc8cd03e2cf11c3547c032b87 (diff) | |
download | aspectj-e8b6bde2173e74a5969162aee2de59eee9476456.tar.gz aspectj-e8b6bde2173e74a5969162aee2de59eee9476456.zip |
Matthews patches for 115275
Diffstat (limited to 'tests')
4 files changed, 77 insertions, 0 deletions
diff --git a/tests/ltw/aop-aspectsinclude.xml b/tests/ltw/aop-aspectsinclude.xml new file mode 100644 index 000000000..95f73f611 --- /dev/null +++ b/tests/ltw/aop-aspectsinclude.xml @@ -0,0 +1,5 @@ +<aspectj> + <aspects> + <include within="pakkage.*"/> + </aspects> +</aspectj> diff --git a/tests/ltw/aop-aspectsincludewithlintwarning.xml b/tests/ltw/aop-aspectsincludewithlintwarning.xml new file mode 100644 index 000000000..8939234ab --- /dev/null +++ b/tests/ltw/aop-aspectsincludewithlintwarning.xml @@ -0,0 +1,8 @@ +<aspectj> + <aspects> + <include within="pakkage.*"/> + </aspects> + + <weaver options="-Xlint:warning"> + </weaver> +</aspectj> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java index 66eb92c68..ffb52a905 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/LTWTests.java @@ -57,6 +57,14 @@ public class LTWTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("Use abstract aspect for ITD using aop.xml"); } + public void testAspectsInclude () { + runTest("Ensure a subset of inherited aspects is used for weaving"); + } + + public void testAspectsIncludeWithLintWarning () { + runTest("Ensure weaver lint warning issued when an aspect is not used for weaving"); + } + /* * 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 6a8fe1881..69eff31ee 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ltw/ltw-tests.xml @@ -158,4 +158,60 @@ </stderr> </run> </ajc-test> + + <ajc-test dir="ltw" + title="Ensure a subset of inherited aspects is used for weaving" + keywords="aspects, include"> + <compile + files="Main.java" + outjar="main.jar" + > + </compile> + <compile + classpath="main.jar" + files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj" + outjar="aspects.jar" + options="-outxml" + > + </compile> + <run class="Main" ltw="aop-aspectsinclude.xml"> + <stdout> + <line text="Main.main"/> + <line text="Main.test1"/> + <line text="Main.test2"/> + </stdout> + <stderr> + <line text="pakkage.Aspect3.before_test2"/> + </stderr> + </run> + </ajc-test> + + <ajc-test dir="ltw" + title="Ensure weaver lint warning issued when an aspect is not used for weaving" + keywords="aspects, include, lint"> + <compile + files="Main.java" + outjar="main.jar" + > + </compile> + <compile + classpath="main.jar" + files="Aspect1.aj, Aspect2.aj, pakkage/Aspect3.aj" + outjar="aspects.jar" + options="-outxml" + > + </compile> + <run class="Main" ltw="aop-aspectsincludewithlintwarning.xml"> + <stdout> + <line text="Main.main"/> + <line text="Main.test1"/> + <line text="Main.test2"/> + </stdout> + <stderr> + <line text="warning aspect Aspect1 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]"/> + <line text="warning aspect Aspect2 exluded for class loader org.aspectj.weaver.loadtime.WeavingURLClassLoader [Xlint:aspectExcludedByConfiguration]"/> + <line text="pakkage.Aspect3.before_test2"/> + </stderr> + </run> + </ajc-test> |