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

index 8c66d13bb5eeedc895319eb51475ea8d1d4bf3a5..77825d91abc6c42abdecc1e825b38857584663d0 100644 (file)
         <run class="SubtypeConstructorCW"/>
     </ajc-test>
 
-
-
+    <ajc-test dir="bugs/interAbstract" 
+               pr="49784"
+               title="aspect declares interface method (abstract decl, default impl)">
+        <compile files="InterfaceMethodDeclarationNonPublic.java" />
+        <run class="InterfaceMethodDeclarationNonPublic"/>
+    </ajc-test>
 
 </suite>
diff --git a/tests/bugs/interAbstract/InterfaceMethodDeclarationNonPublic.java b/tests/bugs/interAbstract/InterfaceMethodDeclarationNonPublic.java
new file mode 100644 (file)
index 0000000..9a5de41
--- /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 decl, default impl)
+ */
+public class InterfaceMethodDeclarationNonPublic {
+
+    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 {
+    int getInt() { return 1; }
+}