diff options
author | Andy Clement <andrew.clement@gmail.com> | 2012-08-17 14:31:53 -0700 |
---|---|---|
committer | Andy Clement <andrew.clement@gmail.com> | 2012-08-17 14:31:53 -0700 |
commit | d0c81b74d7c2254cea2b8820a1cabda158978e83 (patch) | |
tree | 72a7116e3266c8949543d2657e28466b15305b08 /tests | |
parent | 993cef1c34849b5a3c92f5ddf4839ccf9047da77 (diff) | |
download | aspectj-d0c81b74d7c2254cea2b8820a1cabda158978e83.tar.gz aspectj-d0c81b74d7c2254cea2b8820a1cabda158978e83.zip |
73507 - it'd fields on interfaces no longer get mangled names by default
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs171/pr73507/Case1.java (renamed from tests/bugs170/pr73507/Case1.java) | 40 | ||||
-rw-r--r-- | tests/bugs171/pr73507/Case2.java (renamed from tests/bugs170/pr73507/Case2.java) | 38 | ||||
-rw-r--r-- | tests/bugs171/pr73507/Case3.java (renamed from tests/bugs170/pr73507/Case3.java) | 58 | ||||
-rw-r--r-- | tests/bugs171/pr73507/Case4.java (renamed from tests/bugs170/pr73507/Case4.java) | 36 | ||||
-rw-r--r-- | tests/bugs171/pr73507/Case5.java | 21 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/AllTests17.java | 2 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc10x/Ajc10xTests.java | 4 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc150/ajc150.xml | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java | 18 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc170/ajc170.xml | 34 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java | 20 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc171/ajc171.xml | 46 |
13 files changed, 196 insertions, 141 deletions
diff --git a/tests/bugs170/pr73507/Case1.java b/tests/bugs171/pr73507/Case1.java index 74a645851..246653631 100644 --- a/tests/bugs170/pr73507/Case1.java +++ b/tests/bugs171/pr73507/Case1.java @@ -1,20 +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"); - } - -} +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/bugs171/pr73507/Case2.java index 15ba1665f..1068b938a 100644 --- a/tests/bugs170/pr73507/Case2.java +++ b/tests/bugs171/pr73507/Case2.java @@ -1,19 +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); - } - -} +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/bugs171/pr73507/Case3.java index 588d97dc2..3cfc979b5 100644 --- a/tests/bugs170/pr73507/Case3.java +++ b/tests/bugs171/pr73507/Case3.java @@ -1,27 +1,31 @@ -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); - } - -} +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 int I.k = 1;
+ public int C.k = 5;
+
+ 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 C.k is "+new C().k);
+ 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/bugs171/pr73507/Case4.java index 08912fbc1..8c6d28baf 100644 --- a/tests/bugs170/pr73507/Case4.java +++ b/tests/bugs171/pr73507/Case4.java @@ -1,18 +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) { - } - -} +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/bugs171/pr73507/Case5.java b/tests/bugs171/pr73507/Case5.java new file mode 100644 index 000000000..fa474d68d --- /dev/null +++ b/tests/bugs171/pr73507/Case5.java @@ -0,0 +1,21 @@ +import java.lang.reflect.*;
+
+interface I {
+}
+
+
+class C implements I {
+}
+
+public aspect Case5 {
+
+ public String I.str = "hello";
+
+ public static void main(String []argv) {
+ Field[] fs = C.class.getDeclaredFields();
+ for (Field f: fs) {
+ System.out.println(f);
+ }
+ }
+
+}
diff --git a/tests/src/org/aspectj/systemtest/AllTests17.java b/tests/src/org/aspectj/systemtest/AllTests17.java index 37a02c350..447ab1d51 100644 --- a/tests/src/org/aspectj/systemtest/AllTests17.java +++ b/tests/src/org/aspectj/systemtest/AllTests17.java @@ -12,7 +12,7 @@ import org.aspectj.systemtest.ajc171.AllTestsAspectJ171; public class AllTests17 { public static Test suite() { - TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.7"); + TestSuite suite = new TestSuite("AspectJ System Test Suite - 1.7"); // $JUnit-BEGIN$ suite.addTest(AllTestsAspectJ171.suite()); suite.addTest(AllTestsAspectJ170.suite()); diff --git a/tests/src/org/aspectj/systemtest/ajc10x/Ajc10xTests.java b/tests/src/org/aspectj/systemtest/ajc10x/Ajc10xTests.java index b9c913471..8128fcdaa 100644 --- a/tests/src/org/aspectj/systemtest/ajc10x/Ajc10xTests.java +++ b/tests/src/org/aspectj/systemtest/ajc10x/Ajc10xTests.java @@ -676,6 +676,10 @@ public class Ajc10xTests extends org.aspectj.testing.XMLBasedAjcTestCase { runTest("interfaces as mixins with introduction"); } + public void test161b() { + runTest("interfaces as mixins with introduction b"); + } + public void test162() { runTest("functional modifiers work correctly with introduced members"); } diff --git a/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml b/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml index 3d7d93a28..e93b9b150 100644 --- a/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml +++ b/tests/src/org/aspectj/systemtest/ajc10x/ajc10x-tests.xml @@ -1083,7 +1083,15 @@ <ajc-test dir="design/intro" title="interfaces as mixins with introduction" keywords="from-resolved_10x"> - <compile files="Interfaces.java"/> + <compile files="Interfaces.java"> + <message kind="error" text="can't override java.lang.String SubI.instanceField with java.lang.String SubC.instanceField visibility is reduced"/> + <message kind="error" text="can't override java.lang.String I.instanceField with java.lang.String C.instanceField visibility is reduced"/> + </compile> + </ajc-test> + + <ajc-test dir="design/intro" title="interfaces as mixins with introduction b" + keywords="from-resolved_10x"> + <compile files="Interfaces.java" options="-Xset:itdVersion=1"/> <run class="Interfaces"/> </ajc-test> diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml index 0abbbbea8..1ee0ee752 100644 --- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml +++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml @@ -84,7 +84,7 @@ <run class="Declaration1"> <stdout> <line text="public java.lang.String Test.firstProperty has annotation:true"/> - <line text="public java.lang.String Test.ajc$interField$Declaration1$TestInterface$secondProperty has annotation:true"/> + <line text="public java.lang.String Test.secondProperty has annotation:true"/> </stdout> </run> </ajc-test> @@ -117,7 +117,7 @@ <run class="Declaration2"> <stdout> <line text="public java.lang.String Test.firstProperty has annotation:true"/> - <line text="public java.lang.String Test.ajc$interField$Declaration2$TestInterface$secondProperty has annotation:true"/> + <line text="public java.lang.String Test.secondProperty has annotation:true"/> </stdout> </run> </ajc-test> @@ -4636,7 +4636,11 @@ <run class="GenericAspectZ"/> </ajc-test> - + <ajc-test dir="java5/generics/binaryBridging" title="binary bridge methods - two"> + <compile files="TwoA.java" outjar="twoa.jar" options="-1.5"/> + <compile files="TwoB.java" outjar="twob.jar" options="-1.5"/> + <compile files="TwoX.java" inpath="twoa.jar;twob.jar" options="-1.5"/> + </ajc-test> <ajc-test dir="java5/generics/itds/sharing" title="method itd sharing type variable with generic type"> <compile files="Simple.aj" options="-1.5"/> diff --git a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java index c9b1a7377..1f1017328 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc170/Ajc170Tests.java @@ -156,24 +156,6 @@ public class Ajc170Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // more complex example, mix of them assertEquals("((call(* java.lang.String.*(..)) && this(java.lang.Object)) && call(* *(..)))",newp.toString()); } - -/* - 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 1413eae39..28ea31dad 100644 --- a/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml +++ b/tests/src/org/aspectj/systemtest/ajc170/ajc170.xml @@ -242,40 +242,6 @@ </stdout> </run> </ajc-test> - - <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"> diff --git a/tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java b/tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java index 17c8ea4f5..a8dc9a678 100644 --- a/tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc171/Ajc171Tests.java @@ -21,6 +21,26 @@ import org.aspectj.testing.XMLBasedAjcTestCase; */ public class Ajc171Tests 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 testPublicITDFs_pr73507_5() { + runTest("public ITDfs - 5"); + } + public void testGenerics_384398() { runTest("generics itds"); } diff --git a/tests/src/org/aspectj/systemtest/ajc171/ajc171.xml b/tests/src/org/aspectj/systemtest/ajc171/ajc171.xml index d22d2d71a..d24aa9a3a 100644 --- a/tests/src/org/aspectj/systemtest/ajc171/ajc171.xml +++ b/tests/src/org/aspectj/systemtest/ajc171/ajc171.xml @@ -1,6 +1,52 @@ <!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]> <suite> + + <ajc-test dir="bugs171/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="bugs171/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="bugs171/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"/> + <line text="Value of C.k is 5"/> + <line text="Value of I.i is 1"/> + <line text="Value of I.j is 1"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs171/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="bugs171/pr73507" title="public ITDfs - 5"> + <compile files="Case5.java" options="-1.5"/> + <run class="Case5"> + <stdout> + <line text="public java.lang.String C.str"/> + </stdout> + </run> + </ajc-test> <ajc-test dir="bugs171/pr384398" title="generics itds"> <compile files="A.java B.java BAspect.aj" options="-1.5"> |