May 10
import org.junit.runners.Suite;@RunWith(Suite.class)
@Suite.SuiteClasses(
{ComplexMoneyTest.class,
MoneyTest.class}
)
public class AllTests {
}
Test Driven Development with JUnit 4.0 - week 2 activity 1
The first activity for this week is to create a test suite which will allow us to run all our unit tests together. JUnit 4.0 has an annotation @RunWith which let's us define a class in which we can declare all the test suites which willbe run when we run that test class.
I ceated a simple example for the two test cases which we have.
package practice;
import org.junit.runner.RunWith;import org.junit.runners.Suite;@RunWith(Suite.class)
@Suite.SuiteClasses(
{ComplexMoneyTest.class,
MoneyTest.class}
)
public class AllTests {
}
