Lines 41-46
Link Here
|
41 |
import org.eclipse.jdt.core.IClasspathContainer; |
41 |
import org.eclipse.jdt.core.IClasspathContainer; |
42 |
import org.eclipse.jdt.core.IClasspathEntry; |
42 |
import org.eclipse.jdt.core.IClasspathEntry; |
43 |
import org.eclipse.jdt.core.ICompilationUnit; |
43 |
import org.eclipse.jdt.core.ICompilationUnit; |
|
|
44 |
import org.eclipse.jdt.core.IJavaElement; |
44 |
import org.eclipse.jdt.core.IJavaElementDelta; |
45 |
import org.eclipse.jdt.core.IJavaElementDelta; |
45 |
import org.eclipse.jdt.core.IJavaModelMarker; |
46 |
import org.eclipse.jdt.core.IJavaModelMarker; |
46 |
import org.eclipse.jdt.core.IJavaModelStatus; |
47 |
import org.eclipse.jdt.core.IJavaModelStatus; |
Lines 156-161
Link Here
|
156 |
return result; |
157 |
return result; |
157 |
} |
158 |
} |
158 |
|
159 |
|
|
|
160 |
/* |
161 |
* Ensures that adding an external jar and refreshing removed the markers |
162 |
* (regression test for 185733 Refreshing external jar doesn't update problem marker) |
163 |
*/ |
164 |
public void testAddExternalJar() throws CoreException, IOException { |
165 |
String externalJarPath = getExternalPath() + "test185733.jar"; |
166 |
try { |
167 |
IJavaProject p = createJavaProject("P", new String[0], new String[] {externalJarPath}, ""); |
168 |
waitUntilIndexesReady(); |
169 |
waitForAutoBuild(); |
170 |
|
171 |
createFile(new File(getExternalPath()), "test185733.jar", ""); |
172 |
getJavaModel().refreshExternalArchives(new IJavaElement[] {p}, null); |
173 |
assertMarkers( |
174 |
"Unexpected markers", |
175 |
"", |
176 |
p); |
177 |
} finally { |
178 |
deleteFile(new File(externalJarPath)); |
179 |
deleteProject("P"); |
180 |
} |
181 |
} |
182 |
|
159 |
/** |
183 |
/** |
160 |
* Add an entry to the classpath for a non-existent root. Then create |
184 |
* Add an entry to the classpath for a non-existent root. Then create |
161 |
* the root and ensure that it comes alive. |
185 |
* the root and ensure that it comes alive. |
Lines 3904-3907
Link Here
|
3904 |
this.deleteProjects(new String[] {"P1", "P2"}); |
3928 |
this.deleteProjects(new String[] {"P1", "P2"}); |
3905 |
} |
3929 |
} |
3906 |
} |
3930 |
} |
|
|
3931 |
|
3932 |
/* |
3933 |
* Ensures that removing an external jar and refreshing creates the correct markers |
3934 |
* (regression test for 185733 Refreshing external jar doesn't update problem marker) |
3935 |
*/ |
3936 |
public void testRemoveExternalJar() throws CoreException, IOException { |
3937 |
try { |
3938 |
File externalJar = createFile(new File(getExternalPath()), "test185733.jar", ""); |
3939 |
IJavaProject p = createJavaProject("P", new String[0], new String[] {externalJar.getPath()}, ""); |
3940 |
waitUntilIndexesReady(); |
3941 |
waitForAutoBuild(); |
3942 |
|
3943 |
deleteFile(externalJar); |
3944 |
getJavaModel().refreshExternalArchives(new IJavaElement[] {p}, null); |
3945 |
assertMarkers( |
3946 |
"Unexpected markers", |
3947 |
"Project \'P\' is missing required library: \'" + externalJar.getPath() + "\'", |
3948 |
p); |
3949 |
} finally { |
3950 |
deleteProject("P"); |
3951 |
} |
3952 |
} |
3907 |
} |
3953 |
} |