How To Compile a JUnit Test Class


How To Compile a JUnit Test Class?

✍: Guest


Compiling a JUnit test class is like compiling any other Java classes. The only thing you need watch out is that the JUnit JAR file must be included in the classpath. For example, to compile the test class described previously, you should do this:

javac -cp junit-4.4.jar

dir HelloTest.* 
   453 HelloTest.class

The compilation is ok, if you see the HelloTest.class file.

2008-01-11, 7125👍, 0💬