commented out code responsible for exceptions. now showing correct suite names and...
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / testpool / TestCase.java
1 /*
2  * Created on Jul 31, 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */
7 package net.sourceforge.phpeclipse.phpunit.testpool;
8
9
10 /**
11  * @author Ali Echihabi
12  *
13  * To change the template for this generated type comment go to
14  * Window>Preferences>Java>Code Generation>Code and Comments
15  */
16 public class TestCase {
17
18         public static final String PASS = "PASS";
19         public static final String FAIL = "FAIL";
20         public static final String ERROR = "ERROR";
21
22
23         private TestSuite parentSuite;
24         private String testName;
25         private String testID;
26         private String verdict;
27         private String parentTestSuiteName;
28         
29         
30         
31
32         /**
33          * @param testName
34          * @param testID
35          */
36         public TestCase(String testID, String testName, String parentTestSuiteName) {
37                 
38                 this.testName = testName;
39                 this.testID = testID;
40                 this.parentTestSuiteName = parentTestSuiteName;
41         }
42
43
44
45         /**
46          * @return
47          */
48         public String getTestID() {
49                 return testID;
50         }
51
52         /**
53          * @return
54          */
55         public String getTestName() {
56                 return testName;
57         }
58
59         /**
60          * @return
61          */
62         public String getVerdict() {
63                 return verdict;
64         }
65
66         /**
67          * @param string
68          */
69         public void setTestID(String string) {
70                 testID = string;
71                 
72         }
73
74
75
76         /**
77          * @param string
78          */
79         public void setTestName(String string) {
80                 testName = string;
81         }
82
83         /**
84          * @param string
85          */
86         public void setVerdict(String string) {
87                 verdict = string;
88                 
89         }
90
91         /**
92          * @param suite
93          */
94         public void setParentSuite(TestSuite suite) {
95                 this.parentSuite = suite;
96                 suite.setName(parentTestSuiteName);
97                 
98         }
99
100         /**
101          * @return
102          */
103         public Object getParentSuite() {
104                 
105                 return parentSuite;
106         }
107
108         /**
109          * @return
110          */
111         public boolean isError() {
112                 
113                 return getVerdict().equals(TestCase.ERROR);
114         }
115
116         /**
117          * @return
118          */
119         public boolean isFailure() {
120                 
121                 return getVerdict().equals(TestCase.FAIL);
122                 
123         }
124
125         /**
126          * @return
127          */
128         public boolean isPass() {
129                 
130                 return getVerdict().equals(TestCase.PASS);
131
132         }
133
134 }