@Test public void testEnableJMX() throws Exception { assert_().that(CapsuleLauncher.enableJMX(list("a", "b"))).has().item("-Dcom.sun.management.jmxremote"); assert_().that(CapsuleLauncher.enableJMX(list("a", "-Dcom.sun.management.jmxremote", "b"))).isEqualTo(list("a", "-Dcom.sun.management.jmxremote", "b")); }
public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; }
CapsuleLauncher { public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; } }
CapsuleLauncher { public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; } CapsuleLauncher(Path jarFile); }
CapsuleLauncher { public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; } CapsuleLauncher(Path jarFile); CapsuleLauncher setJavaHomes(Map<String, List<Path>> javaHomes); CapsuleLauncher setProperties(Properties properties); CapsuleLauncher setProperty(String property, String value); CapsuleLauncher setCacheDir(Path dir); Capsule newCapsule(); Capsule newCapsule(String mode); Capsule newCapsule(Path wrappedJar); Capsule newCapsule(String mode, Path wrappedJar); @SuppressWarnings("unchecked") static Map<String, List<Path>> findJavaHomes(); static List<String> enableJMX(List<String> jvmArgs); }
CapsuleLauncher { public static List<String> enableJMX(List<String> jvmArgs) { final String arg = "-D" + OPT_JMX_REMOTE; if (jvmArgs.contains(arg)) return jvmArgs; final List<String> cmdLine2 = new ArrayList<>(jvmArgs); cmdLine2.add(arg); return cmdLine2; } CapsuleLauncher(Path jarFile); CapsuleLauncher setJavaHomes(Map<String, List<Path>> javaHomes); CapsuleLauncher setProperties(Properties properties); CapsuleLauncher setProperty(String property, String value); CapsuleLauncher setCacheDir(Path dir); Capsule newCapsule(); Capsule newCapsule(String mode); Capsule newCapsule(Path wrappedJar); Capsule newCapsule(String mode, Path wrappedJar); @SuppressWarnings("unchecked") static Map<String, List<Path>> findJavaHomes(); static List<String> enableJMX(List<String> jvmArgs);  }