diff options
author | Andy Clement <aclement@vmware.com> | 2012-03-15 10:03:03 -0700 |
---|---|---|
committer | Andy Clement <aclement@vmware.com> | 2012-03-15 10:03:03 -0700 |
commit | 42035aea54234894721cca2858035002c7bfa9c7 (patch) | |
tree | 9a1eabed72dd2146f1d9cb41e2085ea0d3315c4c /tests | |
parent | 2a944dbb2cd25a31c93d3e945f0cf07b406a3090 (diff) | |
download | aspectj-42035aea54234894721cca2858035002c7bfa9c7.tar.gz aspectj-42035aea54234894721cca2858035002c7bfa9c7.zip |
pr73507 - wip
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs170/pr73507/Case1.java | 20 | ||||
-rw-r--r-- | tests/bugs170/pr73507/Case2.java | 19 | ||||
-rw-r--r-- | tests/bugs170/pr73507/Case3.java | 27 | ||||
-rw-r--r-- | tests/bugs170/pr73507/Case4.java | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java | 17 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/ajc170.xml | 35 |
6 files changed, 136 insertions, 0 deletions
diff --git a/tests/bugs170/pr73507/Case1.java b/tests/bugs170/pr73507/Case1.java new file mode 100644 index 000000000..74a645851 --- /dev/null +++ b/tests/bugs170/pr73507/Case1.java @@ -0,0 +1,20 @@ +import java.lang.reflect.*; + +interface I { +} + + +class C implements I { +} + +public aspect Case1 { + + public int I.i; + + public static void main(String []argv) throws Exception { + Field f = C.class.getField("i"); + if (f==null) System.out.println("Couldn't find a field called i"); + else System.out.println("Found a field called i"); + } + +} diff --git a/tests/bugs170/pr73507/Case2.java b/tests/bugs170/pr73507/Case2.java new file mode 100644 index 000000000..15ba1665f --- /dev/null +++ b/tests/bugs170/pr73507/Case2.java @@ -0,0 +1,19 @@ +import java.lang.reflect.*; + +interface I { +} + + +class C implements I { + public int i = 1; +} + +public aspect Case2 { + + public int I.i = 5; + + public static void main(String []argv) { + System.out.println("Value of C.i is "+new C().i); + } + +} diff --git a/tests/bugs170/pr73507/Case3.java b/tests/bugs170/pr73507/Case3.java new file mode 100644 index 000000000..588d97dc2 --- /dev/null +++ b/tests/bugs170/pr73507/Case3.java @@ -0,0 +1,27 @@ +import java.lang.reflect.*; + +interface I { +} + + +class C implements I { +} + +public aspect Case3 { + + // one order + public int C.i = 1; + public int I.i = 5; + + // the other order ;) + public int I.j = 5; + public int C.j = 1; + + public static void main(String []argv) { + System.out.println("Value of C.i is "+new C().i); + System.out.println("Value of C.j is "+new C().j); + System.out.println("Value of I.i is "+((I)new C()).i); + System.out.println("Value of I.j is "+((I)new C()).j); + } + +} diff --git a/tests/bugs170/pr73507/Case4.java b/tests/bugs170/pr73507/Case4.java new file mode 100644 index 000000000..08912fbc1 --- /dev/null +++ b/tests/bugs170/pr73507/Case4.java @@ -0,0 +1,18 @@ +import java.lang.reflect.*; + +interface I { +} + + +class C implements I { + public int i = 1; +} + +public aspect Case4 { + + public String I.i = "hello"; + + public static void main(String []argv) { + } + +} diff --git a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java index bfb995d12..ebdf20c3e 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java @@ -25,6 +25,23 @@ import org.aspectj.weaver.UnresolvedType; */ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase { + + public void testPublicITDFs_pr73507_1() { + runTest("public ITDfs - 1"); + } + + public void testPublicITDFs_pr73507_2() { + runTest("public ITDfs - 2"); + } + + public void testPublicITDFs_pr73507_3() { + runTest("public ITDfs - 3"); + } + + public void testPublicITDFs_pr73507_4() { + runTest("public ITDfs - 4"); + } + public void testBCExceptionAnnoDecp_371998() { runTest("BCException anno decp"); } diff --git a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml index b5ce9623c..58c936905 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml @@ -2,6 +2,41 @@ <suite> + + <ajc-test dir="bugs170/pr73507" title="public ITDfs - 1"> + <compile files="Case1.java" options="-1.5"/> + <run class="Case1"> + <stdout> + <line text="Found a field called i"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/pr73507" title="public ITDfs - 2"> + <compile files="Case2.java" options="-1.5"/> + <run class="Case2"> + <stdout> + <line text="Value of C.i is 1"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/pr73507" title="public ITDfs - 3"> + <compile files="Case3.java" options="-1.5"/> + <run class="Case3"> + <stdout> + <line text="Value of C.i is 1"/> + <line text="Value of C.j is 1"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs170/pr73507" title="public ITDfs - 4"> + <compile files="Case4.java" options="-1.5"> + <message kind="error" line="13" text="can't override java.lang.String I.i with int C.i return types don't match"/> + </compile> + </ajc-test> + <ajc-test dir="bugs170/pr371998" title="BCException anno decp"> <compile files="AspectTest.java" options="-1.5 -showWeaveInfo"> <message kind="weave" text="Extending interface set for type 'Foo' (AspectTest.java) to include 'X' (AspectTest.java)"/> |