This module represents the link between the generic infrastructure contained in dh-core and the familar JUnit3 library, allowing to turn the usual unit test programming in a DuckHawk TestExecutor factory and runner.
The following diagram shows the general architecture:

The module provides three base classes that can be used according to the desired test setup.
- ConformanceTest will turn each
testXXXmethod into a TestExecutor that will be run by aConformanceRunner - PerformanceTest will do the same, but will run in performance mode
- StressTest will create multiple instances of the test class, all running the same test method.
There are three key elements to understand:
- JUnit runners are starting the tests, and the DuckHawk integration turns a normal test method invocation into a TestRunner invocation. This means that you can use whatever tool you want to run a test suite, and the result will be that you'll be running a set of DuckHawk tests
TestExecutor.run(...)will run the currenttestXXXmethod. What about the untimedTestExecutor.check(...)? The DuckHawk integration will search for acheckXXXmethod, if it finds one, that will be run as the check part after invokingtextXXX. This means whatever result needs to be checked in thecheckXXXmethod will have to be passed around as a field of the class.- JUnit3 methods have a very strict structure, they have to be public, start with
testand have no arguments. This means the single call properties cannot be provided as parameters. This is circumvented by using the base classpropertiesfield, that can be altered in order to return properties out of the test. Also, if the test needs to enter values into the test wide properties map, it can implement ainitXXX(TestProperties properties)that will be called with the test properties. Finally, the environment properties provided by theTestContextare made available using the methodgetEnvironment(property).
To sum up, a single test can be pushed so far as to become a three methods set using properties as follows:
Labels