Runner
Runner
Test runner is used for executing the test cases. Here is an example that assumes
the test class TestJunit already exists.
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
System.out.println(result.wasSuccessful());
}
}
JUnit Classes
JUnit classes are important classes, used in writing and testing JUnits. Some of the
important classes are −
Assert − Contains a set of assert methods.
TestCase − Contains a test case that defines the fixture to run multiple tests.
TestResult − Contains methods to collect the results of executing a test
case.