Bug 217934 - Use ee.additional.dirs for bootpath extensions
diff --git a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
index a524a54..dfb7d4e 100644
--- a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
+++ b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
@@ -16,6 +16,8 @@
 
 -Dee.bootclasspath= ..\lib\classes.txt;..\lib\others.txt
 -Dee.src=..\source.txt;;
+-Dee.javadoc=http://a.javadoc.location
+-Dee.additional.dirs=..\lib\additional
 -Dee.ext.dirs=..\lib\ext;..\lib\opt-ext
 -Dee.endorsed.dirs=..\lib\endorsed
 
diff --git a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
index 90230d5..4363201 100644
--- a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
+++ b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
@@ -16,6 +16,8 @@
 
 -Dee.bootclasspath= ../lib/classes.txt:../lib/others.txt
 -Dee.src=../source.txt::
+-Dee.javadoc=http://a.javadoc.location
+-Dee.additional.dirs=../lib/additional
 -Dee.ext.dirs=../lib/ext:../lib/opt-ext
 -Dee.endorsed.dirs=../lib/endorsed
 
diff --git a/org.eclipse.jdt.debug.tests/testfiles/test-jre/lib/additional/add.jar b/org.eclipse.jdt.debug.tests/testfiles/test-jre/lib/additional/add.jar
new file mode 100644
index 0000000..74d8b44
--- /dev/null
+++ b/org.eclipse.jdt.debug.tests/testfiles/test-jre/lib/additional/add.jar
Binary files differ
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
index 09a71d4..894898d 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
@@ -11,6 +11,8 @@
 package org.eclipse.jdt.debug.tests.core;
 
 import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.IPath;
@@ -75,7 +77,7 @@
 		File file = getEEFile();
 		assertNotNull("Missing EE file", file);
 		LibraryLocation[] libs = EEVMType.getLibraryLocations(file);
-		String[] expected = new String[]{"end.jar", "classes.txt", "others.txt", "ext1.jar", "ext2.jar", "opt-ext.jar"};
+		String[] expected = new String[]{"end.jar", "classes.txt", "others.txt", "add.jar", "ext1.jar", "ext2.jar", "opt-ext.jar"};
 		assertEquals("Wrong number of libraries", expected.length, libs.length);
 		for (int i = 0; i < expected.length; i++) {
 			if (i == 3) {
@@ -102,7 +104,7 @@
 		File file = getEEFile();
 		assertNotNull("Missing EE file", file);
 		LibraryLocation[] libs = EEVMType.getLibraryLocations(file);
-		String[] expected = new String[]{"", "source.txt", "", "", "", ""};
+		String[] expected = new String[]{"", "source.txt", "", "", "", "", ""};
 		assertEquals("Wrong number of libraries", expected.length, libs.length);
 		for (int i = 0; i < expected.length; i++) {
 			if (i == 1) {
@@ -123,6 +125,30 @@
 		assertNotNull("Missing EE VM type", vmType);
 		LibraryLocation[] libs = vmType.getDefaultLibraryLocations(file);
 		assertEquals("Wrong number of libraries", 0, libs.length);
+	}
+	
+	/**
+	 * Tests that a javadoc location can be specified.
+	 */
+	public void testJavadocLocation() {
+		File file = getEEFile();
+		URL location = EEVMType.getJavadocLocation(file);
+		URL expectedLocation = null;
+		try {
+			expectedLocation = new URL("http://a.javadoc.location");
+		} catch (MalformedURLException e) {
+			fail();
+		}
+		assertEquals("Incorrect javadoc location", expectedLocation, location);
+	}
+	
+	/**
+	 * Tests that a name with spaces can be specified.
+	 */
+	public void testVMName() {
+		File file = getEEFile();
+		String name = EEVMType.getVMName(file);
+		assertEquals("Incorrect vm name", "Eclipse JDT Test JRE Definition", name);
 	}	
 	
 	/**
@@ -138,6 +164,8 @@
 				"-Dee.executable.console",
 				"-Dee.bootclasspath",
 				"-Dee.src",
+				"-Dee.javadoc",
+				"-Dee.additional.dirs",
 				"-Dee.ext.dirs",
 				"-Dee.endorsed.dirs",
 				"-Dee.language.level",
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
index a49b9a6..cc8e1dc 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/internal/launching/EEVMType.java
@@ -61,6 +61,8 @@
 	public static final String PROP_ENDORSED_DIRS = "-Dee.endorsed.dirs";  //$NON-NLS-1$
 	public static final String PROP_BOOT_CLASS_PATH = "-Dee.bootclasspath";  //$NON-NLS-1$
 	public static final String PROP_SOURCE_ARCHIVE = "-Dee.src";  //$NON-NLS-1$
+	public static final String PROP_JAVADOC_LOC = "-Dee.javadoc";  //$NON-NLS-1$
+	public static final String PROP_ADDITIONAL_DIRS = "-Dee.additional.dirs";  //$NON-NLS-1$
 	public static final String PROP_EXTENSION_DIRS = "-Dee.ext.dirs";  //$NON-NLS-1$
 	public static final String PROP_LANGUAGE_LEVEL = "-Dee.language.level";  //$NON-NLS-1$
 	public static final String PROP_CLASS_LIB_LEVEL = "-Dee.class.library.level";  //$NON-NLS-1$
@@ -68,7 +70,6 @@
 	public static final String PROP_EXECUTABLE_CONSOLE = "-Dee.executable.console";  //$NON-NLS-1$
 	public static final String PROP_JAVA_HOME = "-Djava.home";  //$NON-NLS-1$
 	public static final String PROP_DEBUG_ARGS = "-Dee.debug.args";  //$NON-NLS-1$
-	public static final String PROP_JAVADOC_LOC = "-Dee.javadoc";  //$NON-NLS-1$
 	public static final String PROP_NAME = "-Dee.name";  //$NON-NLS-1$
 	
 	/**
@@ -141,6 +142,12 @@
 			}
 			allLibs.addAll(boot);
 		}
+		
+		// Add all additional libraries
+		dirs = getProperty(PROP_ADDITIONAL_DIRS, eeFile);
+		if (dirs != null) {
+			allLibs.addAll(StandardVMType.gatherAllLibraries(resolvePaths(dirs, eeFile)));
+		}
 				
 		// Add all extension libraries
 		dirs = getProperty(PROP_EXTENSION_DIRS, eeFile);