KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > junitx > framework > OrderedTestSuiteTest


1 package junitx.framework;
2
3 import junit.framework.TestCase;
4
5 public class OrderedTestSuiteTest
6         extends TestCase {
7
8     public OrderedTestSuiteTest(String JavaDoc name) {
9         super(name);
10     }
11
12     public void testClassConstructor1() {
13         OrderedTestSuite suite = new OrderedTestSuite(ClassDefinition1.class);
14         assertEquals(3, suite.countTestCases());
15         assertEquals("testA(junitx.framework.OrderedTestSuiteTest$ClassDefinition1)", suite.testAt(0).toString());
16         assertEquals("testB(junitx.framework.OrderedTestSuiteTest$ClassDefinition1)", suite.testAt(1).toString());
17         assertEquals("testC(junitx.framework.OrderedTestSuiteTest$ClassDefinition1)", suite.testAt(2).toString());
18     }
19
20     public void testClassConstructor2() {
21         OrderedTestSuite suite = new OrderedTestSuite(ClassDefinition2.class);
22         assertEquals(3, suite.countTestCases());
23         assertEquals("testA(junitx.framework.OrderedTestSuiteTest$ClassDefinition2)", suite.testAt(0).toString());
24         assertEquals("testB(junitx.framework.OrderedTestSuiteTest$ClassDefinition2)", suite.testAt(1).toString());
25         assertEquals("testC(junitx.framework.OrderedTestSuiteTest$ClassDefinition2)", suite.testAt(2).toString());
26     }
27
28     public void testClassConstructor3() {
29         OrderedTestSuite suite = new OrderedTestSuite(ClassDefinition3.class);
30         assertEquals(3, suite.countTestCases());
31         assertEquals("testA(junitx.framework.OrderedTestSuiteTest$ClassDefinition3)", suite.testAt(0).toString());
32         assertEquals("testB(junitx.framework.OrderedTestSuiteTest$ClassDefinition3)", suite.testAt(1).toString());
33         assertEquals("testC(junitx.framework.OrderedTestSuiteTest$ClassDefinition3)", suite.testAt(2).toString());
34     }
35
36     public static class ClassDefinition1
37             extends TestCase {
38
39         public ClassDefinition1(String JavaDoc name) {
40             super(name);
41         }
42
43         public void testC() {
44         }
45
46         public void testA() {
47         }
48
49         public void testB() {
50         }
51     }
52
53     public static class ClassDefinition2
54             extends TestCase {
55
56         public ClassDefinition2(String JavaDoc name) {
57             super(name);
58         }
59
60         public void testC() {
61         }
62
63         public void testB() {
64         }
65
66         public void testA() {
67         }
68     }
69
70     public static class ClassDefinition3
71             extends TestCase {
72
73         public ClassDefinition3(String JavaDoc name) {
74             super(name);
75         }
76
77         public void testB() {
78         }
79
80         public void testC() {
81         }
82
83         public void testA() {
84         }
85
86     }
87
88 }
89
Popular Tags