diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs193/isAbstractType/Code.java | 24 | ||||
-rw-r--r-- | tests/bugs193/isAbstractType/Code2.java | 24 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc193/ajc193.xml | 19 |
4 files changed, 75 insertions, 0 deletions
diff --git a/tests/bugs193/isAbstractType/Code.java b/tests/bugs193/isAbstractType/Code.java new file mode 100644 index 000000000..03790c6d8 --- /dev/null +++ b/tests/bugs193/isAbstractType/Code.java @@ -0,0 +1,24 @@ +public class Code { + public static void main(String[] argv) { + new Code().run(); + } + + public void run() { + new Code3().run(); + } +} + +abstract class Code2 { + public void run() { + } +} + +class Code3 extends Code2 { +} + +aspect X { + before(): execution(* (!is(AbstractType)).run(..)) { + System.out.println(thisJoinPointStaticPart); + } +} + diff --git a/tests/bugs193/isAbstractType/Code2.java b/tests/bugs193/isAbstractType/Code2.java new file mode 100644 index 000000000..65d8d0d05 --- /dev/null +++ b/tests/bugs193/isAbstractType/Code2.java @@ -0,0 +1,24 @@ +public class Code2 { + public static void main(String[] argv) { + new Code2().run(); + } + + public void run() { + new Helper2().run(); + } +} + +abstract class Helper { + public void run() { + } +} + +class Helper2 extends Helper { +} + +aspect X { + before(): execution(* (is(AbstractType)).run(..)) { + System.out.println(thisJoinPointStaticPart); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java b/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java index c813de6f3..c3849c4f0 100644 --- a/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc193/Ajc193Tests.java @@ -22,6 +22,14 @@ import junit.framework.Test; */ public class Ajc193Tests extends XMLBasedAjcTestCaseForJava10OrLater { + public void testIsAbstractType() { + runTest("is abstract"); + } + + public void testIsAbstractType2() { + runTest("is abstract - 2"); + } + // --- public static Test suite() { diff --git a/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml b/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml index b214fe51f..3f876abad 100644 --- a/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml +++ b/tests/src/org/aspectj/systemtest/ajc193/ajc193.xml @@ -2,6 +2,25 @@ <suite> + + <ajc-test dir="bugs193/isAbstractType" title="is abstract"> + <compile files="Code.java" options="-1.8"/> + <run class="Code"> + <stdout> + <line text="execution(void Code.run())"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs193/isAbstractType" title="is abstract - 2"> + <compile files="Code2.java" options="-1.8"/> + <run class="Code2"> + <stdout> + <line text="execution(void Helper.run())"/> + </stdout> + </run> + </ajc-test> + <!-- <ajc-test dir="bugs191/var" title="var 3"> <compile files="Code3.java" options="-10"> |