|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
junit.framework.ForTestCase
public class ForTestCase
This utility class extends the junit class TestCase to manage execution of tests based on JTestCase xml data.
Constructor Summary | |
---|---|
ForTestCase(java.lang.String name,
java.lang.String file)
Constructed from full file name and class name. |
Method Summary | |
---|---|
void |
assertTestCase(java.lang.String name,
java.lang.Object Value)
Assert a testcase given a param to read in JTestCase, the value to compare for the current index |
void |
assertTestCase(java.lang.String name,
java.lang.Object Value,
int index)
Assert a testcase given a param to read in JTestCase, the value to compare and testcase index |
int |
countTestCases()
Counts the number of test cases executed by run(TestResult result). |
java.lang.String |
getdataFile()
Gets the dataFile of a JTestCase |
java.lang.Object |
getGlobalParameters(java.lang.String name)
Gets the value of a global parameter of a JTestCase |
java.util.Vector |
getTestCase()
Gets the name of a JTestCase |
java.lang.String |
getTestCaseName()
Gets the name of a JTestCase testcase for the current index |
java.lang.String |
getTestCaseName(int index)
Gets the name of a JTestCase testcase for an index |
java.lang.Object |
getTestCaseParams(java.lang.String name)
Gets the value of a parameter of a JTestCase testcase for the current index |
java.lang.Object |
getTestCaseParams(java.lang.String name,
int index)
Gets the value of a parameter of a JTestCase testcase for an index |
boolean |
mustFail()
Gets the dataFile of a JTestCase |
void |
run(junit.framework.TestResult tr)
Runs the test case and collects the results in TestResult. |
void |
setdataFile(java.lang.String file)
Sets the dataFile of a JTestCase |
void |
setMustFail(boolean b)
Sets if the test must fail |
java.lang.String |
toString()
Returns a string representation of the test case |
Methods inherited from class junit.framework.TestCase |
---|
getName, run, runBare, setName |
Methods inherited from class junit.framework.Assert |
---|
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ForTestCase(java.lang.String name, java.lang.String file)
name
- - name of test program. Is defined in data file in /tests/class@namefile
- - name of data file. Will be searched by absolute path first. If not found,
then will be searched based on classpath.Method Detail |
---|
public java.lang.String toString()
toString
in class junit.framework.TestCase
public java.util.Vector getTestCase() throws java.lang.Exception
java.lang.Exception
public java.lang.String getdataFile()
public void setdataFile(java.lang.String file)
file
- The name to setpublic boolean mustFail()
public void setMustFail(boolean b)
b
- booleanpublic java.lang.Object getGlobalParameters(java.lang.String name)
name
- The name of the global parameter
public java.lang.Object getTestCaseParams(java.lang.String name, int index) throws java.lang.Exception
name
- The name of the parameterindex
- Index of the testcase
java.lang.Exception
public java.lang.Object getTestCaseParams(java.lang.String name) throws java.lang.Exception
name
- The name of the parameter
java.lang.Exception
public java.lang.String getTestCaseName(int index) throws java.lang.Exception
index
- Index of the testcase
java.lang.Exception
public java.lang.String getTestCaseName() throws java.lang.Exception
java.lang.Exception
public int countTestCases()
countTestCases
in interface junit.framework.Test
countTestCases
in class junit.framework.TestCase
public void assertTestCase(java.lang.String name, java.lang.Object Value, int index) throws java.lang.Exception
name
- The name of the parameterValue
- The value to compareindex
- Index of the testcase
java.lang.Exception
public void assertTestCase(java.lang.String name, java.lang.Object Value) throws java.lang.Exception
name
- The name of the parameterValue
- The value to compare
java.lang.Exception
public void run(junit.framework.TestResult tr)
run
in interface junit.framework.Test
run
in class junit.framework.TestCase
tr
- the test result
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |