What Is JUnit TestSuite?


What Is JUnit TestSuite?

✍: FYICenter.com QA Team


JUnit TestSuite is a container class, junit.framework.TestSuite, used in JUnit 3.8 that allows you to group multiple test cases into a collection and run them together. TestSuite class is no longer supported in JUnit 4.4.

Each test runs in its own fixture so there can be no side effects among test runs. Here is an example:

import junit.framework.*;
// by FYICenter.com
public class RunTestSuite {
    public static void main(String[] a) {
        TestSuite suite = new TestSuite(MathTest.class);
	TestResult result = new TestResult();
        System.out.println("Was it successful? "
        System.out.println("How many tests were there? "

2008-03-04, 5483👍, 0💬