Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(UserInputTest.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 UserInputTest(args[i]));
}
return ts;
|
private void | nyi()
fail("Not Yet Implemented");
|
protected void | setUp()
in = new ByteArrayInputStream(new byte[0]);
ui = new UserInput(in);
|
protected void | tearDown()
|
public void | testEncoding()
in = new ByteArrayInputStream("one\ntwo\nthree".getBytes());
ui = new UserInput(in);
ui.setEncoding("ISO-8859-1");
assertEquals('o", ui.getChar());
assertEquals("ne", ui.getLine());
assertEquals("two", ui.getLine());
assertEquals("three", ui.getLine());
|
public void | testEncodingProblem()
try {
ui.setEncoding("fee");
fail("Expected an exception");
}
catch (IOException ie){
assertEquals("fee", ie.getMessage());
}
|
public void | testReading()
in = new ByteArrayInputStream("one\ntwo\nthree".getBytes());
ui = new UserInput(in);
assertEquals('o", ui.getChar());
assertEquals("ne", ui.getLine());
assertEquals("two", ui.getLine());
assertEquals("three", ui.getLine());
|
public void | testSimpleCase()
assertTrue(ui.isInteractive());
ui.close();
|