JVMUtil { public static final JavaRuntimeInfo getJavaRuntimeInfo() { return JAVA_RUNTIME_INFO; }  static boolean appendToClassPath(String name); static String[] addAllJarsToClassPath(String dirName); static Manifest getManifest(File classpathItem); static File[] getClasspath(); static File[] getClasspath(ClassLoader classLoader); static final JavaRuntimeInfo getJavaRuntimeInfo();  }
@Test public void getJavaRuntimeInfo() { String arch = JVMUtil.getJavaRuntimeInfo().getSunArchDataModel(); assertTrue("32".equals(arch) || "64".equals(arch)); String boot = JVMUtil.getJavaRuntimeInfo().getSunBootClassPath(); try { File[] classpathes = JVMUtil.getClasspath(); boolean flag = false; for (File classpath : classpathes) { if (classpath.getAbsolutePath().equals(boot)) { flag = true; break; } } assertTrue(flag); } catch (Exception e) { assertEquals("JVMUtil.getManifestFromJar Error", e.getMessage()); assertEquals(RuntimeException.class, e.getClass()); assertEquals("error in opening zip file", e.getCause().getMessage()); assertEquals(java.util.zip.ZipException.class, e.getCause().getClass()); } }