JUnit Interview Questions and Answers
Ques. How To Compile a JUnit Test Class?Ans. As JUnit code is written in java, 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 like junit.jar etc. For example, to compile the test class LoginTest.java described previously, you should do this:
javac -cp junit-4.4.jar LoginTest.java
and it will create .class file.
The compilation is ok, if you see the LoginTest.class file.
Is it helpful? Yes No
Most helpful rated by users: