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 Vector testCases; // current or actual.
22 private Vector testSuites; // current or actual.
25 private int numTestCasesExpected; //expected
26 private int numTestCasesRunSoFar;
34 public TestSuite(String name, String testID, int testCount) {
39 this.numTestCasesExpected = testCount;
41 testCases = new Vector();
42 testSuites = new Vector();
51 public TestSuite(TestSuite parent, String name, String testID, int testCount) {
56 this.numTestCasesExpected = testCount;
58 testCases = new Vector();
59 testSuites = new Vector();
62 public void addTestCase(TestCase test) {
63 testCases.addElement(test);
64 test.setParentSuite(this);
65 numTestCasesRunSoFar++;
68 public void removeTestCase(TestCase test) {}
70 public boolean contains(TestCase test) {
76 public String toString() {
82 for(int i = 0; i < testCases.size(); i++) {
84 tc = (TestCase) testCases.elementAt(i);
85 string += " - " + tc.getTestID() + ", " + tc.getTestName() + "\n";
90 for(int i = 0; i < testSuites.size(); i++)
91 string += ((TestSuite) testSuites.elementAt(i)).toString();
93 //print its own test suites.
100 public String getId() {
107 public String getName() {
114 public int getNumTestCasesExpected() {
115 return numTestCasesExpected;
121 public void setId(String string) {
128 public void setName(String string) {
135 public void setNumTestCasesExpected(int i) {
136 numTestCasesExpected = i;
142 public void addTestSuite(TestSuite suite) {
143 testSuites.addElement(suite);
150 public boolean isFinished() {
152 return numTestCasesRunSoFar >= numTestCasesExpected;
159 public TestSuite getParent() {
166 public void setParent(TestSuite suite) {
173 public int getNumTestCases() {
175 return testCases.size();
181 public Vector getTestCases() {
188 public Vector getTestSuites() {
195 public void setTestCases(Vector vector) {
202 public void setTestSuites(Vector vector) {