1 import java.util.ArrayList;
2 import java.util.List;
3
4 public abstract class TestSuite
5 {
6 public abstract TestCase[] getTestCases();
7
8 public List<TestResult> run()
9 {
10 TestCase[] testCases = getTestCases();
11 List<TestResult> results = new ArrayList<>();
12 for (TestCase t : testCases)
13 {
14 try
15 {
16 t.execute();
17 results.add(new TestResult(t));
18 }
19 catch (Exception ex)
20 {
21 results.add(new TestResult(t, ex));
22 }
23 }
24 return results;
25 }
26 }