diff options
author | wisberg <wisberg> | 2004-01-16 01:44:17 +0000 |
---|---|---|
committer | wisberg <wisberg> | 2004-01-16 01:44:17 +0000 |
commit | 2be86afae3780ca87a41bb7e65f3ce1afe9999df (patch) | |
tree | c3ec69a02f1e65d9dad28e6824dbf83f64d4f239 /tests | |
parent | 81adb9fef97b229a18e7eb6fa28140df00409b01 (diff) | |
download | aspectj-2be86afae3780ca87a41bb7e65f3ce1afe9999df.tar.gz aspectj-2be86afae3780ca87a41bb7e65f3ce1afe9999df.zip |
@testcase PR#49784 aspect declares interface method (abstract decl, default impl)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ajcTestsFailing.xml | 8 | ||||
-rw-r--r-- | tests/bugs/interAbstract/InterfaceMethodDeclarationNonPublic.java | 42 |
2 files changed, 48 insertions, 2 deletions
diff --git a/tests/ajcTestsFailing.xml b/tests/ajcTestsFailing.xml index 8c66d13bb..77825d91a 100644 --- a/tests/ajcTestsFailing.xml +++ b/tests/ajcTestsFailing.xml @@ -137,7 +137,11 @@ <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 index 000000000..9a5de4161 --- /dev/null +++ b/tests/bugs/interAbstract/InterfaceMethodDeclarationNonPublic.java @@ -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; } +} |