JUnit 4 Converter

Programming Project


The purpose of this program is to convert a JUnit 4 source file to JUnit 3.

JUnit 4 source files differ in four specific ways from JUnit 3 source files.
Your program must read in the text of a JUnit 4 source file and output a valid JUnit 3 source file.  
The name of the file to read is obtained from the command line,
e.g.,
  java Converter BankAccountTest.java
The output filename should be the same as the input filename, with the ".java" extension replaced by ".txt".

Here's an example JUnit 4 file and the corresponding JUnit 3 file.

BlueJ 2.5.3 (on the lab workstations) automatically generates JUnit 3 files.
BlueJ 3.0+ generates JUnit 4 files.

The conversion involves four transformations:

1. Delete imports for JUnit4 packages.
2. Add extends junit.framework.TestCase  to the class declaration.
3. Delete annotations  (@Before, @After, @Test)
4. Make each method name begins with "test".

Your solution must be decomposed into appropriate classes using the design principles explained in the textbook. Follow the design process described in chapter 12.

(Note this is a new and original assignment, so you may find it needs additional detail.  Please see the instructor if you
want more explanation.)