Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2010-05-30 13:34:35 -0400
committerStephan Herrmann2010-05-30 13:34:35 -0400
commit87dda191d07e4956de3ce790192e22930606ff8e (patch)
tree4acf8055a2123befab77163f0f710132a91abbdb /org.eclipse.jdt.core.tests.model
parent4a4c3211d59b715d23862113be9856c5fdea04c4 (diff)
downloadorg.eclipse.objectteams-87dda191d07e4956de3ce790192e22930606ff8e.tar.gz
org.eclipse.objectteams-87dda191d07e4956de3ce790192e22930606ff8e.tar.xz
org.eclipse.objectteams-87dda191d07e4956de3ce790192e22930606ff8e.zip
update jdt.core to v_A56 and build against 3.6RC3
Diffstat (limited to 'org.eclipse.jdt.core.tests.model')
-rw-r--r--org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
index 5111a6f8f..f2797ed75 100644
--- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
+++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ClasspathTests.java
@@ -6673,5 +6673,79 @@ public void testBug305037() throws Exception {
JavaCore.removeClasspathVariable("MyVar", null);
}
}
+/**
+ * @bug 313965: Breaking change in classpath container API
+ * Test that when the resolveReferencedLibrariesForContainers system property is set to true, the referenced libraries
+ * for JARs from containers are resolved.
+ *
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965"
+ * @throws Exception
+ */
+public void testBug313965() throws Exception {
+ try {
+ simulateExit();
+ // Use the literal attribute and not constant. Attribute once documented is not supposed to change.
+ System.setProperty("resolveReferencedLibrariesForContainers", "true");
+ simulateRestart();
+ IJavaProject p = this.createJavaProject("P", new String[] {}, "bin");
+ addLibrary(p, "lib.jar", null, new String[0],
+ new String[] {
+ "META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n" +
+ "Class-Path: lib1.jar\n",
+ },
+ JavaCore.VERSION_1_4);
+ IClasspathEntry[] classpath = new IClasspathEntry[1];
+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
+ classpath[0] = JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"));
+ setClasspath(p, classpath);
+ createFile("/P/lib1.jar", "");
+
+ IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
+ assertClasspathEquals(resolvedClasspath,
+ "/P/lib1.jar[CPE_LIBRARY][K_BINARY][isExported:false]\n" +
+ "/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
+ } finally {
+ deleteProject("P");
+ ContainerInitializer.setInitializer(null);
+ simulateExit();
+ System.setProperty("resolveReferencedLibrariesForContainers", "");
+ simulateRestart();
+ }
+}
+/**
+ * @bug 313965: Breaking change in classpath container API
+ * Test that when the resolveReferencedLibrariesForContainers system property is set to false (or default),
+ * the referenced libraries for JARs from containers are NOT resolved or added to the project's classpath.
+ *
+ * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=313965"
+ * @throws Exception
+ */
+public void testBug313965a() throws Exception {
+ try {
+ // Do not set the resolveReferencedLibrariesForContainers system property (the default value is false)
+ IJavaProject p = this.createJavaProject("P", new String[] {}, "bin");
+ addLibrary(p, "lib.jar", null, new String[0],
+ new String[] {
+ "META-INF/MANIFEST.MF",
+ "Manifest-Version: 1.0\n" +
+ "Class-Path: lib1.jar\n",
+ },
+ JavaCore.VERSION_1_4);
+ IClasspathEntry[] classpath = new IClasspathEntry[1];
+ ContainerInitializer.setInitializer(new DefaultContainerInitializer(new String[] {"P", "/P/lib.jar"}));
+ classpath[0] = JavaCore.newContainerEntry(new Path("org.eclipse.jdt.core.tests.model.TEST_CONTAINER"));
+ setClasspath(p, classpath);
+
+ createFile("/P/lib1.jar", "");
+
+ IClasspathEntry[] resolvedClasspath = p.getResolvedClasspath(true);
+ assertClasspathEquals(resolvedClasspath,
+ "/P/lib.jar[CPE_LIBRARY][K_BINARY][isExported:false]");
+ } finally {
+ deleteProject("P");
+ ContainerInitializer.setInitializer(null);
+ }
+}
}

Back to the top