public void testClassNotFound() throws Exception { CommandRunner runner = new CommandRunner("java BadClass", null); runner.run(); assertHasRegexp("java.lang.NoClassDefFoundError", runner.getError()); assertEquals("", runner.getOutput()); assertTrue(0 != runner.getExitCode()); }
public void testBasics() throws Exception { CommandRunner runner = new CommandRunner("java -cp ./classes fitnesse.testutil.Echo", "echo this!"); runner.run(); assertHasRegexp("echo this!", runner.getOutput()); assertEquals("", runner.getError()); assertEquals(false, runner.hasExceptions()); assertEquals(0, runner.getExitCode()); }