Lines 896-901
Link Here
|
896 |
} |
896 |
} |
897 |
} |
897 |
} |
898 |
|
898 |
|
|
|
899 |
/* |
900 |
* Ensures that a container initializer is not kept in the cache if no longer referenced on the classpath |
901 |
* (regression test for 139446 [build path] bug in the Edit Library dialog box, when changing the default JRE, and switching from alternate JRE to workspace default) |
902 |
*/ |
903 |
public void testContainerInitializer19() throws CoreException { |
904 |
try { |
905 |
// setup |
906 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib1.jar"})); |
907 |
IJavaProject p1 = createJavaProject( |
908 |
"P1", |
909 |
new String[] {}, |
910 |
new String[] {"org.eclipse.jdt.core.tests.model.TEST_CONTAINER"}, |
911 |
""); |
912 |
createFile("/P1/lib1.jar", ""); |
913 |
createFile("/P1/lib2.jar", ""); |
914 |
p1.getResolvedClasspath(true); |
915 |
IClasspathEntry[] initialClasspath = p1.getRawClasspath(); |
916 |
|
917 |
// remove reference to container, change initializer, and add reference to container back |
918 |
p1.setRawClasspath(new IClasspathEntry[0], null); |
919 |
ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P1", "/P1/lib2.jar"})); |
920 |
p1.setRawClasspath(initialClasspath, null); |
921 |
|
922 |
assertClasspathEquals( |
923 |
p1.getResolvedClasspath(true), |
924 |
"/P1/lib2.jar[CPE_LIBRARY][K_BINARY][isExported:false]" |
925 |
); |
926 |
} finally { |
927 |
deleteProject("P1"); |
928 |
} |
929 |
} |
930 |
|
899 |
public void testVariableInitializer01() throws CoreException { |
931 |
public void testVariableInitializer01() throws CoreException { |
900 |
try { |
932 |
try { |
901 |
createProject("P1"); |
933 |
createProject("P1"); |