Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 190490 Details for
Bug 335986
No expected event fired when removing a JAR file from a classpath container
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Regression test
bug335986_test.txt (text/plain), 3.50 KB, created by
Jay Arthanareeswaran
on 2011-03-06 06:14:09 EST
(
hide
)
Description:
Regression test
Filename:
MIME Type:
Creator:
Jay Arthanareeswaran
Created:
2011-03-06 06:14:09 EST
Size:
3.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ClasspathTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java,v >retrieving revision 1.215 >diff -u -r1.215 ClasspathTests.java >--- src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 27 May 2010 10:10:45 -0000 1.215 >+++ src/org/eclipse/jdt/core/tests/model/ClasspathTests.java 6 Mar 2011 11:12:05 -0000 >@@ -13,6 +13,7 @@ > import java.io.ByteArrayInputStream; > import java.io.File; > import java.io.FileOutputStream; >+import java.io.FilenameFilter; > import java.io.IOException; > import java.util.Hashtable; > import java.util.Map; >@@ -89,7 +90,7 @@ > static { > // Names of tests to run: can be "testBugXXXX" or "BugXXXX") > // TESTS_PREFIX = "testClasspathDuplicateExtraAttribute"; >-// TESTS_NAMES = new String[] {"testClasspathValidation42"}; >+ TESTS_NAMES = new String[] {"testBug335986"}; > // TESTS_NUMBERS = new int[] { 23, 28, 38 }; > // TESTS_RANGE = new int[] { 21, 38 }; > } >@@ -6747,5 +6748,65 @@ > ContainerInitializer.setInitializer(null); > } > } >+public void testBug335986() throws Exception { >+ try { >+ final IJavaProject p = this.createJavaProject("P", new String[] {}, "bin"); >+ createFolder("/P/lib"); >+ final File libFolder = new File(p.getProject().getLocation().append("lib").toOSString()); >+ addLibrary(p, "lib/lib_a.jar", null, new String[0], >+ new String[] { >+ "META-INF/MANIFEST.MF", >+ "Manifest-Version: 1.0\n" + >+ "Class-Path: \n", >+ }, >+ JavaCore.VERSION_1_4); >+ >+ class WebContainer extends DefaultContainerInitializer.DefaultContainer { >+ File libraryFolder; >+ public WebContainer(char[][] libPaths) { >+ super(libPaths); >+ this.libPaths = libPaths; >+ } >+ public IClasspathEntry[] getClasspathEntries() { >+ this.libraryFolder = new File(ResourcesPlugin.getWorkspace().getRoot().getProject("P").getLocation().append("lib").toOSString()); >+ if (this.libraryFolder.exists()) { >+ String[] jars = this.libraryFolder.list(new FilenameFilter() { >+ public boolean accept(File dir, String name) { >+ if (name.endsWith("jar")) >+ return true; >+ return false; >+ } >+ }); >+ IClasspathEntry[] classpath = new IClasspathEntry[jars.length]; >+ for (int i=0; i < jars.length; i++) { >+ classpath[i] = JavaCore.newLibraryEntry(new Path("/P/lib").append(jars[i]), null, null, true); >+ } >+ return classpath; >+ } >+ return new IClasspathEntry[0]; >+ } >+ } >+ IClasspathEntry[] classpath = new IClasspathEntry[1]; >+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", ""}) { >+ protected DefaultContainerInitializer.DefaultContainer newContainer(final char[][] libPaths) { >+ return new WebContainer(libPaths); >+ } >+ } >+ ); >+ classpath[0] = JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER")); >+ setClasspath(p, classpath); >+ startDeltas(); >+ File jarFile = new File(libFolder, "lib_a.jar"); >+ jarFile.delete(); >+ p.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); >+ assertDeltas("Unexpected delta", >+ "P[*]: {CHILDREN | CONTENT | RESOLVED CLASSPATH CHANGED}\n" + >+ " lib/lib_a.jar[*]: {REMOVED FROM CLASSPATH}", false); >+ >+ } finally { >+ deleteProject("P"); >+ ContainerInitializer.setInitializer(null); >+ } >+} > > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 335986
:
189778
| 190490 |
191378