]> source.dussan.org Git - aspectj.git/commitdiff
test cases for pr138215, 219, and 223.
authoracolyer <acolyer>
Mon, 24 Apr 2006 17:46:06 +0000 (17:46 +0000)
committeracolyer <acolyer>
Mon, 24 Apr 2006 17:46:06 +0000 (17:46 +0000)
tests/bugs152/pr138215/pr138215.aj [new file with mode: 0644]
tests/bugs152/pr138219/PerThisWithReference.aj [new file with mode: 0644]
tests/bugs152/pr138219/SomeOtherType.aj [new file with mode: 0644]
tests/bugs152/pr138220/AtAspectWithPerClause.aj [new file with mode: 0644]
tests/bugs152/pr138223/DoubleAnnotationMatching.aj [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc152/Ajc152Tests.java
tests/src/org/aspectj/systemtest/ajc152/ajc152.xml

diff --git a/tests/bugs152/pr138215/pr138215.aj b/tests/bugs152/pr138215/pr138215.aj
new file mode 100644 (file)
index 0000000..7580b14
--- /dev/null
@@ -0,0 +1,19 @@
+package abc;
+import org.aspectj.lang.annotation.*;
+
+@Aspect
+public class pr138215 {
+
+  @DeclareWarning("fooExecution()")
+  public static final String warning = "no foos please";
+
+  @Pointcut("execution(* foo())")
+  public void fooExecution() {}
+
+}
+
+class Fooey {
+
+  public void foo() {}
+
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr138219/PerThisWithReference.aj b/tests/bugs152/pr138219/PerThisWithReference.aj
new file mode 100644 (file)
index 0000000..c53466d
--- /dev/null
@@ -0,0 +1,7 @@
+public aspect PerThisWithReference perthis(mypc()) {
+
+
+  pointcut mypc() : SomeOtherType.pc();
+
+
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr138219/SomeOtherType.aj b/tests/bugs152/pr138219/SomeOtherType.aj
new file mode 100644 (file)
index 0000000..51f0f3e
--- /dev/null
@@ -0,0 +1,5 @@
+public aspect SomeOtherType {
+
+  public pointcut pc() : execution(* *(..));
+
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr138220/AtAspectWithPerClause.aj b/tests/bugs152/pr138220/AtAspectWithPerClause.aj
new file mode 100644 (file)
index 0000000..7296443
--- /dev/null
@@ -0,0 +1,17 @@
+import org.aspectj.lang.annotation.*;
+
+@Aspect("perthis(pc())")
+public class AtAspectWithPerClause {
+
+ @Pointcut("execution(* *(..))")
+ public void pc() {}
+
+}
+
+@Aspect
+class Foo {
+
+ @Pointcut("execution(* *(..))")
+ public void pc() {}
+
+}
\ No newline at end of file
diff --git a/tests/bugs152/pr138223/DoubleAnnotationMatching.aj b/tests/bugs152/pr138223/DoubleAnnotationMatching.aj
new file mode 100644 (file)
index 0000000..4153094
--- /dev/null
@@ -0,0 +1,33 @@
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface Tx {
+  boolean readOnly() default false;
+}
+
+public aspect DoubleAnnotationMatching {
+
+
+ pointcut methodInTxType(Tx tx) : 
+   execution(* *(..)) && @this(tx) && if(tx.readOnly());
+   
+ pointcut txMethod(Tx tx) :
+   execution(* *(..)) && @annotation(tx) && if(tx.readOnly());
+   
+ pointcut transactionalOperation() :
+   methodInTxType(Tx) || txMethod(Tx);
+   
+ before() : transactionalOperation() {
+   // do something
+ }
+
+}
+
+@Tx class Foo {
+
+  public void foo() {}
+  
+  @Tx public void bar() {}
+
+
+}
\ No newline at end of file
index de76cc76f29193da01095cfd0f5fcc9d795ed1f7..87a912be1aeb30723950d9eebd7c38d820b69b0e 100644 (file)
@@ -31,7 +31,15 @@ public class Ajc152Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
   public void testStackOverflow_pr136258() { runTest("stack overflow");}
   public void testIncorrectOverridesEvaluation13() { runTest("incorrect overrides evaluation - 1.3"); }
   public void testIncorrectOverridesEvaluation15() { runTest("incorrect overrides evaluation - 1.5"); }
+
+  // known failures, uncomment when working.
+//  public void testReferencePCutInDeclareWarning_pr138215() { runTest("Reference pointcut fails inside @DeclareWarning");}
+//  public void testReferencePCutInPerClause_pr138219() { runTest("Can't use a FQ Reference pointcut in any pointcut expression referenced by a per-clause");}
+//  public void testDoubleAnnotationMatching_pr138223() { runTest("Double at annotation matching (no binding)");}
   
+// this next one reported as a bug by Rob Harrop, but I can't reproduce the failure yet...
+//public void testAtAspectWithReferencePCPerClause_pr138220() { runTest("@Aspect with reference pointcut in perclause");}  
+
   /////////////////////////////////////////
   public static Test suite() {
     return XMLBasedAjcTestCase.loadSuite(Ajc152Tests.class);
index 7fb993960079dfc470b5ec4c18298e90f4b5f3ab..cc57b956293c87111dbe180ee8953a733cc6b50e 100644 (file)
       </compile>
     </ajc-test>
     
+    <ajc-test dir="bugs152/pr138215" pr="138215" title="Reference pointcut fails inside @DeclareWarning">
+      <compile files="pr138215.aj" options="-1.5">
+        <message kind="warning" line="17" text="no foos please"/>
+      </compile>
+    </ajc-test>
+    
+    <ajc-test dir="bugs152/pr138219" pr="138219" title="Can't use a FQ Reference pointcut in any pointcut expression referenced by a per-clause">
+      <compile files="PerThisWithReference.aj,SomeOtherType.aj" options="-1.5">
+      </compile>
+    </ajc-test>
+    
+    <ajc-test dir="bugs152/pr138220" pr="138220" title="@Aspect with reference pointcut in perclause">
+      <compile files="AtAspectWithPerClause.aj" options="-1.5">
+      </compile>
+    </ajc-test>
+
+    <ajc-test dir="bugs152/pr138223" pr="138223" title="Double at annotation matching (no binding)">
+      <compile files="DoubleAnnotationMatching.aj" options="-1.5">
+      </compile>
+    </ajc-test>
+
 </suite>
\ No newline at end of file