Lines 17-22
Link Here
|
17 |
|
17 |
|
18 |
import junit.framework.Test; |
18 |
import junit.framework.Test; |
19 |
|
19 |
|
|
|
20 |
import org.eclipse.core.resources.IFile; |
21 |
import org.eclipse.core.resources.IResource; |
20 |
import org.eclipse.core.resources.IncrementalProjectBuilder; |
22 |
import org.eclipse.core.resources.IncrementalProjectBuilder; |
21 |
import org.eclipse.core.runtime.CoreException; |
23 |
import org.eclipse.core.runtime.CoreException; |
22 |
import org.eclipse.core.runtime.IPath; |
24 |
import org.eclipse.core.runtime.IPath; |
Lines 53-59
Link Here
|
53 |
return buildModelTestSuite(JavaSearchBugsTests.class); |
55 |
return buildModelTestSuite(JavaSearchBugsTests.class); |
54 |
} |
56 |
} |
55 |
static { |
57 |
static { |
56 |
// org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; |
58 |
org.eclipse.jdt.internal.core.search.BasicSearchEngine.VERBOSE = true; |
57 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
59 |
// org.eclipse.jdt.internal.codeassist.SelectionEngine.DEBUG = true; |
58 |
} |
60 |
} |
59 |
|
61 |
|
Lines 10003-10008
Link Here
|
10003 |
} |
10005 |
} |
10004 |
|
10006 |
|
10005 |
/** |
10007 |
/** |
|
|
10008 |
* @bug 222284: [search] ZipException while searching if linked jar doesn't exist any longer |
10009 |
* @test Ensure that types found in an internal jar exist when using a Java search scope |
10010 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=222284" |
10011 |
*/ |
10012 |
public void testONLY_Bug222284() throws Exception { |
10013 |
String jarName = "lib222284.jar"; |
10014 |
String jarPath = getExternalPath()+jarName; |
10015 |
IFile jarFile = JAVA_PROJECT.getProject().getFile(jarName); |
10016 |
try { |
10017 |
// Create jar and add it to JavaSearchBugs project build path |
10018 |
String[] pathsAndContents = new String[] { |
10019 |
"pack/Ref.java", |
10020 |
"package pack;\n" + |
10021 |
"public class Ref {\n" + |
10022 |
"}", |
10023 |
}; |
10024 |
createJar(pathsAndContents, jarPath); |
10025 |
jarFile.createLink(new Path(jarPath), IResource.NONE, null); |
10026 |
addLibraryEntry(JAVA_PROJECT, "/JavaSearchBugs/lib222284.jar", null); |
10027 |
|
10028 |
// Create file and wait for indexes |
10029 |
createFile("/JavaSearchBugs/src/Test.java", |
10030 |
"import pack.Ref;" + |
10031 |
"public class Test {\n" + |
10032 |
" Ref ref;" + |
10033 |
"}\n" |
10034 |
); |
10035 |
waitUntilIndexesReady(); |
10036 |
|
10037 |
// Exit, delete jar and restart |
10038 |
simulateExit(); |
10039 |
deleteExternalResource(jarName); |
10040 |
simulateRestart(); |
10041 |
|
10042 |
// Search for references to a class of deleted jar file, expect no result |
10043 |
search("pack.Ref", TYPE, REFERENCES); |
10044 |
assertSearchResults(""); |
10045 |
} finally { |
10046 |
deleteResource(jarFile); |
10047 |
removeClasspathEntry(JAVA_PROJECT, new Path(jarPath)); |
10048 |
} |
10049 |
} |
10050 |
|
10051 |
/** |
10006 |
* @bug 228852: classes opened via Open Type not found |
10052 |
* @bug 228852: classes opened via Open Type not found |
10007 |
* @test Ensure that types found in an internal jar exist when using a workspace scope |
10053 |
* @test Ensure that types found in an internal jar exist when using a workspace scope |
10008 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=228852" |
10054 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=228852" |