]> source.dussan.org Git - aspectj.git/commitdiff
250493: testcase
authoraclement <aclement>
Tue, 14 Oct 2008 19:02:55 +0000 (19:02 +0000)
committeraclement <aclement>
Tue, 14 Oct 2008 19:02:55 +0000 (19:02 +0000)
tests/bugs163/pr250493/Bridged.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/AllTests16.java
tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc163/AllTestsAspectJ163.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/ajc163/ajc163.xml [new file with mode: 0644]

diff --git a/tests/bugs163/pr250493/Bridged.java b/tests/bugs163/pr250493/Bridged.java
new file mode 100644 (file)
index 0000000..2e3e349
--- /dev/null
@@ -0,0 +1,33 @@
+import java.lang.reflect.Method;
+import java.util.*;
+
+interface Super<T> {
+       public T getterA();
+}
+
+public class Bridged implements Super<String> {
+       public String getterA() {
+               return "";
+       }
+
+       // Print BRIDGE status of all getter* methods
+       public static void main(String[] argv) {
+               Method[] ms = Bridged.class.getMethods();
+               List results = new ArrayList(); 
+               for (int i = 0; i < ms.length; i++) {
+                       if (ms[i].getName().startsWith("getter")) {
+                               results.add(ms[i].getName()+"()"+ms[i].getReturnType().getName()+ "  isBridged?"+((ms[i].getModifiers() & 0x0040) != 0));
+                       }
+               }
+               Collections.sort(results);
+               for (Iterator iterator = results.iterator(); iterator.hasNext();) {
+                       String entry = (String) iterator.next();
+                       System.out.println(entry);
+               }
+       }
+}
+
+aspect X {
+  public T Super<T>.getterB() { return null; }
+}
+
index 8414657fb9fd2fb415dd9e3c25fffb2bc5fe7a80..659180a522eba8714a75081b7ebe42b573d97319 100644 (file)
@@ -9,17 +9,19 @@ import junit.framework.TestSuite;
 import org.aspectj.systemtest.ajc160.AllTestsAspectJ160;
 import org.aspectj.systemtest.ajc161.AllTestsAspectJ161;
 import org.aspectj.systemtest.ajc162.AllTestsAspectJ162;
+import org.aspectj.systemtest.ajc163.AllTestsAspectJ163;
 
 public class AllTests16 {
 
        public static Test suite() {
                TestSuite suite = new TestSuite("AspectJ System Test Suite - JDK 1.6");
-               //$JUnit-BEGIN$
+               // $JUnit-BEGIN$
                suite.addTest(AllTestsAspectJ160.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
-        suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
-        suite.addTest(AllTestsAspectJ162.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+               suite.addTest(AllTestsAspectJ161.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+               suite.addTest(AllTestsAspectJ162.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
+               suite.addTest(AllTestsAspectJ163.suite()); // dont require a 1.6 JRE to run but checks 1.6 compiler behaviour
                suite.addTest(AllTests15.suite());
-               //$JUnit-END$
+               // $JUnit-END$
                return suite;
        }
 }
diff --git a/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java
new file mode 100644 (file)
index 0000000..6ab60a6
--- /dev/null
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors 
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc163;
+
+import java.io.File;
+
+import junit.framework.Test;
+
+import org.aspectj.testing.XMLBasedAjcTestCase;
+
+public class Ajc163Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+
+       public void testGenericMethodBridging_pr250493() {
+               runTest("bridge methods for generic itds");
+       }
+
+       public static Test suite() {
+               return XMLBasedAjcTestCase.loadSuite(Ajc163Tests.class);
+       }
+
+       protected File getSpecFile() {
+               return new File("../tests/src/org/aspectj/systemtest/ajc163/ajc163.xml");
+       }
+
+}
\ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc163/AllTestsAspectJ163.java b/tests/src/org/aspectj/systemtest/ajc163/AllTestsAspectJ163.java
new file mode 100644 (file)
index 0000000..f0fbbea
--- /dev/null
@@ -0,0 +1,25 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Contributors
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Andy Clement - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.systemtest.ajc163;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTestsAspectJ163 {
+
+       public static Test suite() {
+               TestSuite suite = new TestSuite("AspectJ 1.6.3 tests");
+               // $JUnit-BEGIN$
+               suite.addTest(Ajc163Tests.suite());
+               // $JUnit-END$
+               return suite;
+       }
+}
diff --git a/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml b/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml
new file mode 100644 (file)
index 0000000..7967ac1
--- /dev/null
@@ -0,0 +1,17 @@
+<!DOCTYPE suite SYSTEM "../tests/ajcTestSuite.dtd"[]>
+
+<suite>
+
+    <ajc-test dir="bugs163/pr250493" title="bridge methods for generic itds">
+      <compile files="Bridged.java" options="-1.5"/>
+      <run class="Bridged">
+        <stdout>
+          <line text="getterA()java.lang.Object  isBridged?true"/>
+          <line text="getterA()java.lang.String  isBridged?false"/>
+          <line text="getterB()java.lang.Object  isBridged?true"/>
+          <line text="getterB()java.lang.String  isBridged?false"/>
+        </stdout>
+      </run>
+    </ajc-test>
+
+</suite>
\ No newline at end of file