]> source.dussan.org Git - aspectj.git/commitdiff
@testcase PR#49784 aspect declares interface method
authorwisberg <wisberg>
Fri, 9 Jan 2004 19:17:01 +0000 (19:17 +0000)
committerwisberg <wisberg>
Fri, 9 Jan 2004 19:17:01 +0000 (19:17 +0000)
tests/ajcTestsFailing.xml
tests/bugs/interAbstract/InterfaceMethodDeclarationAbstract.java [new file with mode: 0644]
tests/bugs/interAbstract/InterfaceMethodDeclarationFull.java [new file with mode: 0644]
tests/bugs/interAbstract/InterfaceMethodDeclarationNone.java [new file with mode: 0644]

index db19ce8574ad5883e139f4399aad941f4cda855d..1e87072b4eeb4f5d641aa7040ed61e78f95806bb 100644 (file)
         <run class="SubtypeConstructorCW"/>
     </ajc-test>
 
+    <ajc-test dir="bugs/interAbstract" 
+               pr="49784"
+               title="aspect declares interface method (no modifiers)">
+        <compile files="InterfaceMethodDeclarationNone.java" />
+        <run class="InterfaceMethodDeclarationNone"/>
+    </ajc-test>
+
+    <ajc-test dir="bugs/interAbstract" 
+               pr="49784"
+               title="aspect declares interface method (abstract)">
+        <compile files="InterfaceMethodDeclarationAbstract.java" />
+        <run class="InterfaceMethodDeclarationAbstract"/>
+    </ajc-test>
+
+    <ajc-test dir="bugs/interAbstract" 
+               pr="49784"
+               comment="working in 1.1.1 - keep with others?"
+               title="aspect declares interface method (public abstract)">
+        <compile files="InterfaceMethodDeclarationFull.java" />
+        <run class="InterfaceMethodDeclarationFull"/>
+    </ajc-test>
+
 
 </suite>
diff --git a/tests/bugs/interAbstract/InterfaceMethodDeclarationAbstract.java b/tests/bugs/interAbstract/InterfaceMethodDeclarationAbstract.java
new file mode 100644 (file)
index 0000000..7eb4aba
--- /dev/null
@@ -0,0 +1,42 @@
+/* *******************************************************************
+ * Copyright (c) 2004 Contributors.
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     Wes Isberg     initial implementation 
+ * ******************************************************************/
+
+import org.aspectj.testing.Tester;
+
+/**
+ * @testcase PR#49784 aspect declares interface method (abstract)
+ */
+public class InterfaceMethodDeclarationAbstract {
+
+    public static void main(String[] args) {
+        Tester.expectEvent("before-execution");
+        Tester.expectEvent("before-call");
+        I i = new C();
+        Tester.check(1 == i.getInt(), "1 == i.getInt()");
+        Tester.checkAllEvents();
+    }
+}
+
+interface I {}
+
+aspect A {
+    abstract int I.getInt();  // implicitly public 
+    before() : execution(int getInt()) && target(I) {
+        Tester.event("before-execution");
+    }
+    before() : call(int getInt()) && target(I) {
+        Tester.event("before-call");
+    }
+}
+class C implements I {
+    public int getInt() { return 1; }
+}
diff --git a/tests/bugs/interAbstract/InterfaceMethodDeclarationFull.java b/tests/bugs/interAbstract/InterfaceMethodDeclarationFull.java
new file mode 100644 (file)
index 0000000..f823b6e
--- /dev/null
@@ -0,0 +1,42 @@
+/* *******************************************************************
+ * Copyright (c) 2004 Contributors.
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     Wes Isberg     initial implementation 
+ * ******************************************************************/
+
+import org.aspectj.testing.Tester;
+
+/**
+ * @testcase PR#49784 aspect declares interface method (public abstract)
+ */
+public class InterfaceMethodDeclarationFull {
+
+    public static void main(String[] args) {
+        Tester.expectEvent("before-execution");
+        Tester.expectEvent("before-call");
+        I i = new C();
+        Tester.check(1 == i.getInt(), "1 == i.getInt()");
+        Tester.checkAllEvents();
+    }
+}
+
+interface I {}
+
+aspect A {
+    abstract public int I.getInt();  
+    before() : execution(int getInt()) && target(I) {
+        Tester.event("before-execution");
+    }
+    before() : call(int getInt()) && target(I) {
+        Tester.event("before-call");
+    }
+}
+class C implements I {
+    public int getInt() { return 1; }
+}
diff --git a/tests/bugs/interAbstract/InterfaceMethodDeclarationNone.java b/tests/bugs/interAbstract/InterfaceMethodDeclarationNone.java
new file mode 100644 (file)
index 0000000..dfef034
--- /dev/null
@@ -0,0 +1,42 @@
+/* *******************************************************************
+ * Copyright (c) 2004 Contributors.
+ * All rights reserved. 
+ * This program and the accompanying materials are made available 
+ * under the terms of the Common Public License v1.0 
+ * which accompanies this distribution and is available at 
+ * http://www.eclipse.org/legal/cpl-v10.html 
+ *  
+ * Contributors: 
+ *     Wes Isberg     initial implementation 
+ * ******************************************************************/
+
+import org.aspectj.testing.Tester;
+
+/**
+ * @testcase PR#49784 aspect declares interface method (no modifiers)
+ */
+public class InterfaceMethodDeclarationNone {
+
+    public static void main(String[] args) {
+        Tester.expectEvent("before-execution");
+        Tester.expectEvent("before-call");
+        I i = new C();
+        Tester.check(1 == i.getInt(), "1 == i.getInt()");
+        Tester.checkAllEvents();
+    }
+}
+
+interface I {}
+
+aspect A {
+    int I.getInt();  // implicitly public abstract
+    before() : execution(int getInt()) && target(I) {
+        Tester.event("before-execution");
+    }
+    before() : call(int getInt()) && target(I) {
+        Tester.event("before-call");
+    }
+}
+class C implements I {
+    public int getInt() { return 1; }
+}