1 /*************************************************************************
2 * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
4 * Plugin for PHP unit Testing.
7 *************************************************************************/
10 package net.sourceforge.phpeclipse.phpunit.testpool;
14 public class TestCase {
16 public static final String PASS = "PASS";
17 public static final String FAIL = "FAIL";
18 public static final String ERROR = "ERROR";
21 private TestSuite parentSuite;
22 private String testName;
23 private String testID;
24 private String verdict;
25 private String parentTestSuiteName;
34 public TestCase(String testID, String testName, String parentTestSuiteName) {
36 this.testName = testName;
38 this.parentTestSuiteName = parentTestSuiteName;
46 public String getTestID() {
53 public String getTestName() {
60 public String getVerdict() {
67 public void setTestID(String string) {
77 public void setTestName(String string) {
84 public void setVerdict(String string) {
88 parentSuite.setHasFailure();
90 parentSuite.setHasError();
97 public void setParentSuite(TestSuite suite) {
98 this.parentSuite = suite;
99 suite.setName(parentTestSuiteName);
106 public Object getParentSuite() {
114 public boolean isError() {
116 return getVerdict().equals(TestCase.ERROR);
122 public boolean isFailure() {
124 return getVerdict().equals(TestCase.FAIL);
131 public boolean isPass() {
133 return getVerdict().equals(TestCase.PASS);