]> source.dussan.org Git - aspectj.git/commitdiff
better coverage
authorjhugunin <jhugunin>
Mon, 30 Dec 2002 20:31:30 +0000 (20:31 +0000)
committerjhugunin <jhugunin>
Mon, 30 Dec 2002 20:31:30 +0000 (20:31 +0000)
tests/new/DominatesTypePatternCE.java [new file with mode: 0644]

diff --git a/tests/new/DominatesTypePatternCE.java b/tests/new/DominatesTypePatternCE.java
new file mode 100644 (file)
index 0000000..a978739
--- /dev/null
@@ -0,0 +1,21 @@
+import org.aspectj.testing.Tester;
+
+/** @testcase subtype pattern in dominates should pick out aspect subtypes */
+public class DominatesTypePatternCE {
+    public static void main (String[] args) {
+        String s = new C().method();
+        Tester.check("pass".equals(s),
+                     "\"pass\".equals(\"" + s + "\")");
+    } 
+}
+
+class C {}
+
+// works if A is specified explicitly
+abstract aspect AA { declare dominates: AA, AA+; // CE, AA is matched by both pieces
+    public String C.method() { return "pass"; }
+}
+
+aspect A extends AA { 
+    public String C.method() { return "fail"; }
+}