MoreTestpublic class MoreTest extends TestCase
Fields Summary |
---|
final String | quitChar | final String | prompt | Pipe | toUser | Pipe | destination |
Constructors Summary |
---|
public MoreTest(String name)
super(name);
|
Methods Summary |
---|
public static void | main(java.lang.String[] args)
if (args.length == 0){
junit.textui.TestRunner.run(MoreTest.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 MoreTest(args[i]));
}
return ts;
| private void | nyi()
fail("Not Yet Implemented");
| protected void | setUp()
toUser = new Pipe();
destination = new Pipe();
| protected void | tearDown()
| public void | testEmptyInput()
final More m = new More(1, new StringReader(""), destination.getWriter(), new StringReader("\n123\nx\n"), toUser.getWriter(), quitChar, prompt);
assertTrue(!destination.getReader().ready());
| public void | testShortInput()
final More m = new More(3, new StringReader("1\n2\n"), destination.getWriter(), new StringReader("\n123\nx\n"), toUser.getWriter(), quitChar, prompt);
assertEquals("1", destination.readLine());
assertTrue(!toUser.getReader().ready());
| public void | testSimpleUsage()
final More m = new More(1, new StringReader("1\n2\n3\n4"), destination.getWriter(), new StringReader("\n123\nx\n"), toUser.getWriter(), quitChar, prompt);
assertEquals("1", destination.readLine());
assertEquals(prompt, toUser.readLine());
assertEquals("2", destination.readLine());
assertEquals(prompt, toUser.readLine());
assertEquals("3", destination.readLine());
assertEquals(prompt, toUser.readLine());
assertTrue(!destination.getReader().ready());
|
|