Lines 10-17
Link Here
|
10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
11 |
package org.eclipse.jdt.core.tests.model; |
11 |
package org.eclipse.jdt.core.tests.model; |
12 |
|
12 |
|
13 |
import java.lang.reflect.Method; |
|
|
14 |
|
15 |
import org.eclipse.jdt.core.*; |
13 |
import org.eclipse.jdt.core.*; |
16 |
import org.eclipse.jdt.core.ICompilationUnit; |
14 |
import org.eclipse.jdt.core.ICompilationUnit; |
17 |
|
15 |
|
Lines 20-42
Link Here
|
20 |
public class ResolveTests_1_5 extends AbstractJavaModelTests { |
18 |
public class ResolveTests_1_5 extends AbstractJavaModelTests { |
21 |
ICompilationUnit wc = null; |
19 |
ICompilationUnit wc = null; |
22 |
WorkingCopyOwner owner = null; |
20 |
WorkingCopyOwner owner = null; |
|
|
21 |
|
22 |
static { |
23 |
// Names of tests to run: can be "testBugXXXX" or "BugXXXX") |
24 |
//TESTS_NAMES = new String[] { "test0095" }; |
25 |
// Numbers of tests to run: "test<number>" will be run for each number of this array |
26 |
//TESTS_NUMBERS = new int[] { 13 }; |
27 |
// Range numbers of tests to run: all tests between "test<first>" and "test<last>" will be run for { first, last } |
28 |
//TESTS_RANGE = new int[] { 16, -1 }; |
29 |
} |
23 |
public static Test suite() { |
30 |
public static Test suite() { |
24 |
TestSuite suite = new Suite(ResolveTests_1_5.class.getName()); |
31 |
return buildTestSuite(ResolveTests_1_5.class); |
25 |
|
|
|
26 |
if (true) { |
27 |
Class c = ResolveTests_1_5.class; |
28 |
Method[] methods = c.getMethods(); |
29 |
for (int i = 0, max = methods.length; i < max; i++) { |
30 |
if (methods[i].getName().startsWith("test")) { //$NON-NLS-1$ |
31 |
suite.addTest(new ResolveTests_1_5(methods[i].getName())); |
32 |
} |
33 |
} |
34 |
return suite; |
35 |
} |
36 |
suite.addTest(new ResolveTests_1_5("test0093")); |
37 |
return suite; |
38 |
} |
32 |
} |
39 |
|
|
|
40 |
public ResolveTests_1_5(String name) { |
33 |
public ResolveTests_1_5(String name) { |
41 |
super(name); |
34 |
super(name); |
42 |
} |
35 |
} |
Lines 2095-2098
Link Here
|
2095 |
true/*show key*/ |
2088 |
true/*show key*/ |
2096 |
); |
2089 |
); |
2097 |
} |
2090 |
} |
|
|
2091 |
/* |
2092 |
* Regression test for bug 87929 Wrong decoding of type signature with wildcards |
2093 |
*/ |
2094 |
public void test0095() throws JavaModelException { |
2095 |
IJavaElement[] elements = select( |
2096 |
"/Resolve/src2/test0095/X.java", |
2097 |
"package test0095;\n" + |
2098 |
"public class X {\n" + |
2099 |
" Y<?, ? extends Z<? super Exception>> y;\n" + |
2100 |
"}\n" + |
2101 |
"class Y<K, V> {\n" + |
2102 |
"}\n" + |
2103 |
"class Z<T> {\n" + |
2104 |
"}", |
2105 |
"Y<?, ? extends Z<? super Exception>>"); |
2106 |
|
2107 |
assertElementsEqual( |
2108 |
"Unexpected elements", |
2109 |
"Y {key=Ltest0095/X~Y<Ltest0095/X~Y;*Ltest0095/X~Y;+Ltest0095/X~Z<Ltest0095/X~Z;-Ljava/lang/Exception;>;>;} [in [Working copy] X.java [in test0095 [in src2 [in Resolve]]]]", |
2110 |
elements, |
2111 |
true/*show key*/ |
2112 |
); |
2113 |
|
2114 |
String key = ((IType) elements[0]).getKey(); |
2115 |
String signature = new BindingKey(key).internalToSignature(); |
2116 |
String[] typeArguments = Signature.getTypeArguments(signature); |
2117 |
assertStringsEqual( |
2118 |
"Unexpected type arguments", |
2119 |
"*\n" + |
2120 |
"+Ltest0095.Z<-Ljava.lang.Exception;>;\n", |
2121 |
typeArguments); |
2122 |
} |
2098 |
} |
2123 |
} |