1 /*************************************************************************
2 * @author Ali Echihabi (ali_echihabi@ieee.org, ali.echihabi@souss.ca)
4 * Plugin for PHP unit Testing.
7 *************************************************************************/
9 package net.sourceforge.phpeclipse.phpunit.testpool;
11 public class TestCase {
13 public static final String PASS = "PASS";
15 public static final String FAIL = "FAIL";
17 public static final String ERROR = "ERROR";
19 private TestSuite parentSuite;
21 private String testName;
23 private String testID;
25 private String verdict;
27 private String parentTestSuiteName;
33 public TestCase(String testID, String testName, String parentTestSuiteName) {
35 this.testName = testName;
37 this.parentTestSuiteName = parentTestSuiteName;
43 public String getTestID() {
50 public String getTestName() {
57 public String getVerdict() {
64 public void setTestID(String string) {
72 public void setTestName(String string) {
79 public void setVerdict(String string) {
83 parentSuite.setHasFailure();
85 parentSuite.setHasError();
92 public void setParentSuite(TestSuite suite) {
93 this.parentSuite = suite;
94 suite.setName(parentTestSuiteName);
101 public Object getParentSuite() {
109 public boolean isError() {
111 return getVerdict().equals(TestCase.ERROR);
117 public boolean isFailure() {
119 return getVerdict().equals(TestCase.FAIL);
126 public boolean isPass() {
128 return getVerdict().equals(TestCase.PASS);