]> source.dussan.org Git - aspectj.git/commitdiff
124460: simple basic control of weaving via aop.xml
authoraclement <aclement>
Mon, 9 Feb 2009 20:13:30 +0000 (20:13 +0000)
committeraclement <aclement>
Mon, 9 Feb 2009 20:13:30 +0000 (20:13 +0000)
tests/src/org/aspectj/systemtest/ajc164/Ajc164Tests.java
tests/src/org/aspectj/systemtest/ajc164/ajc164.xml

index 6b0f35462bed7d74ac1b613ae8111374adcc775d..1bc7ddc30b21211598e2f4bf8719a50de3809bfb 100644 (file)
@@ -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");
        }
index 60cac88f378c7f78a1738e0f23383303f89e749c..7b984bc581b70a9cf0535b398fc2841764a9135c 100644 (file)
@@ -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.&lt;clinit&gt;())' in Type 'A' (A.java:1) advised by before advice from 'A' (A.java:2)"/>
       </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>