|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jtestcase.TestCaseInstance
public class TestCaseInstance
Object that holds the unique identifier for a test case in the sense of JTestCase. The test case can be described by the method name and the test case name.
Constructor Summary | |
---|---|
TestCaseInstance(java.lang.String method,
java.lang.String testcase,
JTestCase jtestcase)
Constructor with initialization of the member variables. |
Method Summary | |
---|---|
boolean |
assertTestVariable(java.lang.String varName,
java.lang.Object varValue)
Asserts a given varible's value against its expected value by using expected action. |
boolean |
equals(TestCaseInstance other)
Test for equality |
java.lang.String |
getFailureReason()
In case of failure, reports the test variables info that caused this test to fail. |
java.lang.String |
getMethod()
Gets the name of the method. |
MultiKeyHashtable |
getTestCaseAssertParams()
Get all assert params for a given method and its test case value into Hashtable. |
MultiKeyHashtable |
getTestCaseAssertValues()
Get all assert values for a given method and its test case value into Hashtable. |
java.lang.String |
getTestCaseName()
Gets the name of the testcase. |
java.util.HashMap |
getTestCaseParams()
Get all params for a given TestCaseInstance. |
void |
setFailureReason(java.lang.String failureReason)
Set test case failure Note that setting the test case failure before test failure has no effect. |
void |
setMethod(java.lang.String method)
Sets the method member variable. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TestCaseInstance(java.lang.String method, java.lang.String testcase, JTestCase jtestcase)
Constructor with initialization of the member variables.
A test case instance should not be instantiated directly. Access TestCaseInstances using the getTestCasesInstancesInMethod() method of JTestCase class.
method
- the name of the methodtestcase
- the name of the testcaseMethod Detail |
---|
public java.lang.String getFailureReason()
public void setFailureReason(java.lang.String failureReason)
public void setMethod(java.lang.String method)
method
- the name of the methodpublic java.lang.String getMethod()
public java.lang.String getTestCaseName()
public boolean equals(TestCaseInstance other)
other
- other JTestCaseIdentifier
public java.util.HashMap getTestCaseParams() throws JTestCaseException
Get all params for a given TestCaseInstance. Hashed key is param's name, value is value of param. This method is normally used with getNameOfTestCases().
HashMap's key is param's name defined in /tests/class/method/params/param@name,
HashMap's value is param's Object value with type as indicated in /test/class/method/params/param@type.
JTestCaseException
- if an internal error occurspublic boolean assertTestVariable(java.lang.String varName, java.lang.Object varValue) throws JTestCaseException
... <asserts> <assert name="var1" action="EQUALS" type="int">100</assert> <assert name="var2" action="NOTNULL"/> </asserts> ...Note: "GT" means "real value" greater than "expected value". Simular to others.
varName
- - name of varible. Defined in data file in /test/class/method/asserts/assert@name.varValue
- - actually value of this varible.
JTestCaseException
- if an internal error occurspublic MultiKeyHashtable getTestCaseAssertParams() throws JTestCaseException
JTestCaseException
- if an internal error occurs
java.io.FileNotFoundException
public MultiKeyHashtable getTestCaseAssertValues() throws JTestCaseException
JTestCaseException
- if an internal error occurs
java.io.FileNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |