aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authoraclement <aclement>2006-09-25 13:51:40 +0000
committeraclement <aclement>2006-09-25 13:51:40 +0000
commite56a69a32149724c51daf0b52958607e5cc46eb4 (patch)
treeb83682664bfcfdb66f8f5853331a0d93de3bdb06 /tests
parentf3f24b02f5b1e75d8fc7e590b6a64c8be707d4eb (diff)
downloadaspectj-e56a69a32149724c51daf0b52958607e5cc46eb4.tar.gz
aspectj-e56a69a32149724c51daf0b52958607e5cc46eb4.zip
test and fix for 158412: annotation style reference pointcuts don't work
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs153/pr158412/dao/Foo.java4
-rw-r--r--tests/bugs153/pr158412/layering/Layering.aj8
-rw-r--r--tests/bugs153/pr158412/layering/SystemArchitektur.java14
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java2
-rw-r--r--tests/src/org/aspectj/systemtest/ajc153/ajc153.xml10
5 files changed, 38 insertions, 0 deletions
diff --git a/tests/bugs153/pr158412/dao/Foo.java b/tests/bugs153/pr158412/dao/Foo.java
new file mode 100644
index 000000000..376414c31
--- /dev/null
+++ b/tests/bugs153/pr158412/dao/Foo.java
@@ -0,0 +1,4 @@
+package dao;
+
+public class Foo {
+}
diff --git a/tests/bugs153/pr158412/layering/Layering.aj b/tests/bugs153/pr158412/layering/Layering.aj
new file mode 100644
index 000000000..c78561ee0
--- /dev/null
+++ b/tests/bugs153/pr158412/layering/Layering.aj
@@ -0,0 +1,8 @@
+package layering;
+
+//import architektur.SystemArchitektur;
+
+public aspect Layering {
+ declare warning : (layering.SystemArchitektur.inDAOLayer() ) : "Whatever";
+
+}
diff --git a/tests/bugs153/pr158412/layering/SystemArchitektur.java b/tests/bugs153/pr158412/layering/SystemArchitektur.java
new file mode 100644
index 000000000..735b0ced9
--- /dev/null
+++ b/tests/bugs153/pr158412/layering/SystemArchitektur.java
@@ -0,0 +1,14 @@
+package layering;
+
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+
+
+@Aspect
+public class SystemArchitektur {
+ @Pointcut("within(dao.*)")
+ public void inDAOLayer() {}
+
+}
+
+
diff --git a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
index 0c4e59e8d..3fdae3771 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc153/Ajc153Tests.java
@@ -28,6 +28,8 @@ public class Ajc153Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// public void testCFlowXMLAspectLTW_pr149096() { runTest("cflow xml concrete aspect"); }
// public void testAmbiguousBinding_pr121805() { runTest("ambiguous binding");}
// public void testNoIllegalStateExceptionWithGenericInnerAspect_pr156058() { runTest("no IllegalStateException with generic inner aspect"); }
+ public void testAnnotationStylePointcutNPE_pr158412() { runTest("annotation style pointcut npe"); }
+ public void testAnnotationStylePointcutNPE_pr158412_2() { runTest("annotation style pointcut npe - 2"); }
public void testAnnotationsCallConstructors_pr158126() { runTest("annotations, call and constructors problem");}
public void testIllegalStateExceptionGenerics_pr153845() { runTest("IllegalStateException at GenericSignatureParser.java"); }
public void testNoIllegalStateExceptionFromAsmDelegate_pr153490_1() { runTest("no illegal state exception from AsmDelegate - 1");}
diff --git a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
index 451bf3a80..455f181b1 100644
--- a/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
+++ b/tests/src/org/aspectj/systemtest/ajc153/ajc153.xml
@@ -8,6 +8,16 @@
<compile files="Nothing.java" aspectpath="blob.jar" options="-1.5" outjar="bang.jar"/>
</ajc-test>
+ <ajc-test dir="bugs153/pr158412" title="annotation style pointcut npe">
+ <compile files="layering/Layering.aj,layering/SystemArchitektur.java" options="-1.5"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs153/pr158412" title="annotation style pointcut npe - 2">
+ <compile files="layering/Layering.aj,layering/SystemArchitektur.java,dao/Foo.java" options="-1.5">
+ <message kind="warning" line="3" text="Whatever"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs153/pr158126" title="annotations, call and constructors problem">
<compile files="A.java,B.java,MyAnnotation.java,MyAspect.java" options="-1.5 -showWeaveInfo">
<message kind="weave" text="Join point 'constructor-call(void B.&lt;init&gt;())' in Type 'A' (A.java:5) advised by before advice from 'MyAspect' (MyAspect.java:3)"/>