Lines 242-247
Link Here
|
242 |
suite.addTest(new ClasspathTests("testExtraLibraries15")); |
242 |
suite.addTest(new ClasspathTests("testExtraLibraries15")); |
243 |
suite.addTest(new ClasspathTests("testExtraLibraries16")); |
243 |
suite.addTest(new ClasspathTests("testExtraLibraries16")); |
244 |
suite.addTest(new ClasspathTests("testExtraLibraries17")); |
244 |
suite.addTest(new ClasspathTests("testExtraLibraries17")); |
|
|
245 |
suite.addTest(new ClasspathTests("testExtraLibraries18")); |
245 |
suite.addTest(new ClasspathTests("testFixClasspath1")); |
246 |
suite.addTest(new ClasspathTests("testFixClasspath1")); |
246 |
suite.addTest(new ClasspathTests("testFixClasspath2")); |
247 |
suite.addTest(new ClasspathTests("testFixClasspath2")); |
247 |
suite.addTest(new ClasspathTests("testHasClasspathCycle")); |
248 |
suite.addTest(new ClasspathTests("testHasClasspathCycle")); |
Lines 249-254
Link Here
|
249 |
suite.addTest(new ClasspathTests("testInvalidClasspath2")); |
250 |
suite.addTest(new ClasspathTests("testInvalidClasspath2")); |
250 |
suite.addTest(new ClasspathTests("testInvalidExternalClassFolder")); |
251 |
suite.addTest(new ClasspathTests("testInvalidExternalClassFolder")); |
251 |
suite.addTest(new ClasspathTests("testInvalidExternalJar")); |
252 |
suite.addTest(new ClasspathTests("testInvalidExternalJar")); |
|
|
253 |
suite.addTest(new ClasspathTests("testTransitionFromInvalidToValidJar")); |
252 |
suite.addTest(new ClasspathTests("testInvalidInternalJar1")); |
254 |
suite.addTest(new ClasspathTests("testInvalidInternalJar1")); |
253 |
suite.addTest(new ClasspathTests("testInvalidInternalJar2")); |
255 |
suite.addTest(new ClasspathTests("testInvalidInternalJar2")); |
254 |
suite.addTest(new ClasspathTests("testInvalidSourceFolder")); |
256 |
suite.addTest(new ClasspathTests("testInvalidSourceFolder")); |
Lines 4020-4025
Link Here
|
4020 |
} |
4022 |
} |
4021 |
} |
4023 |
} |
4022 |
/* |
4024 |
/* |
|
|
4025 |
* Ensures that the correct delta is reported when changing the Class-Path: clause |
4026 |
* of an external jar from not containing a chained jar to containing a chained jar. |
4027 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425) |
4028 |
*/ |
4029 |
public void testExtraLibraries18() throws Exception { |
4030 |
try { |
4031 |
IJavaProject p = createJavaProject("P"); |
4032 |
addExternalLibrary(p, getExternalResourcePath("lib1.jar"), new String[0], |
4033 |
new String[] { |
4034 |
"META-INF/MANIFEST.MF", |
4035 |
"Manifest-Version: 1.0\n" |
4036 |
}, |
4037 |
JavaCore.VERSION_1_4); |
4038 |
refreshExternalArchives(p); |
4039 |
|
4040 |
startDeltas(); |
4041 |
org.eclipse.jdt.core.tests.util.Util.createJar(new String[0], |
4042 |
new String[] { |
4043 |
"META-INF/MANIFEST.MF", |
4044 |
"Manifest-Version: 1.0\n" + |
4045 |
"Class-Path: lib2.jar\n", |
4046 |
}, |
4047 |
getExternalResourcePath("lib1.jar"), |
4048 |
JavaCore.VERSION_1_4); |
4049 |
createExternalFile("lib2.jar", ""); |
4050 |
|
4051 |
refreshExternalArchives(p); |
4052 |
assertDeltas( |
4053 |
"Unexpected delta", |
4054 |
"P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" + |
4055 |
" "+ getExternalPath() + "lib1.jar[*]: {CONTENT | REORDERED | ARCHIVE CONTENT CHANGED}\n" + |
4056 |
" "+ getExternalPath() + "lib2.jar[+]: {}" |
4057 |
); |
4058 |
} finally { |
4059 |
stopDeltas(); |
4060 |
deleteProject("P"); |
4061 |
deleteExternalResource("lib1.jar"); |
4062 |
deleteExternalResource("lib2.jar"); |
4063 |
} |
4064 |
} |
4065 |
/* |
4023 |
* Ensures that a marker is removed if adding an internal jar that is on the classpath in another project |
4066 |
* Ensures that a marker is removed if adding an internal jar that is on the classpath in another project |
4024 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 ) |
4067 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=213723 ) |
4025 |
*/ |
4068 |
*/ |
Lines 4201-4206
Link Here
|
4201 |
} |
4244 |
} |
4202 |
} |
4245 |
} |
4203 |
/* |
4246 |
/* |
|
|
4247 |
* Ensures that validateClasspathEntry() sees a transition from an invalid/missing jar to a valid jar. |
4248 |
*/ |
4249 |
public void testTransitionFromInvalidToValidJar() throws CoreException, IOException { |
4250 |
String transitioningJarName = "transitioningJar.jar"; |
4251 |
String transitioningJar = getExternalPath() + transitioningJarName; |
4252 |
String nonExistingJar = getExternalPath() + "nonExisting.jar"; |
4253 |
IClasspathEntry transitioningEntry = JavaCore.newLibraryEntry(new Path(transitioningJar), null, null); |
4254 |
IClasspathEntry nonExistingEntry = JavaCore.newLibraryEntry(new Path(nonExistingJar), null, null); |
4255 |
|
4256 |
try { |
4257 |
IJavaProject proj = createJavaProject("P", new String[] {}, new String[] {transitioningJar, nonExistingJar}, "bin"); |
4258 |
|
4259 |
IJavaModelStatus status1 = ClasspathEntry.validateClasspathEntry(proj, transitioningEntry, false, false); |
4260 |
IJavaModelStatus status2 = ClasspathEntry.validateClasspathEntry(proj, nonExistingEntry, false, false); |
4261 |
assertFalse("Non-existing jar should be invalid", status1.isOK()); |
4262 |
assertFalse("Non-existing jar should be invalid", status2.isOK()); |
4263 |
|
4264 |
Util.createJar( |
4265 |
new String[0], |
4266 |
new String[] { |
4267 |
"META-INF/MANIFEST.MF", |
4268 |
"Manifest-Version: 1.0\n" |
4269 |
}, |
4270 |
transitioningJar, |
4271 |
JavaCore.VERSION_1_4); |
4272 |
status1 = ClasspathEntry.validateClasspathEntry(proj, transitioningEntry, false, false); |
4273 |
status2 = ClasspathEntry.validateClasspathEntry(proj, nonExistingEntry, false, false); |
4274 |
assertTrue("Existing jar should be valid", status1.isOK()); |
4275 |
assertFalse("Non-existing jar should be invalid", status2.isOK()); |
4276 |
} finally { |
4277 |
deleteExternalResource(transitioningJarName); |
4278 |
deleteProject("P"); |
4279 |
} |
4280 |
} |
4281 |
/* |
4204 |
* Ensures that a non existing internal jar cannot be put on the classpath. |
4282 |
* Ensures that a non existing internal jar cannot be put on the classpath. |
4205 |
*/ |
4283 |
*/ |
4206 |
public void testInvalidInternalJar1() throws CoreException { |
4284 |
public void testInvalidInternalJar1() throws CoreException { |