From: aclement Date: Tue, 26 Feb 2008 16:31:38 +0000 (+0000) Subject: testcode for 211146 and hasMethod semantics - commented out right now X-Git-Tag: V1_6_0M2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=493af53138c71affba0c75c53ecefd192df68fed;p=aspectj.git testcode for 211146 and hasMethod semantics - commented out right now --- diff --git a/tests/bugs160/pr211146/DemoUsage.java b/tests/bugs160/pr211146/DemoUsage.java new file mode 100755 index 000000000..200ece6eb --- /dev/null +++ b/tests/bugs160/pr211146/DemoUsage.java @@ -0,0 +1,9 @@ +public class DemoUsage { + public static void main(String[] args) { + StringClass sc = new StringClass(); + sc.getStrings().add("AspectJ"); + for(String s : sc.getStrings()) { + System.out.println(s); + } + } +} \ No newline at end of file diff --git a/tests/bugs160/pr211146/StringAspect.aj b/tests/bugs160/pr211146/StringAspect.aj new file mode 100755 index 000000000..85b959d32 --- /dev/null +++ b/tests/bugs160/pr211146/StringAspect.aj @@ -0,0 +1,7 @@ +import java.util.*; + +public aspect StringAspect { + public Collection StringClass.getStrings() { + return new ArrayList(); + } +} diff --git a/tests/bugs160/pr211146/StringClass.java b/tests/bugs160/pr211146/StringClass.java new file mode 100755 index 000000000..8a4e6d327 --- /dev/null +++ b/tests/bugs160/pr211146/StringClass.java @@ -0,0 +1 @@ +public class StringClass {} \ No newline at end of file diff --git a/tests/bugs160/various/HasMethodSemantics.java b/tests/bugs160/various/HasMethodSemantics.java new file mode 100644 index 000000000..df553a6c6 --- /dev/null +++ b/tests/bugs160/various/HasMethodSemantics.java @@ -0,0 +1,12 @@ + +public class HasMethodSemantics { + public static void main(String []argv) { + System.out.println("Implements Marker? "+(new HasMethodSemantics() instanceof Marker?"yes":"no")); + } +} + +interface Marker {} + +aspect X { + declare parents: HasMethodSemantics && hasmethod(String toString(..)) implements Marker; +} \ No newline at end of file diff --git a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java index 34c236973..a5df41ab5 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java @@ -20,6 +20,7 @@ import junit.framework.Test; */ public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase { +// public void testHasMethodSemantics() { runTest("hasmethod semantics"); } public void testBoundsCheckShouldFail_pr219298() { runTest("bounds check failure");} public void testBoundsCheckShouldFail_pr219298_2() { runTest("bounds check failure - 2");} public void testGenericMethodMatching_pr204505_1() { runTest("generics method matching - 1");} @@ -33,8 +34,10 @@ public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase { public void testDecpRepetition_pr214559_3() { runTest("decp repetition problem - 3");} // across multiple files public void testISEAnnotations_pr209831() { runTest("illegal state exception with annotations");} public void testISEAnnotations_pr209831_2() { runTest("illegal state exception with annotations - 2");} - - ///////////////////////////////////////// +// public void testITDLostGenerics_pr211146() { runTest("itd lost generic signature");} +// public void testITDLostGenerics_pr211146_2() { runTest("itd lost generic signature - field");} + + ///////////////////////////////////////// public static Test suite() { return XMLBasedAjcTestCase.loadSuite(Ajc160Tests.class); } diff --git a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml index 8747270e3..09da1df88 100644 --- a/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml +++ b/tests/src/org/aspectj/systemtest/ajc160/ajc160.xml @@ -3,6 +3,15 @@ + + + + + + + + + @@ -73,4 +82,9 @@ + + + + + \ No newline at end of file