]> source.dussan.org Git - aspectj.git/commitdiff
211052 - testcode
authoraclement <aclement>
Mon, 3 Dec 2007 14:54:32 +0000 (14:54 +0000)
committeraclement <aclement>
Mon, 3 Dec 2007 14:54:32 +0000 (14:54 +0000)
tests/src/org/aspectj/systemtest/ajc154/Ajc154Tests.java
tests/src/org/aspectj/systemtest/ajc154/ajc154.xml

index 76c2eb154740386113f94b5ae8e7199735c75834..a003eddf1e5f43ed8b46bedafa314e95e2e06abb 100644 (file)
@@ -23,7 +23,6 @@ import org.aspectj.apache.bcel.generic.MethodGen;
 import org.aspectj.apache.bcel.util.ClassPath;
 import org.aspectj.apache.bcel.util.SyntheticRepository;
 import org.aspectj.testing.XMLBasedAjcTestCase;
-import org.aspectj.weaver.patterns.PatternParser;
 import org.aspectj.weaver.tools.ContextBasedMatcher;
 import org.aspectj.weaver.tools.FuzzyBoolean;
 import org.aspectj.weaver.tools.MatchingContext;
@@ -47,6 +46,17 @@ public class Ajc154Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
        //public void testAfterThrowingAnnotationStyle_pr211674_1() { runTest("after throwing annotation style problem - 1");}
        //public void testAfterThrowingAnnotationStyle_pr211674_2() { runTest("after throwing annotation style problem - 2");}
 
+       // Testing some issues with declare at type
+       public void testDeclareAtTypeProblems_pr211052_1() { runTest("declare atType problems - 1"); }
+       public void testDeclareAtTypeProblems_pr211052_2() { runTest("declare atType problems - 2"); }
+       public void testDeclareAtTypeProblems_pr211052_3() { runTest("declare atType problems - 3"); }
+       public void testDeclareAtTypeProblems_pr211052_4() { runTest("declare atType problems - 4"); }
+       public void testDeclareAtTypeProblems_pr211052_5() { runTest("declare atType problems - 5"); }
+       // declare at type and binary weaving
+       public void testDeclareAtTypeProblems_pr211052_6() { runTest("declare atType problems - 6"); }
+       public void testDeclareAtTypeProblems_pr211052_7() { runTest("declare atType problems - 7"); }
+       
+       
        public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_1() { runTest("NPE with missing @aspect annotation in pointcut library - 1"); }
        public void testNPEWithMissingAtAspectAnnotationInPointcutLibrary_pr162539_2() { runTest("NPE with missing @aspect annotation in pointcut library - 2"); }
         
index 2b333d0b641a9fd8b876a8988ca6ff715930fdc0..691f5ce8dfcb0ee7e448125596beb36a570643b2 100644 (file)
@@ -2,6 +2,86 @@
 
 <!-- AspectJ v1.6.0 Tests -->
 <suite>
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 1">
+     <compile options="-1.5" files="MyPojo.java"/>
+     <run class="MyPojo"/>
+   </ajc-test>
+   
+   <!--  DistantResource is explicitly mentioned as c.d.DistantResource -->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 2">
+     <compile options="-1.5 -showWeaveInfo" files="SimpleAnnotation.java,SimpleAspect1.java,DistantResource.java">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java:5) is annotated with @SimpleAnnotation(classname = &quot;oranges&quot;)"/>
+     </compile>
+     <run class="c.d.DistantResource">
+     <stdout>
+       <line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+
+   <!--  DistantResource is imported and refered to as DistantResource -->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 3">
+     <compile options="-1.5 -showWeaveInfo" files="SimpleAnnotation.java,SimpleAspect2.java,DistantResource.java">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java:5) is annotated with @SimpleAnnotation(classname = &quot;oranges&quot;)"/>
+     </compile>
+      <run class="c.d.DistantResource">
+     <stdout>       
+       <line text="Annotation is @a.b.SimpleAnnotation(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+   
+   <!--  Annotation is in a different package to the aspect and explicitly referenced with a fully qualified name -->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 4">
+     <compile options="-1.5 -showWeaveInfo" files="SimpleAnnotation2.java,SimpleAspect3.java,DistantResource.java">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java:5) is annotated with @e.f.SimpleAnnotation2(classname = &quot;oranges&quot;)"/>
+     </compile>     
+     <run class="c.d.DistantResource">
+     <stdout>
+       <line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+
+   <!--  Annotation is in a different package to the aspect and imported -->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 5">
+     <compile options="-1.5 -showWeaveInfo" files="SimpleAnnotation2.java,SimpleAspect4.java,DistantResource.java">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java:5) is annotated with @SimpleAnnotation2(classname = &quot;oranges&quot;)"/>
+     </compile>
+     <run class="c.d.DistantResource">
+     <stdout>
+       <line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+   
+   <!-- target for annotation is from a jar -->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 6">
+     <compile options="-1.5" files="DistantResource.java" outjar="target.jar"/>
+     <compile options="-1.5 -showWeaveInfo" files="SimpleAnnotation2.java,SimpleAspect4.java" inpath="target.jar">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java) is annotated with @SimpleAnnotation2(classname = &quot;oranges&quot;)"/>
+     </compile>
+     <run class="c.d.DistantResource">
+     <stdout>
+       <line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+
+   <!-- target for annotation is from a jar and annotation and aspect are in a different jar-->
+   <ajc-test dir="bugs154/pr211052" title="declare atType problems - 7">
+     <compile options="-1.5" files="DistantResource.java" outjar="target.jar"/>
+     <compile options="-1.5 -Xlint:ignore" files="SimpleAnnotation2.java,SimpleAspect3.java" outjar="aspect.jar"/>
+     <compile options="-1.5 -showWeaveInfo" aspectpath="aspect.jar" inpath="target.jar">
+       <message kind="weave" text="'c.d.DistantResource' (DistantResource.java) is annotated with @e.f.SimpleAnnotation2(classname = &quot;oranges&quot;)"/>
+     </compile>
+     <run class="c.d.DistantResource">
+     <stdout>
+       <line text="Annotation is @e.f.SimpleAnnotation2(classname=oranges)"/>
+     </stdout>
+     </run>
+   </ajc-test>
+   
    <ajc-test dir="bugs154/pr211674" title="after throwing annotation style problem - 1">
      <compile options="-1.5" files="Test.java"/>
      <run class="Test"/>