JUnit Interview Questions and Answers
Question: How To Run a JUnit Test Class?Answer: A JUnit test class usually contains a number of test methods. You can run all test methods in a JUnit test class with the JUnitCore runner class. For example, to run the test class LoginTest.java described previously, you should do this:java -cp .; junit-4.4.jar org.junit.runner.JUnitCore LoginTest JUnit version 4.4 Time: 0.015 OK (1 test) This output says that 1 tests performed and passed. The same you can perform by executing build.xml also. |
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?