aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-10-17 08:08:12 +0000
committeraclement <aclement>2006-10-17 08:08:12 +0000
commitbc2f36fdbf0e0a8d59e9613b69a3b4639b1dd668 (patch)
tree298e41b8a6261d71bfd44aa5af79ab2c94527148 /tests
parente07c624587bfcb44a6840a0d943f5a24e7ab872f (diff)
downloadaspectj-bc2f36fdbf0e0a8d59e9613b69a3b4639b1dd668.tar.gz
aspectj-bc2f36fdbf0e0a8d59e9613b69a3b4639b1dd668.zip
test for 149293: declare atType for private annotation
Diffstat (limited to 'tests')
-rw-r--r--tests/multiIncremental/PR149293_1/base/src/mypackage/MyAbstractClass.java19
-rw-r--r--tests/multiIncremental/PR149293_1/base/src/mypackage/MyAspect.java7
-rw-r--r--tests/multiIncremental/PR149293_1/base/src/mypackage/MyBaseClass.java5
-rw-r--r--tests/multiIncremental/PR149293_1/base/src/mypackage/MyInterface.java5
-rw-r--r--tests/multiIncremental/PR149293_1/inc1/src/mypackage/MySubclass.java7
-rw-r--r--tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java15
6 files changed, 58 insertions, 0 deletions
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
index 000000000..8f7fed612
--- /dev/null
+++ b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAbstractClass.java
@@ -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
index 000000000..a133ebe91
--- /dev/null
+++ b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyAspect.java
@@ -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
index 000000000..6a903b0bf
--- /dev/null
+++ b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyBaseClass.java
@@ -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
index 000000000..bf3b5e927
--- /dev/null
+++ b/tests/multiIncremental/PR149293_1/base/src/mypackage/MyInterface.java
@@ -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
index 000000000..b42d94398
--- /dev/null
+++ b/tests/multiIncremental/PR149293_1/inc1/src/mypackage/MySubclass.java
@@ -0,0 +1,7 @@
+package mypackage;
+
+import mypackage.MyBaseClass;
+
+public class MySubclass extends MyBaseClass {
+
+}
diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
index ed4e048d2..75dfd99db 100644
--- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
+++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java
@@ -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