This section contains the detail about Combining Test Suites in Test Suite.
Combining Test Suites
We can combine different suites into one suite. We have two different suites , these suites have following classes :
AllTests(Suite)
-
CounterTest
-
MyClassTest
-
PetTest
AllTestsSecond(Suite)
-
ExceptionTest
-
SetUpTest
-
SimpleTest
We have combine these two suites into one as follows :
package devmanuals.junit; import org.junit.runner.RunWith; import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) @SuiteClasses( { AllTests.class, AllTestsSecond.class }) public class MainAllTests { }
The MainAllTests Suite contains two different Suites, i.e Alltests & AllTestsSecond. The Output of this Combine Test is given next :
[ 0 ] Comments