JUnit Interview Questions and Answers
Question: How To Compile a JUnit Test Class?Answer: 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. LoginTest.class The compilation is ok, if you see the LoginTest.class file. |
Is it helpful?
Yes
No
Most helpful rated by users:
- Who Should Use JUnit?
- What is JUnit?
- How To Compile a JUnit Test Class?
- Why Do You Use JUnit to Test Your Code?
- How To Write a Simple JUnit Test Class?