public void testTestFinalize() throws Throwable { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream captured = new PrintStream(baos); mysqldResource = new MysqldResource(baseDir, dataDir, "", captured, captured, utils); mysqldResource.finalize(); captured.flush(); String output = new String(baos.toByteArray()); assertEquals("", output); PrintStream devNull = new NullPrintStream(); String[] none = new String[0]; mysqldResource.setShell(new Shell.Default(none, "bogus", devNull, devNull)); mysqldResource.finalize(); captured.flush(); output = new String(baos.toByteArray()); testUtil.assertContainsIgnoreCase(output, "MysqldResource.initTrace"); }
public void testTestFinalize() throws Throwable { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream captured = new PrintStream(baos); mysqldResource = new MysqldResource(fileUtil.nullFile(), captured, captured, fileUtil, shellFactory, streams, threads, str, classUtil); mysqldResource.finalize(); captured.flush(); String output = new String(baos.toByteArray()); assertEquals("", output); PrintStream devNull = new NullPrintStream(); String[] none = new String[0]; mysqldResource.setShell(new Shell.Default(none, "bogus", devNull, devNull)); mysqldResource.finalize(); captured.flush(); output = new String(baos.toByteArray()); testUtil.assertContainsIgnoreCase(output, "<init>"); }
protected void setUp() { super.setUp(); processSleep = 0; String[] commandLineArgs = new String[] { "java" }; String threadName = "ShellTest" + shellName++; shell = new Shell.Default(commandLineArgs, threadName, System.out, System.err); setRuntime(0); }
public Shell newShell(String[] args, String name, PrintStream out, PrintStream err) { return new Default(args, name, out, err); } }
public void testForThrownExceptions() throws Exception { shell = new Shell.Default(null, "foo", null, null); Exception expected = null; try { shell.run(); } catch (Exception e) { expected = e; } assertNotNull(expected); }
public Shell newShell(String[] args, String name, PrintStream out, PrintStream err) { return new Default(args, name, out, err); } }
public Shell newShell(String[] args, String name, PrintStream out, PrintStream err) { return new Default(args, name, out, err); } }
public void testForThrownExceptions() throws Exception { shell = new Shell.Default(null, "foo", null, null); Exception expected = null; try { shell.run(); } catch (Exception e) { expected = e; } assertNotNull(expected); }
protected void setUp() { super.setUp(); processSleep = 0; String[] commandLineArgs = new String[] { "java" }; String threadName = "ShellTest" + shellName++; shell = new Shell.Default(commandLineArgs, threadName, System.out, System.err); setRuntime(0); }