aboutsummaryrefslogtreecommitdiffstats
path: root/tests/new/packagevisibility/PackagesAndAdviceCf.java
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2002-12-20 22:48:48 +0000
committerjhugunin <jhugunin>2002-12-20 22:48:48 +0000
commit9081949c3aca2636eab2598b57ddbda16563dcee (patch)
treebdc2b7562510d4ada368d9ec266a7a32ed6f16cf /tests/new/packagevisibility/PackagesAndAdviceCf.java
parentc86ae3fc8bc798521dfa3449bebf749c446509ff (diff)
downloadaspectj-9081949c3aca2636eab2598b57ddbda16563dcee.tar.gz
aspectj-9081949c3aca2636eab2598b57ddbda16563dcee.zip
expanded coverage
Diffstat (limited to 'tests/new/packagevisibility/PackagesAndAdviceCf.java')
-rw-r--r--tests/new/packagevisibility/PackagesAndAdviceCf.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/new/packagevisibility/PackagesAndAdviceCf.java b/tests/new/packagevisibility/PackagesAndAdviceCf.java
new file mode 100644
index 000000000..1abfea48e
--- /dev/null
+++ b/tests/new/packagevisibility/PackagesAndAdviceCf.java
@@ -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";
+}