User Tools

Site Tools


junit-test-example

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
junit-test-example [2008/10/12 10:37] jtkorbjunit-test-example [2008/10/25 08:58] (current) jtkorb
Line 1: Line 1:
 **Updates** **Updates**
-  * Project 3 neither reads from standard input nor writes gradeable text to standard output, so the mechanism below to redirect these two streams to files is not necessary for this project.  Instead, your JUnit test routines can just call ''main'' directly with different versions of the ''String[] args'' array.+  * Project 3 neither reads from standard input nor writes gradeable text to standard output, so the mechanism below to redirect these two streams to files is not necessary for this project.  Instead, your JUnit test routines can just call ''main'' directly with different versions of the ''String[] args'' array to indicate different input test files.
   * For command-line testing in the UNIX/Linux environment, see the new section [[#Command-Line JUnit Testing in UNIX|below]].   * For command-line testing in the UNIX/Linux environment, see the new section [[#Command-Line JUnit Testing in UNIX|below]].
  
Line 63: Line 63:
     import java.io.PrintStream;     import java.io.PrintStream;
     import java.util.Scanner;     import java.util.Scanner;
 +
  
 ====== Command-Line JUnit Testing in UNIX ====== ====== Command-Line JUnit Testing in UNIX ======
Line 73: Line 74:
   - Run your test class using the text-based JUnit runner, ''junit.textui.TestRunner''.   - Run your test class using the text-based JUnit runner, ''junit.textui.TestRunner''.
  
-Here is a script, named ''tester'', that compiles and runs a test class given as the command line argument.+Here is a script, named ''javat'', that compiles and runs a test class given as the command line argument.
  
   #!/bin/sh   #!/bin/sh
junit-test-example.txt · Last modified: 2008/10/25 08:58 by jtkorb