Junit Interview Question Answer Part 2

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 HelloTest.java described previously, you should do this: javac -cp junit-4.4.jar HelloTest.java

dir HelloTest.*
453 HelloTest.class
183 HelloTest.java The compilation is ok, if you see the HelloTest.class file..
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 HelloTest.java described previously, you should do this:

java -cp .;
junit-4.4.jar org.junit.runner.JUnitCore HelloTest

JUnit version 4.4

. Time: 0.015

OK (1 test)
This output says that 1 tests performed and passed.
It’shich makes the resence of Java runtime system.
Some Interpreted, Multi-threaded
Java uses e sent directly to the processor.
Java is a high-level ms Mac OS, and the various versions of UNIX.
Java runs on ux like HP-Unix, Sun Solaris, Redhat Linux, Ubuntu, CentOS, etc.