@Test(expected = ExitException.class) public void testError() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException { String report = File.createTempFile("stackSample", ".html").getPath(); System.setSecurityManager(new NoExitSecurityManager()); Monitor.main(new String[]{"-ASDF", "-f", report, "-ss", "-si", "10", "-w", "600", "-main", MonitorTest.class.getName()}); }
@Test public void testJmx() throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException { try { Monitor.main(new String[]{"-ss", "-si", "10", "-main", MonitorTest.class.getName()}); } catch (ExitException ex) { Assert.assertEquals(0, ex.getExitCode()); } }