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>");
}