01: /*
02: * JUnitTest.java
03: *
04: * Created on February 3, 2005, 2:37 PM
05: */
06:
07: package org.netbeans.jemmy.testing.junit;
08:
09: import org.netbeans.jemmy.Test;
10:
11: /**
12: *
13: * @author shura
14: */
15: public class JUnitTest extends junit.framework.TestCase {
16: private static final String[] ALL_TESTS = { "001", "002", "003",
17: "004", "005", "006", "007", "008", "009", "010", "011",
18: "012", "013", "014", "015", "016", "017", "018", "019",
19: "020", "021", "022", "023", "024", "025", "026", "027",
20: "028", "029", "030", "031", "032", "033", "034", "035",
21: "036", "037", "038", "039", "040", "041", "042", "043",
22: "044", "045", "046", "047", "048" };
23: private static final String[] MAC_TESTS = { "001", "002", "003",
24: "004", "005", "006", "007", "011", "012", "013", "014",
25: "016", "017", "018", "019", "020", "021", "022", "023",
26: "024", "025", "027", "028", "029", "031", "032", "033",
27: "034", "037", "038", "039", "040", "041", "042", "043",
28: "044", "045", "046", "047", "048" };
29: private static final String[] SOL_TESTS = { "001", "002", "003",
30: "004", "005", "006", "007", "011", "012", "013", "014",
31: "016", "017", "018", "019", "020", "021", "022", "023",
32: "024", "025", "027", "028", "029", "031", "032", "033",
33: "034", "037", "038", "039", "040", "041", "042", "043",
34: "044", "045", "046", "047", "048" };
35: private static final String[] DBG_TESTS = { "001", "002", "004" };
36:
37: String jemmyTestIndex;
38:
39: /** Creates a new instance of JUnitTest */
40: JUnitTest(String jemmyTestIndex) {
41: this .jemmyTestIndex = jemmyTestIndex;
42: }
43:
44: public void run(junit.framework.TestResult result) {
45: result.startTest(this );
46: String[] args = { "org.netbeans.jemmy.testing.jemmy_"
47: + jemmyTestIndex };
48: Test.run(args);
49: result.endTest(this );
50: }
51:
52: public static junit.framework.TestSuite suite(String index) {
53: junit.framework.TestSuite suite = new junit.framework.TestSuite();
54: suite.addTest(new JUnitTest(index));
55: return (suite);
56: }
57:
58: public static junit.framework.TestSuite suite() {
59: junit.framework.TestSuite suite = new junit.framework.TestSuite();
60: String[] tests = DBG_TESTS;
61: if (System.getProperty("os.name").startsWith("Mac OS")) {
62: tests = MAC_TESTS;
63: } else if (System.getProperty("os.name").startsWith("SunOS")) {
64: tests = SOL_TESTS;
65: }
66: for (int i = 0; i < tests.length; i++) {
67: suite.addTest(new JUnitTest(tests[i]));
68: }
69: return (suite);
70: }
71: }
|