diff options
Diffstat (limited to 'org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java | 194 |
1 files changed, 97 insertions, 97 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java index 1312ab885..d881f64a4 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ResolveTests2.java @@ -206,7 +206,7 @@ public void testBug232880a() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -217,7 +217,7 @@ public void testBug232880a() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test2;\n" + //$NON-NLS-1$ @@ -225,7 +225,7 @@ public void testBug232880a() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/IJavaElement.java", //$NON-NLS-1$ @@ -242,12 +242,12 @@ public void testBug232880a() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar1, externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); @@ -255,7 +255,7 @@ public void testBug232880a() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -276,7 +276,7 @@ public void testBug232880b() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -287,7 +287,7 @@ public void testBug232880b() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test2;\n" + //$NON-NLS-1$ @@ -295,7 +295,7 @@ public void testBug232880b() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/IJavaElement.java", //$NON-NLS-1$ @@ -312,12 +312,12 @@ public void testBug232880b() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); @@ -325,7 +325,7 @@ public void testBug232880b() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -346,7 +346,7 @@ public void testBug232880c() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -357,7 +357,7 @@ public void testBug232880c() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test2;\n" + //$NON-NLS-1$ @@ -365,7 +365,7 @@ public void testBug232880c() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/IJavaElement.java", //$NON-NLS-1$ @@ -382,15 +382,15 @@ public void testBug232880c() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -402,7 +402,7 @@ public void testBug232880c() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -425,13 +425,13 @@ public void testBug232880d() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 String source1 = "package test1;\n" + //$NON-NLS-1$ "public class IResource {\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test1/IResource.java", //$NON-NLS-1$ @@ -439,7 +439,7 @@ public void testBug232880d() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test2;\n" + //$NON-NLS-1$ @@ -447,7 +447,7 @@ public void testBug232880d() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/IJavaElement.java", //$NON-NLS-1$ @@ -464,15 +464,15 @@ public void testBug232880d() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -489,7 +489,7 @@ public void testBug232880d() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -512,18 +512,18 @@ public void testBug232880e() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 String source1_1 = "package test1;\n" + //$NON-NLS-1$ "public class CoreException extends Exception {\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + String source1_2 = "package test1;\n" + //$NON-NLS-1$ "public class IResource {\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test1/CoreException.java", //$NON-NLS-1$ @@ -533,14 +533,14 @@ public void testBug232880e() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2_1 = "package test2;\n" + //$NON-NLS-1$ "import test1.CoreException;\n" + //$NON-NLS-1$ "public class JavaModelException extends CoreException {\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + String source2_2 = "package test2;\n" + //$NON-NLS-1$ "import test1.IResource;\n" + //$NON-NLS-1$ @@ -548,7 +548,7 @@ public void testBug232880e() throws Exception { " void foo1() throws JavaModelException {}\n" + //$NON-NLS-1$ " IResource foo2() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/JavaModelException.java", //$NON-NLS-1$ @@ -567,15 +567,15 @@ public void testBug232880e() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2_2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -592,7 +592,7 @@ public void testBug232880e() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -615,7 +615,7 @@ public void testBug232880f() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -630,7 +630,7 @@ public void testBug232880f() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test3;\n" + //$NON-NLS-1$ @@ -638,7 +638,7 @@ public void testBug232880f() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test3/IJavaElement.java", //$NON-NLS-1$ @@ -655,15 +655,15 @@ public void testBug232880f() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test3"); this.createFile( "/PS1/attachment/test3/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -675,7 +675,7 @@ public void testBug232880f() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -698,7 +698,7 @@ public void testBug232880g() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -713,7 +713,7 @@ public void testBug232880g() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test3;\n" + //$NON-NLS-1$ @@ -721,7 +721,7 @@ public void testBug232880g() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test3/IJavaElement.java", //$NON-NLS-1$ @@ -738,15 +738,15 @@ public void testBug232880g() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test3"); this.createFile( "/PS1/attachment/test3/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -758,7 +758,7 @@ public void testBug232880g() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -780,7 +780,7 @@ public void testBug232880h() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -795,7 +795,7 @@ public void testBug232880h() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test3;\n" + //$NON-NLS-1$ @@ -804,7 +804,7 @@ public void testBug232880h() throws Exception { "public class IJavaElement {\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test3/IJavaElement.java", //$NON-NLS-1$ @@ -821,15 +821,15 @@ public void testBug232880h() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test3"); this.createFile( "/PS1/attachment/test3/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -841,7 +841,7 @@ public void testBug232880h() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( @@ -863,7 +863,7 @@ public void testBug232880i() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -878,14 +878,14 @@ public void testBug232880i() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test3;\n" + //$NON-NLS-1$ "public class IJavaElement {\n" + //$NON-NLS-1$ " test2.IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test3/IJavaElement.java", //$NON-NLS-1$ @@ -902,15 +902,15 @@ public void testBug232880i() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test3"); this.createFile( "/PS1/attachment/test3/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -922,12 +922,12 @@ public void testBug232880i() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test3", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "IResource foo", "IResource"); assertElementsEqual( "Unexpected elements", - "IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]\n" + + "IResource [in IResource.class [in test1 [in "+outputDirectory+File.separator+"bug232880a.jar]]]\n" + "IResource [in IResource.class [in test2 [in "+outputDirectory+File.separator+"bug232880a.jar]]]", elements, false, @@ -948,7 +948,7 @@ public void testBug232880j() throws Exception { String externalJar1 = outputDirectory + File.separator + "bug232880a.jar"; //$NON-NLS-1$ String externalJar2 = outputDirectory + File.separator + "bug232880b.jar"; //$NON-NLS-1$ try { - + // create external jar 1 Util.createJar( new String[] { @@ -959,7 +959,7 @@ public void testBug232880j() throws Exception { }, new HashMap(), externalJar1); - + // create external jar 2 String source2 = "package test2;\n" + //$NON-NLS-1$ @@ -968,7 +968,7 @@ public void testBug232880j() throws Exception { " // iresource\n" + //$NON-NLS-1$ " IResource foo() {return null;}\n" + //$NON-NLS-1$ "}"; //$NON-NLS-1$ - + Util.createJar( new String[] { "test2/IJavaElement.java", //$NON-NLS-1$ @@ -985,15 +985,15 @@ public void testBug232880j() throws Exception { new String[]{"src"}, new String[]{"JCL_LIB", externalJar2}, "bin"); - + this.createFolder("/PS1/attachment/test2"); this.createFile( "/PS1/attachment/test2/IJavaElement.java", source2); - + IPackageFragmentRoot root = project1.getPackageFragmentRoot(externalJar2); attachSource(root, "/PS1/attachment/", ""); - + // create P2 this.createJavaProject( "PS2", @@ -1005,7 +1005,7 @@ public void testBug232880j() throws Exception { // do code select IClassFile cf = getClassFile("PS1", externalJar2, "test2", "IJavaElement.class"); - + IJavaElement[] elements = codeSelect(cf, "iresource", "iresource"); assertElementsEqual( @@ -1038,7 +1038,7 @@ public void testBug249027a() throws Exception { "package p1;\n"+ "public class C1 {\n" + "}"); - + this.createFolder("/P1/src/p1/C1"); this.createFile( "/P1/src/p1/C1/C2.java", @@ -1084,7 +1084,7 @@ public void testBug249027b() throws Exception { "package p1;\n"+ "public class C1 {\n" + "}"); - + this.createFolder("/P1/src/p2"); this.createFile( "/P1/src/p2/C2.java", @@ -1135,7 +1135,7 @@ public void testBug343693() throws Exception{ " new X<>(\"hello\");\n"+ "}\n"+ "}"); - + waitUntilIndexesReady(); // do code select @@ -1169,25 +1169,25 @@ public void testBug349486() throws Exception{ this.createFolder("/P1/src/p1"); this.createFile("/P1/src/p1/X.java", - "import java.lang.invoke.MethodHandle;\n" + - "import java.lang.invoke.MethodHandles;\n" + - "import java.lang.invoke.MethodType;\n" + - "\n" + - "public class X {\n" + - " public static void main(String[] args) throws Throwable {\n" + - " Object x;\n" + - " String s;\n" + - " int i;\n" + - " MethodType mt;\n" + - " MethodHandle mh;\n" + - " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" + - " // mt is (char,char)String\n" + - " mt = MethodType.methodType(String.class, char.class, char.class);\n" + - " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" + - " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" + + "import java.lang.invoke.MethodHandle;\n" + + "import java.lang.invoke.MethodHandles;\n" + + "import java.lang.invoke.MethodType;\n" + + "\n" + + "public class X {\n" + + " public static void main(String[] args) throws Throwable {\n" + + " Object x;\n" + + " String s;\n" + + " int i;\n" + + " MethodType mt;\n" + + " MethodHandle mh;\n" + + " MethodHandles.Lookup lookup = MethodHandles.lookup();\n" + + " // mt is (char,char)String\n" + + " mt = MethodType.methodType(String.class, char.class, char.class);\n" + + " mh = lookup.findVirtual(String.class, \"replace\", mt);\n" + + " s = (String) mh.invokeExact(\"daddy\", 'd', 'n');\n" + " }\n" + "}\n"); - + waitUntilIndexesReady(); // do code select @@ -1221,9 +1221,9 @@ public void testBug356325() throws Exception{ this.createFolder("/P1/src/p"); this.createFile("/P1/src/p/C.java", - "package p;" + - "\n" + - "public class C {\n" + + "package p;" + + "\n" + + "public class C {\n" + " public void m() {\n" + " class Inner<T> {\n" + " Inner() {\n"+ @@ -1231,7 +1231,7 @@ public void testBug356325() throws Exception{ " Inner<String> i = new Inner<String>();\n"+ " }\n" + "}\n"); - + waitUntilIndexesReady(); // do code select |