@Test public void testCreateBoot() throws Exception { File homeJDK = new File(System.getProperty("java.home")).getParentFile(); if (!new File(homeJDK, "lib/tools.jar").exists()) return; // Skip pure jre File bootJDK = SystemInfo.isMac ? homeJDK.getParentFile().getParentFile() : homeJDK; String verStr = System.getProperty("java.version"); boolean macNonStandardJDK = SystemInfo.isMac && !new File(bootJDK, "Contents/Home").exists(); JdkBundle bundle = macNonStandardJDK ? JdkBundle.createBoot(false) : // the test is run under jdk with non-standard layout JdkBundle.createBoot(); assertNotNull(bundle); assertTrue(bundle.isBoot()); assertFalse(bundle.isBundled()); assertTrue( FileUtil.filesEqual(bundle.getAbsoluteLocation(), macNonStandardJDK ? homeJDK : bootJDK)); Pair<Version, Integer> verUpdate = bundle.getVersionUpdate(); assertNotNull(verUpdate); final String evalVerStr = verUpdate.first.toString() + "_" + verUpdate.second.toString(); assertTrue(evalVerStr + " is not the same with " + verStr, verStr.contains(evalVerStr)); }