Lines 6579-6583
Link Here
|
6579 |
this.deleteProject("P"); |
6579 |
this.deleteProject("P"); |
6580 |
} |
6580 |
} |
6581 |
} |
6581 |
} |
|
|
6582 |
/** |
6583 |
* @bug 302949: FUP of 302949 |
6584 |
* Test that |
6585 |
* 1) non-chaining jars are cached during classpath resolution and can be retrieved later on |
6586 |
* 2) A full save (after resetting the non chaining jars cache) caches the non-chaining jars information |
6587 |
* 3) when a project is deleted, the non-chaining jar cache is reset. |
6588 |
* |
6589 |
* @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=305122" |
6590 |
* @throws Exception |
6591 |
*/ |
6592 |
public void testBug305122() throws Exception { |
6593 |
try { |
6594 |
|
6595 |
IJavaProject proj = this.createJavaProject("P", new String[] {}, "bin"); |
6596 |
IClasspathEntry[] classpath = new IClasspathEntry[2]; |
6597 |
|
6598 |
addLibrary(proj, "nonchaining.jar", null, new String[0], |
6599 |
new String[] { |
6600 |
"META-INF/MANIFEST.MF", |
6601 |
"Manifest-Version: 1.0\n", |
6602 |
}, |
6603 |
JavaCore.VERSION_1_4); |
6604 |
addLibrary(proj, "chaining.jar", null, new String[0], |
6605 |
new String[] { |
6606 |
"META-INF/MANIFEST.MF", |
6607 |
"Manifest-Version: 1.0\n" + |
6608 |
"Class-Path: chained.jar\n", |
6609 |
}, |
6610 |
JavaCore.VERSION_1_4); |
6611 |
|
6612 |
classpath[0] = JavaCore.newLibraryEntry(new Path("/P/nonchaining.jar"), null, null); |
6613 |
classpath[1] = JavaCore.newLibraryEntry(new Path("/P/chaining.jar"), null, null); |
6614 |
createFile("/P/chained.jar", ""); |
6615 |
|
6616 |
proj.setRawClasspath(classpath, null); |
6617 |
waitForAutoBuild(); |
6618 |
JavaModelManager manager = JavaModelManager.getJavaModelManager(); |
6619 |
assertTrue("Non chaining Jar", manager.isNonChainingJar(classpath[0].getPath())); |
6620 |
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath())); |
6621 |
|
6622 |
((JavaProject)proj).resetResolvedClasspath(); |
6623 |
proj.getResolvedClasspath(true); |
6624 |
manager = JavaModelManager.getJavaModelManager(); |
6625 |
assertTrue("Non chaining Jar", manager.isNonChainingJar(classpath[0].getPath())); |
6626 |
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath())); |
6627 |
|
6628 |
((JavaProject)proj).resetResolvedClasspath(); |
6629 |
IWorkspace workspace = ResourcesPlugin.getWorkspace(); |
6630 |
workspace.save(true, null); |
6631 |
assertTrue("Non chaining Jar", manager.isNonChainingJar(classpath[0].getPath())); |
6632 |
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath())); |
6633 |
|
6634 |
this.deleteProject("P"); |
6635 |
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[0].getPath())); |
6636 |
assertFalse("Chaining Jar", manager.isNonChainingJar(classpath[1].getPath())); |
6637 |
|
6638 |
} finally { |
6639 |
IProject proj = this.getProject("P"); |
6640 |
if ( proj != null && proj.exists()) |
6641 |
this.deleteProject("P"); |
6642 |
} |
6643 |
} |
6582 |
|
6644 |
|
6583 |
} |
6645 |
} |