]> source.dussan.org Git - aspectj.git/commitdiff
test for 149293: declare atType for private annotation
authoraclement <aclement>
Tue, 17 Oct 2006 08:08:12 +0000 (08:08 +0000)
committeraclement <aclement>
Tue, 17 Oct 2006 08:08:12 +0000 (08:08 +0000)
tests/multiIncremental/PR149293_1/base/src/mypackage/MyAbstractClass.java [new file with mode: 0644]
tests/multiIncremental/PR149293_1/base/src/mypackage/MyAspect.java [new file with mode: 0644]
tests/multiIncremental/PR149293_1/base/src/mypackage/MyBaseClass.java [new file with mode: 0644]
tests/multiIncremental/PR149293_1/base/src/mypackage/MyInterface.java [new file with mode: 0644]
tests/multiIncremental/PR149293_1/inc1/src/mypackage/MySubclass.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

diff --git a/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAbstractClass.java b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAbstractClass.java
new file mode 100644 (file)
index 0000000..8f7fed6
--- /dev/null
@@ -0,0 +1,19 @@
+package mypackage;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+public abstract class MyAbstractClass implements MyInterface {
+
+       @Retention(RetentionPolicy.RUNTIME)
+       private @interface MyAspectPresent {
+       }
+
+       public MyAbstractClass() {
+               if (!getClass().isAnnotationPresent(MyAspectPresent.class)) {
+                       throw new RuntimeException("MyAspect has not been woven into "
+                                       + getClass());
+               }
+       }
+
+}
diff --git a/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAspect.java b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAspect.java
new file mode 100644 (file)
index 0000000..a133ebe
--- /dev/null
@@ -0,0 +1,7 @@
+package mypackage;
+
+privileged public aspect MyAspect {
+
+       declare @type : MyInterface+ : @MyBaseClass.MyAspectPresent;
+
+}
diff --git a/tests/multiIncremental/PR149293_1/base/src/mypackage/MyBaseClass.java b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyBaseClass.java
new file mode 100644 (file)
index 0000000..6a903b0
--- /dev/null
@@ -0,0 +1,5 @@
+package mypackage;
+
+public abstract class MyBaseClass extends MyAbstractClass {
+
+}
diff --git a/tests/multiIncremental/PR149293_1/base/src/mypackage/MyInterface.java b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyInterface.java
new file mode 100644 (file)
index 0000000..bf3b5e9
--- /dev/null
@@ -0,0 +1,5 @@
+package mypackage;
+
+public interface MyInterface {
+
+}
diff --git a/tests/multiIncremental/PR149293_1/inc1/src/mypackage/MySubclass.java b/tests/multiIncremental/PR149293_1/inc1/src/mypackage/MySubclass.java
new file mode 100644 (file)
index 0000000..b42d943
--- /dev/null
@@ -0,0 +1,7 @@
+package mypackage;
+
+import mypackage.MyBaseClass;
+
+public class MySubclass extends MyBaseClass {
+
+}
index ed4e048d2d4531d7cbd569b6067b06f6ae11f922..75dfd99db06960594976f60664def3835027fa52 100644 (file)
@@ -249,6 +249,17 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                checkWasntFullBuild();
        }
        
+//     public void testDeclareAtType_pr149293() {
+//             configureBuildStructureModel(true);
+//             initialiseProject("PR149293_1");
+//             build("PR149293_1");
+//             checkCompileWeaveCount(4,5);
+//             assertNoErrors();
+//             alter("PR149293_1","inc1");
+//             build("PR149293_1");
+//             assertNoErrors();
+//     }
+       
 /*
        public void testRefactoring_pr148285() {
                configureBuildStructureModel(true);
@@ -1766,5 +1777,9 @@ public class MultiProjectIncrementalTests extends AbstractMultiProjectIncrementa
                File projDir = new File(getWorkingDir(),p);
                return new File(projDir,"bin"+File.separator+filename);
        }
+
+       private void assertNoErrors() {
+               assertTrue("Should be no errors, but got "+MyTaskListManager.getErrorMessages(),MyTaskListManager.getErrorMessages().size()==0);                                
+       }
        
 }
\ No newline at end of file