2 * Created on Jul 31, 2004
4 * To change the template for this generated file go to
5 * Window>Preferences>Java>Code Generation>Code and Comments
7 package net.sourceforge.phpeclipse.phpunit.testpool;
9 import java.util.Vector;
12 * @author Ali Echihabi
14 * To change the template for this generated type comment go to
15 * Window>Preferences>Java>Code Generation>Code and Comments
17 public class TestSuite {
21 private boolean hasFailure;
22 private boolean isAllPass;
23 private boolean hasError;
24 private Vector testCases; // current or actual.
25 private Vector testSuites; // current or actual.
28 private int numTestCasesExpected; //expected
29 private int numTestCasesRunSoFar;
39 public TestSuite(TestSuite parent, String name, String testID, int testCount) {
44 this.numTestCasesExpected = testCount;
46 testCases = new Vector();
47 testSuites = new Vector();
54 public void addTestCase(TestCase test) {
55 testCases.addElement(test);
56 test.setParentSuite(this);
57 numTestCasesRunSoFar++;
60 public void removeTestCase(TestCase test) {}
62 public boolean contains(TestCase test) {
68 public String toString() {
74 for(int i = 0; i < testCases.size(); i++) {
76 tc = (TestCase) testCases.elementAt(i);
77 string += " - " + tc.getTestID() + ", " + tc.getTestName() + "\n";
82 for(int i = 0; i < testSuites.size(); i++)
83 string += ((TestSuite) testSuites.elementAt(i)).toString();
85 //print its own test suites.
92 public String getId() {
99 public String getName() {
106 public int getNumTestCasesExpected() {
107 return numTestCasesExpected;
113 public void setId(String string) {
120 public void setName(String string) {
127 public void setNumTestCasesExpected(int i) {
128 numTestCasesExpected = i;
134 public void addTestSuite(TestSuite suite) {
135 testSuites.addElement(suite);
142 public boolean isFinished() {
144 return numTestCasesRunSoFar >= numTestCasesExpected;
151 public TestSuite getParent() {
158 public void setParent(TestSuite suite) {
165 public int getNumTestCases() {
167 return testCases.size();
173 public Vector getTestCases() {
180 public Vector getTestSuites() {
187 public void setTestCases(Vector vector) {
194 public void setTestSuites(Vector vector) {
201 public boolean hasError() {
207 public void setHasError() {
215 parent.setHasError();
222 public boolean hasFailure() {
228 public void setHasFailure() {
236 parent.setHasFailure();
240 public boolean isAllPass() {
242 return !hasError() && !hasFailure();