ps6.test
Class PS6TextUiTestCase

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by ps6.test.PS6TextUiTestCase
All Implemented Interfaces:
Test

public class PS6TextUiTestCase
extends TestCase

An immutable TextUI test case for PS6. Runs the TextUI main method on a given input and compared the actual output to the expected output


Constructor Summary
PS6TextUiTestCase(String description, String[] mainParams, Class<?> iMainClass, InputStream testInput, String expected)
           
 
Method Summary
protected  void runTest()
          Runs the this.mainMethod, piping this.testInput into its standard input.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PS6TextUiTestCase

public PS6TextUiTestCase(String description,
                         String[] mainParams,
                         Class<?> iMainClass,
                         InputStream testInput,
                         String expected)
Parameters:
mainClass - class that defines a main() that reads from System.in and writes to System.out
testInput - test input for the filter
expected - expected test output
Method Detail

runTest

protected void runTest()
Runs the this.mainMethod, piping this.testInput into its standard input. Standard output is captured and compared to this.expected

Overrides:
runTest in class TestCase