JUnit README JUnit is a framework for testing Java programs. It works inside or outside Eclipse It is especially good at testing small components, like a class. If you don't like JUnit, you can get some of its benefits by defining a 'static main' for each class, which tests the class. Then you can test that class by simply typing "java theclass.class" to the command line. /home/solaris/ieng9/cs131f/public/TestDemo.java is a sample JUnit test file designed to provide a sample of how to use JUnit to help test your project. Samples for check 2: test_check2_const() test_check2_type() test_check2_var() Sample for check 1: test_check1_a() test_check1_a will need to be uncommented and modified to work with your project. Eclipse ------- Get 'TestDemo.java' from the public dir. Import 'TestDemo.java' into you project. To be able to run JUnit tests you'll first need to add the Junit jar to your project. To add the jar select 'Project' -> 'Properties', then select 'Java Build Path', select the 'Libraries' tab, click 'Add External JARs'. The JUnit jar is located in '/plugins/org.junit_3.8.1/', select the junit.jar and click 'Ok'. On ieng9 unit.jar is here '/acsnfs3/software/eclipse-2.1.2/eclipse/plugins/org.junit_3.8.1/junit.jar'. Now to run the JUnit tests from the menu select 'Run' -> 'Run as' -> 'JUnit Test' and Eclipse will run you JUnit tests. It should pop up a window with the results of the tests. Command Line(UNIX/Linux) ------------------------ First get both the Makefile and TestDemo.java from the class public dir. The make file is set up to run JUnit test on ieng9. The Make file is set up to build and run JUnit tests in both text and swing GUI. Type 'make junitText' or 'junitGUI'. The text version displays results to the console. The swing version will open a GUI to display the results.