]> source.dussan.org Git - aspectj.git/commitdiff
tests for pr153572
authoracolyer <acolyer>
Fri, 18 Aug 2006 15:23:33 +0000 (15:23 +0000)
committeracolyer <acolyer>
Fri, 18 Aug 2006 15:23:33 +0000 (15:23 +0000)
tests/bugs153/pr153572/Annotated.java [new file with mode: 0644]
tests/bugs153/pr153572/AnnotationMatcher.aj [new file with mode: 0644]
tests/bugs153/pr153572/Configurable.java [new file with mode: 0644]
tests/bugs153/pr153572/Main.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
tests/src/org/aspectj/systemtest/ajc153/ajc153.xml

diff --git a/tests/bugs153/pr153572/Annotated.java b/tests/bugs153/pr153572/Annotated.java
new file mode 100644 (file)
index 0000000..10a872b
--- /dev/null
@@ -0,0 +1,4 @@
+@Configurable
+public class Annotated {
+       
+}
\ No newline at end of file
diff --git a/tests/bugs153/pr153572/AnnotationMatcher.aj b/tests/bugs153/pr153572/AnnotationMatcher.aj
new file mode 100644 (file)
index 0000000..f7a7f4d
--- /dev/null
@@ -0,0 +1,8 @@
+public aspect AnnotationMatcher {
+       
+       after() returning : initialization(*.new(..)) && @this(Configurable) {
+               System.out.println("annotated type initialized");
+       }
+       
+       
+}
\ No newline at end of file
diff --git a/tests/bugs153/pr153572/Configurable.java b/tests/bugs153/pr153572/Configurable.java
new file mode 100644 (file)
index 0000000..be90143
--- /dev/null
@@ -0,0 +1,6 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Configurable {
+       
+}
\ No newline at end of file
diff --git a/tests/bugs153/pr153572/Main.java b/tests/bugs153/pr153572/Main.java
new file mode 100644 (file)
index 0000000..e0dc601
--- /dev/null
@@ -0,0 +1,7 @@
+public class Main {
+       
+       public static void main(String[] args) {
+               new Annotated();
+       }
+       
+}
\ No newline at end of file
index e2d6256f202b32f25b58e1726db4806a0954fc05..b211e5cf3acf298ede57647fd9d0ecff3238d7eb 100644 (file)
@@ -62,7 +62,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   }
   public void testMatchVolatileField_pr150671() {runTest("match volatile field");};
   public void testDuplicateJVMTIAgents_pr151938() {runTest("Duplicate JVMTI agents");};
-
+  public void testLTWWorldWithAnnotationMatching_pr153572() { runTest("LTWWorld with annotation matching");}
+  
   /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc153Tests.class);
index 1951d4b3ece02447b7130c67471b53c736fc5c7e..06cc9c3713cd90faad9d4ba40bbcad6285f71756 100644 (file)
       <compile files="EMA.java" options="-1.5"/>
     </ajc-test>
     
+    <ajc-test dir="bugs153/pr153572" title="LTWWorld with annotation matching">
+       <compile 
+               files="Configurable.java, AnnotationMatcher.aj" 
+               options="-1.5"
+               outjar="aspectlib.jar"
+               outxmlfile="META-INF/aop.xml"/>
+       <compile files="Configurable.java,Annotated.java,Main.java" options="-1.5" outjar="myapp.jar"/>
+       <run class="Main" ltw="">
+               <stdout>
+                       <line text="annotated type initialized"/>
+               </stdout>
+       </run>
+    </ajc-test>
+    
 </suite>
\ No newline at end of file