01: package org.jzonic.webtester;
02:
03: import java.util.List;
04: import java.util.Vector;
05:
06: /**
07: * The WebTestSuite is a set of WebTests.
08: *
09: * @author Mecky
10: */
11: public class WebTestSuite {
12:
13: private List webTests;
14: private String suiteName;
15:
16: public WebTestSuite(String suiteName) {
17: this .suiteName = suiteName;
18: webTests = new Vector();
19: }
20:
21: /**
22: * Adds a testcase to the testsuite
23: *
24: * @param webTest a testcase
25: */
26: public void addWebTest(WebTester webTest) {
27: webTests.add(webTest);
28: }
29:
30: /**
31: * Runs the entire testsuite. All testcases are executed
32: * in the same order they were added to the testsuite.
33: * If one of the testcases will fail the testsuite continues
34: * with the next testcase
35: *
36: * @return
37: */
38: public WebTestSuiteResult runTestSuite() {
39: WebTestSuiteResult results = new WebTestSuiteResult(suiteName);
40: for (int i = 0; i < webTests.size(); i++) {
41: WebTester tester = (WebTester) webTests.get(i);
42: WebTestResult res = tester.runTest();
43: results.addTestResult(res);
44: }
45: return results;
46: }
47: }
|