| junitx.ddtunit.DDTTestCase
All known Subclasses: junitx.ddtunit.SpecificationAssertTest, junitx.ddtunit.functest.ProcessMapTypeTest, junitx.ddtunit.functest.ProcessObjectReferenceTest, junitx.ddtunit.functest.ProcessConstructorValuesTest, junitx.ddtunit.usecases.UserBeanTest, junitx.ddtunit.functest.ProcessGenericValuesTest, junitx.ddtunit.functest.ProcessComparableDataTest, junitx.ddtunit.functest.ProcessCollectionTypeTest, junitx.ddtunit.functest.ProcessDateDataTest, junitx.ddtunit.data.db.DbRepositoryAccessTest, junitx.ddtunit.functest.ProcessMethodCallValuesTest, junitx.ddtunit.ActualTest, junitx.ddtunit.functest.CollectionContainerModifierTest, junitx.ddtunit.functest.ProcessStringDataTest, junitx.ddtunit.functest.ProcessBeansValuesTest, junitx.ddtunit.SimpleDDTUnitTest, junitx.ddtunit.functest.ProcessSetTypeTest, junitx.ddtunit.data.ObjectAsserterTest, junitx.ddtunit.functest.ProcessConstantValuesTest, junitx.ddtunit.functest.ProcessArrayDataTest, junitx.ddtunit.data.processing.TypeAbbreviatorTest, junitx.ddtunit.XmlEntityResourceTest, junitx.ddtunit.data.processing.ProcessClassGlobalObjectsTest, junitx.ddtunit.XmlEntityTest, junitx.ddtunit.functest.ProcessExpectedExceptionTest, junitx.ddtunit.data.VerifyTestOrderExecutionTest,
DDTTestCase | abstract public class DDTTestCase extends TestCase (Code) | | This class is derived from
TestCase from JUnit. It will
implement all neccessary features to run tests based on xml parameter data.
author: jg |
Method Summary | |
protected void | addObjectToAssert(String assertId, Object object) | protected void | assertObject(String assertId, Object obj) Directly assert expected against actual object during method execution. | protected void | assertObject(String assertId, Object obj, boolean mark) Directly assert expected against actual object during method execution. | public int | countMethodTests() Count number of test datasets provided for method methodName. | protected Object | getGlobalObject(String objectId) Retrieve object with specified identifier on a per class basis. | protected Object | getGlobalObject(String objectId, String objectType) Retrieve object with specified identifier on a per class basis. | protected Object | getObject(String objectId) Retrieve object with specified identifier on a per method-test basis. | protected Object | getObject(String objectId, String objectType) Retrieve object with specified identifier on a per method-test basis. | protected Object | getResourceObject(String objectId) Retrieve object with specified identifier on class independend basis. | protected Object | getResourceObject(String objectId, String objectType) Retrieve object with specified identifier on class independend basis. | public String | getTestName() | abstract protected void | initContext() Implement method for initializing test context. | protected void | initTestData(String classId) Initialize xml test data for specified classId in resource associagted to
same name as classId using
ResourceNameFactory . | protected void | initTestData(String resource, String classId) | public TestResult | run() Run complete selected testmethod by generating a separate result und
return this after execution. | public void | run(TestResult result) Run complete selected testmethod by generating a separate result und
return this after execution. | public void | runBare() Run a bare method cycle as defined in JUnit. | public String | runInfo() | protected void | runMethodTest() Execute the testmethod without extra setUp and tearDown methods and no
hooks to TestListener classes like TestRunner. | protected void | runTest() Do not use this method to define tests. | public void | setTestName(String testName) | protected void | validateAsserts(boolean assertSupport) Validate all assertions concerning the active method-test dataset. |
DDTTestCase | public DDTTestCase()(Code) | | |
DDTTestCase | public DDTTestCase(String name)(Code) | | Parameters: name - of testmethod to execute |
addObjectToAssert | protected void addObjectToAssert(String assertId, Object object)(Code) | | Add object to make assertion against assert definition identified by
assertId
Parameters: assertId - to identify assert Parameters: object - used as actual object against expected object defined inassertion |
assertObject | protected void assertObject(String assertId, Object obj)(Code) | | Directly assert expected against actual object during method execution.
Do not wait till the end of test execution.
Parameters: assertId - to retrieve expected assert Parameters: obj - to assert against expected value |
assertObject | protected void assertObject(String assertId, Object obj, boolean mark)(Code) | | Directly assert expected against actual object during method execution.
Do not wait till the end of test execution.
Parameters: assertId - to retrieve expected assert Parameters: obj - to assert against expected value Parameters: mark - true if validation should be marked as executed |
countMethodTests | public int countMethodTests()(Code) | | Count number of test datasets provided for method methodName. If
dataset for this method is null, 1 will be returned (a standard JUnit
method)
Count of tests under method methodName |
getGlobalObject | protected Object getGlobalObject(String objectId)(Code) | | Retrieve object with specified identifier on a per class basis. If
no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
getGlobalObject | protected Object getGlobalObject(String objectId, String objectType)(Code) | | Retrieve object with specified identifier on a per class basis. If
no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
getObject | protected Object getObject(String objectId)(Code) | | Retrieve object with specified identifier on a per method-test basis.
If no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
getObject | protected Object getObject(String objectId, String objectType)(Code) | | Retrieve object with specified identifier on a per method-test basis.
If no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
getResourceObject | protected Object getResourceObject(String objectId)(Code) | | Retrieve object with specified identifier on class independend basis.
If no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
getResourceObject | protected Object getResourceObject(String objectId, String objectType)(Code) | | Retrieve object with specified identifier on class independend basis.
If no data exists an exception will be raised.
Parameters: objectId - specifies key for retrieval Object that is stored under identifier key |
initContext | abstract protected void initContext()(Code) | | Implement method for initializing test context. Especially retrieving
test data resource. The easies way to do this is just to use the
following code snipplet:
void initContext() {
initTestData("/mySpecialResource.xml", "ClassIdInResourceToUse");
}
|
initTestData | protected void initTestData(String classId)(Code) | | Initialize xml test data for specified classId in resource associagted to
same name as classId using
ResourceNameFactory .
Parameters: resource - of xml based test data |
initTestData | protected void initTestData(String resource, String classId)(Code) | | Initialize xml test data for specified classId in resource
Parameters: resource - of xml based test data Parameters: classId - of test data to process |
run | public TestResult run()(Code) | | Run complete selected testmethod by generating a separate result und
return this after execution. This contains all notification hooks to
TestListener classes like TestRunner.
result of executed test |
run | public void run(TestResult result)(Code) | | Run complete selected testmethod by generating a separate result und
return this after execution. This contains all notification hooks to
TestListener classes like TestRunner.
Parameters: result - object generated externally, by a testrunner e.g.. |
runBare | public void runBare() throws Throwable(Code) | | Run a bare method cycle as defined in JUnit. Here the testdata
initialization is performed. Because every testmethod should be run under
its own fixture the execution of setUp and tearDown is inside of a
subroutine. These methods will be executed inside of around every test
representation of xml testdata definition.
throws: Throwable - that might come up during testmethod execution. |
runInfo | public String runInfo()(Code) | | Information about actual run test |
runMethodTest | protected void runMethodTest() throws Throwable(Code) | | Execute the testmethod without extra setUp and tearDown methods and no
hooks to TestListener classes like TestRunner. This method contains
the iteration over the xml defined tests per method.
throws: Throwable - on any exception that occures |
runTest | protected void runTest()(Code) | | Do not use this method to define tests. Use test<name>()
instead.
|
validateAsserts | protected void validateAsserts(boolean assertSupport)(Code) | | Validate all assertions concerning the active method-test dataset. All
asserts that are not marked as allready processed are validated and
marked as processed.
|
|
|