Committing patch from grEvenX to fix bug #1839622 RSE Path error
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / testpool / TestCase.java
index 5d5891a..3456c37 100644 (file)
@@ -1,47 +1,42 @@
-/*
- * Created on Jul 31, 2004
+/*************************************************************************
+ * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
  *
- * To change the template for this generated file go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package net.sourceforge.phpeclipse.phpunit.testpool;
+ * Plugin for PHP unit Testing.
+ * www.phpeclipse.de
+ * 
+ *************************************************************************/
 
+package net.sourceforge.phpeclipse.phpunit.testpool;
 
-/**
- * @author Ali Echihabi
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
 public class TestCase {
 
        public static final String PASS = "PASS";
+
        public static final String FAIL = "FAIL";
-       public static final String ERROR = "ERROR";
 
+       public static final String ERROR = "ERROR";
 
        private TestSuite parentSuite;
+
        private String testName;
+
        private String testID;
+
        private String verdict;
+
        private String parentTestSuiteName;
-       
-       
-       
 
        /**
         * @param testName
         * @param testID
         */
        public TestCase(String testID, String testName, String parentTestSuiteName) {
-               
+
                this.testName = testName;
                this.testID = testID;
                this.parentTestSuiteName = parentTestSuiteName;
        }
 
-
-
        /**
         * @return
         */
@@ -68,10 +63,8 @@ public class TestCase {
         */
        public void setTestID(String string) {
                testID = string;
-               
-       }
-
 
+       }
 
        /**
         * @param string
@@ -85,7 +78,12 @@ public class TestCase {
         */
        public void setVerdict(String string) {
                verdict = string;
-               
+
+               if (isFailure())
+                       parentSuite.setHasFailure();
+               if (isError())
+                       parentSuite.setHasError();
+
        }
 
        /**
@@ -94,14 +92,14 @@ public class TestCase {
        public void setParentSuite(TestSuite suite) {
                this.parentSuite = suite;
                suite.setName(parentTestSuiteName);
-               
+
        }
 
        /**
         * @return
         */
        public Object getParentSuite() {
-               
+
                return parentSuite;
        }
 
@@ -109,7 +107,7 @@ public class TestCase {
         * @return
         */
        public boolean isError() {
-               
+
                return getVerdict().equals(TestCase.ERROR);
        }
 
@@ -117,16 +115,16 @@ public class TestCase {
         * @return
         */
        public boolean isFailure() {
-               
+
                return getVerdict().equals(TestCase.FAIL);
-               
+
        }
 
        /**
         * @return
         */
        public boolean isPass() {
-               
+
                return getVerdict().equals(TestCase.PASS);
 
        }