public TestPool(String rootTitle) {
tests = new HashMap();
- root = new TestSuite(rootTitle, "-1", 0);
-
+ root = null;
currentTestSuite = root;
}
*/
public void addTestSuite(TestSuite suite) {
- //add as sibling
- currentTestSuite.addTestSuite(suite);
- suite.setParent(currentTestSuite);
-
- currentTestSuite = suite;
+
+ if(root == null) {
+ root = suite;
+ }
+ else {
+
+ //add as sibling
+ currentTestSuite.addTestSuite(suite);
+ suite.setParent(currentTestSuite);
+
+ }
+
+ currentTestSuite = suite;
}
/**
}
- private int countSuiteExpectedTests(TestSuite suite) {
-
- int total = 0;
-
- total += suite.getNumTestCasesExpected();
-
- for(int i = 0; i < suite.getTestSuites().size(); i++)
- total += countSuiteExpectedTests((TestSuite) suite.getTestSuites().elementAt(i));
-
- return total;
-
- }
public int getNumTestsOverall() {
- return countSuiteExpectedTests(root);
+ int total = root.getNumTestCasesExpected();
+ System.out.println("total: " + total);
+ return total;
}
int total = 0;
- Iterator i = tests.keySet().iterator();
- String key = "";
- while (i.hasNext()) {
-
-
- key = (String) i.next();
- TestCase element = (TestCase) tests.get(key);
-
-
- if(element.isFailure())
- total++;
-
- }
+// Iterator i = tests.keySet().iterator();
+// String key = "";
+// while (i.hasNext()) {
+//
+//
+// key = (String) i.next();
+// TestCase element = (TestCase) tests.get(key);
+//
+//
+// if(element.isFailure())
+// total++;
+//
+// }
return total;
}