diff options
author | aclement <aclement> | 2008-10-14 19:02:55 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-10-14 19:02:55 +0000 |
commit | b454292b74a07a5b5316183209ddac2343ae3e8e (patch) | |
tree | 845ee9c23fea31bf21cd6d9717e8a3315c2818f5 /tests | |
parent | 410753eaa6ed20c3e0120fc1d161bf8f6c724a3b (diff) | |
download | aspectj-b454292b74a07a5b5316183209ddac2343ae3e8e.tar.gz aspectj-b454292b74a07a5b5316183209ddac2343ae3e8e.zip |
250493: testcase
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bugs163/pr250493/Bridged.java | 33 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/AllTests16.java | 10 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java | 33 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc163/AllTestsAspectJ163.java | 25 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc163/ajc163.xml | 17 |
5 files changed, 114 insertions, 4 deletions
diff --git a/tests/bugs163/pr250493/Bridged.java b/tests/bugs163/pr250493/Bridged.java new file mode 100644 index 000000000..2e3e349e4 --- /dev/null +++ b/tests/bugs163/pr250493/Bridged.java @@ -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; } +} + diff --git a/tests/src/org/aspectj/systemtest/AllTests16.java b/tests/src/org/aspectj/systemtest/AllTests16.java index 8414657fb..659180a52 100644 --- a/tests/src/org/aspectj/systemtest/AllTests16.java +++ b/tests/src/org/aspectj/systemtest/AllTests16.java @@ -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 index 000000000..6ab60a65e --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc163/Ajc163Tests.java @@ -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 index 000000000..f0fbbeaf6 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc163/AllTestsAspectJ163.java @@ -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 index 000000000..7967ac163 --- /dev/null +++ b/tests/src/org/aspectj/systemtest/ajc163/ajc163.xml @@ -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 |