diff options
author | aclement <aclement> | 2009-02-09 20:13:30 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-02-09 20:13:30 +0000 |
commit | b0089cb8c4931f46ba84a2462d08f3d30488df98 (patch) | |
tree | 1622bc923de7d7422d418f9ad4c130ca0abadcaf | |
parent | 3ba74a5b31180ecd73aa3d7fb9d3c04a2739ec98 (diff) | |
download | aspectj-b0089cb8c4931f46ba84a2462d08f3d30488df98.tar.gz aspectj-b0089cb8c4931f46ba84a2462d08f3d30488df98.zip |
124460: simple basic control of weaving via aop.xml
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java | 23 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc164/ajc164.xml | 20 |
2 files changed, 34 insertions, 9 deletions
diff --git a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java index 6b0f35462..1bc7ddc30 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java @@ -29,16 +29,26 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + public void testHandles_pr263310() { + runTest("inner handles"); + IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); + IProgramElement ipe = null; + ipe = findElementAtLine(top.getRoot(), 13); + assertEquals("<p{HandleTestingAspect.java}HandleTestingAspect[InnerClass}InnerInnerAspect|1", ipe.getHandleIdentifier()); + // ipe = findElementAtLine(top.getRoot(), 29); + // assertEquals("<x*OverrideOptions.aj}OverrideOptions&around!2", ipe.getHandleIdentifier()); + } + public void testHandles_pr263666() { runTest("around advice handles"); IHierarchy top = AsmManager.lastActiveStructureModel.getHierarchy(); IProgramElement ipe = null; - ipe = findElementAtLine(top.getRoot(), 22);// public java.util.List<String> Ship.i(List<String>[][] u) + ipe = findElementAtLine(top.getRoot(), 22); assertEquals("<x*OverrideOptions.aj}OverrideOptions&around", ipe.getHandleIdentifier()); - ipe = findElementAtLine(top.getRoot(), 29);// public java.util.List<String> Ship.i(List<String>[][] u) + ipe = findElementAtLine(top.getRoot(), 29); assertEquals("<x*OverrideOptions.aj}OverrideOptions&around!2", ipe.getHandleIdentifier()); } -/* + // Only one of two aspects named public void testAopConfig1() { runTest("aop config - 1"); @@ -48,7 +58,12 @@ public class Ajc164Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testAopConfig2() { runTest("aop config - 2"); } -*/ + + // Invalid scope specified - cannot be parsed as type pattern + public void testAopConfig3() { + runTest("aop config - 3"); + } + public void testAjcThisNotRead() { runTest("ajcthis not read"); } diff --git a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml index 60cac88f3..7b984bc58 100644 --- a/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml +++ b/tests/src/org/aspectj/systemtest/ajc164/ajc164.xml @@ -2,11 +2,6 @@ <suite> - <ajc-test dir="bugs164/pr263666" title="around advice handles"> - <compile files="x/A.java x/B.java x/OverrideOptions.aj" options="-1.5 -emacssym"/> - </ajc-test> - - <ajc-test dir="features164/aopconfig/one" title="aop config - 1"> <compile files="A.java A2.java B.java foo.xml" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Join point 'staticinitialization(void A.<clinit>())' in Type 'A' (A.java:1) advised by before advice from 'A' (A.java:2)"/> @@ -21,6 +16,21 @@ </compile> </ajc-test> + <ajc-test dir="features164/aopconfig/two" title="aop config - 3"> + <!-- type pattern in the scope in foo.xml is complete nonsense --> + <compile files="A.java B.java foo.xml" options="-1.5 -Xlint:ignore"> + <message kind="error" text="Unable to parse scope as type pattern"/> + </compile> + </ajc-test> + + <ajc-test dir="bugs164/pr263310" title="inner handles"> + <compile files="HandleTestingAspect.java" options="-1.5 -emacssym -Xlint:ignore"/> + </ajc-test> + + <ajc-test dir="bugs164/pr263666" title="around advice handles"> + <compile files="x/A.java x/B.java x/OverrideOptions.aj" options="-1.5 -emacssym"/> + </ajc-test> + <ajc-test dir="bugs164" title="ajcthis not read"> <compile files="pr195090.java" options="-1.5 -warn:+unusedArgument"> </compile> |