]> source.dussan.org Git - aspectj.git/commitdiff
expanded coverage
authorjhugunin <jhugunin>
Fri, 20 Dec 2002 22:48:48 +0000 (22:48 +0000)
committerjhugunin <jhugunin>
Fri, 20 Dec 2002 22:48:48 +0000 (22:48 +0000)
tests/new/options11/aspectlib1.jar
tests/new/options11/aspectlib2.jar
tests/new/options11/injar.jar
tests/new/packagevisibility/PackagesAndAdvice.java
tests/new/packagevisibility/PackagesAndAdviceCf.java [new file with mode: 0644]
tests/new/subaspects/child/ChildCE.java
tests/new/subaspects/parent/ParentCE.java

index 053a7671d343d892f6d8c5f4a410a4546cfcd02c..bbad5245245770edef73d530abcd608207720c7d 100644 (file)
Binary files a/tests/new/options11/aspectlib1.jar and b/tests/new/options11/aspectlib1.jar differ
index 603218b93c85000328759785c77bc77a569c0b21..50de832746563410818aeba7bc6e443592539dc4 100644 (file)
Binary files a/tests/new/options11/aspectlib2.jar and b/tests/new/options11/aspectlib2.jar differ
index 6fd5aba49106d788266494e12256e13f83895307..c37fed0149aa7023480a1126dd18224bc8fa2ef9 100644 (file)
Binary files a/tests/new/options11/injar.jar and b/tests/new/options11/injar.jar differ
index ca17f0da7c088183fb31b06943da40b407ef9874..199df0cbe0d492df9fdb37ca066dbaf2d6b8e181 100644 (file)
@@ -24,9 +24,7 @@ aspect A {
     static String message = "-advised";
 
     String around(String s):
-        call(String doIt(String)) && args(s) &&
-           (target(packagevisibility.testPackage.Class1) ||
-                  target(packagevisibility.testPackage.Class2)) {
+        call(String doIt(String)) && args(s) {
         String result = s + message;
        result += A1.message;
        return result + proceed(s);
diff --git a/tests/new/packagevisibility/PackagesAndAdviceCf.java b/tests/new/packagevisibility/PackagesAndAdviceCf.java
new file mode 100644 (file)
index 0000000..1abfea4
--- /dev/null
@@ -0,0 +1,39 @@
+package packagevisibility;
+import org.aspectj.testing.Tester;
+
+import packagevisibility.testPackage.*;
+
+public class PackagesAndAdviceCf
+{
+    public static void main(String[] args) { test(); }
+
+    public static void test() {
+        packagevisibility.testPackage.Class1 c1 =
+            new packagevisibility.testPackage.Class1();
+        Tester.checkEqual(c1.doIt("-1"),
+                          "-1-advised-advised1-1-class1",
+                          "publically visible");
+        Tester.checkEqual(c1.doItToClass2("-2"),
+                          "-2-advised-advised1-2-class2",
+                          "package visible");
+    }
+
+}
+
+aspect A {
+    static String message = "-advised";
+
+    String around(String s):
+        call(String doIt(String)) && args(s) &&
+           (target(packagevisibility.testPackage.Class1) ||
+                  target(packagevisibility.testPackage.Class2)) {  // Cf type not visible
+        String result = s + message;
+       result += A1.message;
+       return result + proceed(s);
+    }
+
+}
+
+class A1 {
+    static String message = "-advised1";
+}
index 4a0b8377c56b3ecc2c8e0735849b23743c2eaee1..ac0f3694e4940df778ba1e3b68956a5bb9cb789b 100644 (file)
@@ -6,7 +6,7 @@ import parent.ParentCE;
 
 import org.aspectj.testing.*;
 
-public class ChildCE {
+public class ChildCE implements I {
     public static void main (String[] args) {
         new Target().run();   
         Tester.checkAllEvents();
@@ -17,6 +17,10 @@ public class ChildCE {
     }
 }
 
+interface I {
+       public pointcut fromInterface(): call(* *(..));
+}
+
 class Target { 
     public void run(){
         Tester.event("run");
@@ -24,7 +28,7 @@ class Target {
 }
 
 /** @testcase PR#647 concrete aspect unable to access abstract package-private pointcut in parent for overriding */
-aspect ParentChild extends ParentCE {// expect CE here: child does not define "define()" b/c inaccessible
+aspect ParentChild extends ParentCE implements I {// expect CE here: child does not define "define()" b/c inaccessible
     protected pointcut define()  
         : call(public void Target.run());
 }
index b64a7b66e2223fe680b9cbcbdddaab8f88cb98e0..9c55f5716e7c62d537b984eb5df401ab2ac57c87 100644 (file)
@@ -6,10 +6,18 @@ import org.aspectj.testing.*;
 /** @testcase PR#647 concrete aspect unable to access abstract package-private pointcut in parent for overriding */
 public abstract aspect ParentCE {
     abstract pointcut define();
+    
+    public abstract pointcut fromInterface();
+    
+    pointcut withSig(int i): args(i);
+    
     before() : define() {
         Tester.event("define");
     }
 }
 aspect Child extends ParentCE {
     pointcut define() : call(public void Runnable.run());
+    public pointcut fromInterface(): call(* *(..));
+    
+    pointcut withSig(): args();    // should be CE incompatible params
 }