Making the plug-in compatible with Java 1.4
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / testpool / TestSuite.java
index 90cea9e..301b9fd 100644 (file)
@@ -6,28 +6,31 @@
  * 
  *************************************************************************/
 
-
 package net.sourceforge.phpeclipse.phpunit.testpool;
 
 import java.util.Vector;
 
-
 public class TestSuite {
 
-
-
        private boolean hasFailure;
+
        private boolean isAllPass;
+
        private boolean hasError;
+
        private Vector testCases; // current or actual.
+
        private Vector testSuites; // current or actual.
+
        private String name;
+
        private String id;
-       private int numTestCasesExpected; //expected
-       private int numTestCasesRunSoFar;
-       TestSuite parent;
 
+       private int numTestCasesExpected; // expected
 
+       private int numTestCasesRunSoFar;
+
+       TestSuite parent;
 
        /**
         * @param name
@@ -35,52 +38,52 @@ public class TestSuite {
         * @param testCount
         */
        public TestSuite(TestSuite parent, String name, String testID, int testCount) {
-               
+
                this.parent = parent;
                this.id = testID;
                this.name = name;
                this.numTestCasesExpected = testCount;
-       
+
                testCases = new Vector();
                testSuites = new Vector();
-               
+
                hasError = false;
                isAllPass = true;
                hasFailure = false;
        }
-                       
+
        public void addTestCase(TestCase test) {
                testCases.addElement(test);
                test.setParentSuite(this);
                numTestCasesRunSoFar++;
        }
-       
-       public void removeTestCase(TestCase test) {}
-       
+
+       public void removeTestCase(TestCase test) {
+       }
+
        public boolean contains(TestCase test) {
-               
+
                return false;
-               
+
        }
-       
+
        public String toString() {
-               
+
                String string = "";
-               
-               //print test cases.
+
+               // print test cases.
                TestCase tc = null;
-               for(int i = 0; i < testCases.size(); i++) {
-                       
+               for (int i = 0; i < testCases.size(); i++) {
+
                        tc = (TestCase) testCases.elementAt(i);
                        string += "  - " + tc.getTestID() + ", " + tc.getTestName() + "\n";
-                       
-                       
+
                }
-               
-               for(int i = 0; i < testSuites.size(); i++) 
+
+               for (int i = 0; i < testSuites.size(); i++)
                        string += ((TestSuite) testSuites.elementAt(i)).toString();
-               
-               //print its own test suites.            
+
+               // print its own test suites.
                return string;
        }
 
@@ -131,16 +134,16 @@ public class TestSuite {
         */
        public void addTestSuite(TestSuite suite) {
                testSuites.addElement(suite);
-               
+
        }
 
        /**
         * @return
         */
        public boolean isFinished() {
-               
+
                return numTestCasesRunSoFar >= numTestCasesExpected;
-               
+
        }
 
        /**
@@ -161,7 +164,7 @@ public class TestSuite {
         * @return
         */
        public int getNumTestCases() {
-               
+
                return testCases.size();
        }
 
@@ -198,46 +201,44 @@ public class TestSuite {
         */
        public boolean hasError() {
 
-               return hasError;                
+               return hasError;
 
        }
-       
+
        public void setHasError() {
-               
-               if(hasError)
+
+               if (hasError)
                        return;
-                       
+
                hasError = true;
-               
-               if(parent != null)
+
+               if (parent != null)
                        parent.setHasError();
        }
 
-
        /**
         * @return
         */
        public boolean hasFailure() {
 
-               return hasFailure;              
+               return hasFailure;
 
        }
-       
+
        public void setHasFailure() {
-               
-               if(hasFailure)
+
+               if (hasFailure)
                        return;
-                       
+
                hasFailure = true;
-               
-               if(parent != null)
+
+               if (parent != null)
                        parent.setHasFailure();
        }
-       
 
        public boolean isAllPass() {
-               
+
                return !hasError() && !hasFailure();
-               
-       }       
+
+       }
 }