Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(OutputTest.class);
} else {
junit.textui.TestRunner.run(makeSuite(args));
}
|
private static junit.framework.TestSuite | makeSuite(java.lang.String[] args)
final TestSuite ts = new TestSuite();
for (int i = 0; i < args.length; i++){
ts.addTest(new OutputTest(args[i]));
}
return ts;
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
|
protected void | tearDown()
|
public void | testClosedWhenDone()
final TestStream ts = new TestStream();
final Output out = new Output(ts, true);
out.close();
assertTrue("Expected test stream to be closed", ts.isClosed());
|
public void | testNotClosedWhenDone()
final TestStream ts = new TestStream();
final Output out = new Output(ts, false);
out.close();
assertTrue("Expected test stream to still be open", !ts.isClosed());
|
public void | testPrintObject()
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
final Output out = new Output(bout, true);
final Object o = new Object();
out.print(o);
out.flush();
//need to add "\n" at the end since bout.toString() returns a newline at the end
assertEquals(o.toString()+"\n", bout.toString());
|
public void | testPrintln()
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
final Output out = new Output(bout, true);
out.println("m");
out.flush();
assertEquals("m" + System.getProperty("line.separator"), bout.toString());
|
public void | testPrintlnObject()
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
final Output out = new Output(bout, true);
final Object o = new Object();
out.println(o);
out.flush();
assertEquals(o.toString() + System.getProperty("line.separator"), bout.toString());
|
public void | testSimpleUse()
final ByteArrayOutputStream bout = new ByteArrayOutputStream();
final Output out = new Output(bout, true);
out.print("m");
out.flush();
assertEquals("m", bout.toString());
|