JUnit Example (Simple)

We will build a simple class to test (Demo) and a testing environment based on JUnit (TestDemo).

To compile from command line (on linux) use

      javac -classpath './:junit.jar' TestDemo.java
junit.jar file and the present directory are on the classpath.

To run from command line (linux)

      java -classpath './:junit.jar' TestDemo


David Green .
Last modified: Thu Sep 6 13:52:01 CDT 2001