2 Minutes To Code (β Version)

JUnit 4.10 - 2 minute tutorial

How to test multiple classes aka suite

To test multiple classes, use Suite as shown in the example below.

Annotate a class( say TestSuite ) with org.junit.runners.RunWith and org.junit.runners.Suite.SuiteClasses. Provide the name of all the classes to be tested to the Suite.SuiteClasses annotation and then run the class TestSuite with JUnitCore.runClasses() as shown in the previous example.
package com.techfundaes.junit4Bag;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;

@Suite.SuiteClasses({ TestBasic.class, TestException.class, TestTimeout.class })
public class TestSuite