1 19 20 package org.netbeans.modules.projectimport.eclipse; 21 22 import java.util.HashMap ; 23 import java.util.Map ; 24 import org.netbeans.modules.projectimport.ProjectImporterException; 25 26 29 public class PreferredVMParserTest extends ProjectImporterTestCase { 30 31 public PreferredVMParserTest(String testName) { 32 super(testName); 33 } 34 35 36 public void testParse() throws ProjectImporterException { 37 String org_eclipse_jdt_launching_PREF_VM_XML = 38 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + 39 "<vmSettings defaultVM=\"57,org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType13,1135246830946\" defaultVMConnector=\"\">\n" + 40 "<vmType id=\"org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType\">\n" + 41 "<vm id=\"0\" name=\"jdk-6-beta-bin-b59c\" path=\"/space/java/jdk-6-beta-bin-b59c\"/>\n" + 42 "<vm id=\"1135246830946\" name=\"jdk-6-rc-bin-b64\" path=\"/space/java/jdk-6-rc-bin-b64\">\n" + 43 "<libraryLocations>\n" + 44 "<libraryLocation jreJar=\"/space/java/0_lib/commons-collections-2.1.jar\" jreSrc=\"\" pkgRoot=\"\"/>\n" + 45 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/resources.jar\" jreSrc=\"/space/java/jdk-6-rc-bin-b64/src.zip\" pkgRoot=\"\"/>\n" + 46 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/rt.jar\" jreSrc=\"/space/java/jdk-6-rc-bin-b64/src.zip\" pkgRoot=\"\"/>\n" + 47 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/jsse.jar\" jreSrc=\"/space/java/jdk-6-rc-bin-b64/src.zip\" pkgRoot=\"\"/>\n" + 48 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/jce.jar\" jreSrc=\"/space/java/jdk-6-rc-bin-b64/src.zip\" pkgRoot=\"\"/>\n" + 49 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/charsets.jar\" jreSrc=\"/space/java/jdk-6-rc-bin-b64/src.zip\" pkgRoot=\"\"/>\n" + 50 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/ext/sunjce_provider.jar\" jreSrc=\"\" pkgRoot=\"\"/>\n" + 51 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/ext/sunpkcs11.jar\" jreSrc=\"\" pkgRoot=\"\"/>\n" + 52 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/ext/dnsns.jar\" jreSrc=\"\" pkgRoot=\"\"/>\n" + 53 "<libraryLocation jreJar=\"/space/java/jdk-6-rc-bin-b64/jre/lib/ext/localedata.jar\" jreSrc=\"\" pkgRoot=\"\"/>\n" + 54 "</libraryLocations>\n" + 55 "</vm>\n" + 56 "</vmType>\n" + 57 "</vmSettings>\n"; 58 59 Map jdks = PreferredVMParser.parse(org_eclipse_jdt_launching_PREF_VM_XML); 60 61 Map expectedJDKs = new HashMap (); 62 expectedJDKs.put("jdk-6-rc-bin-b64", "/space/java/jdk-6-rc-bin-b64"); 63 expectedJDKs.put("org.eclipse.jdt.launching.JRE_CONTAINER", "/space/java/jdk-6-rc-bin-b64"); 64 expectedJDKs.put("jdk-6-beta-bin-b59c", "/space/java/jdk-6-beta-bin-b59c"); 65 66 assertEquals("JDKs were successfully parsed", expectedJDKs, jdks); 67 } 68 69 } 70 | Popular Tags |