Lines 249-254
Link Here
|
249 |
suite.addTest(new ClasspathTests("testInvalidClasspath2")); |
249 |
suite.addTest(new ClasspathTests("testInvalidClasspath2")); |
250 |
suite.addTest(new ClasspathTests("testInvalidExternalClassFolder")); |
250 |
suite.addTest(new ClasspathTests("testInvalidExternalClassFolder")); |
251 |
suite.addTest(new ClasspathTests("testInvalidExternalJar")); |
251 |
suite.addTest(new ClasspathTests("testInvalidExternalJar")); |
|
|
252 |
suite.addTest(new ClasspathTests("testTransitionFromInvalidToValidJar")); |
252 |
suite.addTest(new ClasspathTests("testInvalidInternalJar1")); |
253 |
suite.addTest(new ClasspathTests("testInvalidInternalJar1")); |
253 |
suite.addTest(new ClasspathTests("testInvalidInternalJar2")); |
254 |
suite.addTest(new ClasspathTests("testInvalidInternalJar2")); |
254 |
suite.addTest(new ClasspathTests("testInvalidSourceFolder")); |
255 |
suite.addTest(new ClasspathTests("testInvalidSourceFolder")); |
Lines 334-339
Link Here
|
334 |
suite.addTest(new ClasspathTests("testBug321170")); |
335 |
suite.addTest(new ClasspathTests("testBug321170")); |
335 |
suite.addTest(new ClasspathTests("testBug229042")); |
336 |
suite.addTest(new ClasspathTests("testBug229042")); |
336 |
suite.addTest(new ClasspathTests("testBug274737")); |
337 |
suite.addTest(new ClasspathTests("testBug274737")); |
|
|
338 |
suite.addTest(new ClasspathTests("testBug357425")); |
337 |
return suite; |
339 |
return suite; |
338 |
} |
340 |
} |
339 |
public void setUpSuite() throws Exception { |
341 |
public void setUpSuite() throws Exception { |
Lines 4201-4206
Link Here
|
4201 |
} |
4203 |
} |
4202 |
} |
4204 |
} |
4203 |
/* |
4205 |
/* |
|
|
4206 |
* Ensures that validateClasspathEntry() sees a transition from an invalid/missing jar to a valid jar. |
4207 |
*/ |
4208 |
public void testTransitionFromInvalidToValidJar() throws CoreException, IOException { |
4209 |
String transitioningJarName = "transitioningJar.jar"; |
4210 |
String transitioningJar = getExternalPath() + transitioningJarName; |
4211 |
String nonExistingJar = getExternalPath() + "nonExisting.jar"; |
4212 |
IClasspathEntry transitioningEntry = JavaCore.newLibraryEntry(new Path(transitioningJar), null, null); |
4213 |
IClasspathEntry nonExistingEntry = JavaCore.newLibraryEntry(new Path(nonExistingJar), null, null); |
4214 |
|
4215 |
try { |
4216 |
IJavaProject proj = createJavaProject("P", new String[] {}, new String[] {transitioningJar, nonExistingJar}, "bin"); |
4217 |
|
4218 |
IJavaModelStatus status1 = ClasspathEntry.validateClasspathEntry(proj, transitioningEntry, false, false); |
4219 |
IJavaModelStatus status2 = ClasspathEntry.validateClasspathEntry(proj, nonExistingEntry, false, false); |
4220 |
assertFalse("Non-existing jar should be invalid", status1.isOK()); |
4221 |
assertFalse("Non-existing jar should be invalid", status2.isOK()); |
4222 |
|
4223 |
Util.createJar( |
4224 |
new String[0], |
4225 |
new String[] { |
4226 |
"META-INF/MANIFEST.MF", |
4227 |
"Manifest-Version: 1.0\n" |
4228 |
}, |
4229 |
transitioningJar, |
4230 |
JavaCore.VERSION_1_4); |
4231 |
status1 = ClasspathEntry.validateClasspathEntry(proj, transitioningEntry, false, false); |
4232 |
status2 = ClasspathEntry.validateClasspathEntry(proj, nonExistingEntry, false, false); |
4233 |
assertTrue("Existing jar should be valid", status1.isOK()); |
4234 |
assertFalse("Non-existing jar should be invalid", status2.isOK()); |
4235 |
} finally { |
4236 |
deleteExternalResource(transitioningJarName); |
4237 |
deleteProject("P"); |
4238 |
} |
4239 |
} |
4240 |
/* |
4204 |
* Ensures that a non existing internal jar cannot be put on the classpath. |
4241 |
* Ensures that a non existing internal jar cannot be put on the classpath. |
4205 |
*/ |
4242 |
*/ |
4206 |
public void testInvalidInternalJar1() throws CoreException { |
4243 |
public void testInvalidInternalJar1() throws CoreException { |
Lines 7190-7193
Link Here
|
7190 |
} |
7227 |
} |
7191 |
} |
7228 |
} |
7192 |
|
7229 |
|
|
|
7230 |
/* |
7231 |
* Ensures that the correct delta is reported when changing the Class-Path: clause |
7232 |
* of an external jar from not containing a chained jar to containing a chained jar. |
7233 |
* (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425) |
7234 |
*/ |
7235 |
public void testBug357425() throws Exception { |
7236 |
try { |
7237 |
IJavaProject p = createJavaProject("P"); |
7238 |
addExternalLibrary(p, getExternalResourcePath("lib357425_a.jar"), new String[0], |
7239 |
new String[] { |
7240 |
"META-INF/MANIFEST.MF", |
7241 |
"Manifest-Version: 1.0\n" |
7242 |
}, |
7243 |
JavaCore.VERSION_1_4); |
7244 |
refreshExternalArchives(p); |
7245 |
|
7246 |
startDeltas(); |
7247 |
org.eclipse.jdt.core.tests.util.Util.createJar(new String[0], |
7248 |
new String[] { |
7249 |
"META-INF/MANIFEST.MF", |
7250 |
"Manifest-Version: 1.0\n" + |
7251 |
"Class-Path: lib357425_b.jar\n", |
7252 |
}, |
7253 |
getExternalResourcePath("lib357425_a.jar"), |
7254 |
JavaCore.VERSION_1_4); |
7255 |
createExternalFile("lib357425_b.jar", ""); |
7256 |
|
7257 |
refreshExternalArchives(p); |
7258 |
assertDeltas( |
7259 |
"Unexpected delta", |
7260 |
"P[*]: {CHILDREN | RESOLVED CLASSPATH CHANGED}\n" + |
7261 |
" "+ getExternalPath() + "lib357425_a.jar[*]: {CONTENT | REORDERED | ARCHIVE CONTENT CHANGED}\n" + |
7262 |
" "+ getExternalPath() + "lib357425_b.jar[+]: {}" |
7263 |
); |
7264 |
} finally { |
7265 |
stopDeltas(); |
7266 |
deleteProject("P"); |
7267 |
deleteExternalResource("lib357425_a.jar"); |
7268 |
deleteExternalResource("lib357425_b.jar"); |
7269 |
} |
7270 |
} |
7271 |
|
7193 |
} |
7272 |
} |