Easy-to-use junit based framework for the testing of complex integration scenarios. Using the declarative test plans and automated comparison between current test-snapshots and recorded master-results, it keeps you informed on any suspicious change of system behavior.
Furthermore, the framework enables the "test first" approach, thus developing against pre-defined "target" interface until the replay snapshot matches.
Originally developed for ESB, especially for IBM Message Broker/IBM Integration Bus (used in examples), but can be used for any integration platform.
- declarative
test-plan
concept, see details - separation of
test-plan
andconnector configuration
concept, see details - extendable connector/plugin architecture
Record
/Replay with post Assertion
ModesMQGET
/MQPUT
,DBGET
/DBPUT
,HTTPGET
,SCPPUT
connectors availableHTTP
-GET
/PUT
/POST
/DELETE
also for HTTPSDB
,File
,XMLUnit
assertion plugins- regression testing and continuous integration, including surefire reports
Basic understanding of following Java frameworks:
- Maven - used for build and configuration of runtime and used in example for test project.
- Junit - used as test starter
- XMLUnit - used for assertions
*To run the sample ESB project you will need the basic IBM Integration Bus know-how for import and deployment.
According to the maven conventions the following folders of your test.project are important:
src/test/resources/
- location of the test planssrc/test/java/
- location of the junit test runner
Junit serves as glue and looks for the test plan with the same name starting its execution from the root folder. Dependent on mode record/replay it keeps the test outputs in xml format and starts the preconfigured assertions between the recorded and replayed payloads, writing the test protocol to the console.
For the complete understanding including junit starter and project layout, please refer to basic execution flow
- The test plans are folders stored under
src/test/resources/
and must have the same arbitrary name as corresponding junit starter, i.e.SplitCustomerTest
. - Each test plan has one or more test steps (subfolders) with arbitrary names, i.e.
a001putCustomerBatch
,a002getCustomerBatch
. Junit starter adds step to execution. - Each test step has multiple subfolders (connectors), with the strict naming convention
<ConnectorType>.<ID>
. TheID
will be looked up in configuration, i.e.DBGET.CUSTOMERS
,MQPUT.CUSTOMERBATCH
- All connectors processed automatically based on
<ConnectorType>
: PUT/GET i.e.:- MQGET. - reads all messages in Queue with
<ID>
- MQPUT. - submits the payloads from connector folder into Queue with
<ID>
- MQGET. - reads all messages in Queue with
For the test plan reference check docu
The declarative test-plan approach reduces the maintanence costs of the test-suite.
The following parts of the test.project supposed to be environment independent:
- junit starter with assertions
- test-plan with payloads
- recorded test output (master record)
That's why they shall be committed in the source repository and will be shared across users and environments. Write test onces and start it anywhere.
- replay output is also environment neutral but generated during the test execution, thus not checked in.
All the environment dependent properties belong to the test.project configuration files and basically contain the connector configurations, see configuration.
- Build the test.rockitizer framework with dependencies, see framework build instructions
- Create and configure your maven test project having the test.rockitizer as dependency, see test project configuration
- Write your test scenario using the step/connector/payload convention see testplan manual
- Whrite the JUnit and create the record "master" output see junit manual
- Reconfigure the test project to replay mode and execute replay with following asssertion
INFO #############################################################################
INFO # <SplitCustomerTestOK>: Configuration
INFO #############################################################################
INFO TESTNAME: SplitCustomerTestOK
INFO RECORD FOLDER: C:/rockit/github/test.rockitizer/examples/splitcustomer.rockitizer/src/test/resources/SplitCustomerTestOK/
INFO REPLAY FOLDER: C:/rockit/github/test.rockitizer/examples/splitcustomer.rockitizer/target/replay/SplitCustomerTestOK/
INFO MODE: replay
INFO #############################################################################
INFO # <SplitCustomerTestOK>: Executing [replay]
INFO #############################################################################
INFO 0BEFORE Copying /src/test/resources/0BEFORE to /target/replay/0BEFORE
INFO
INFO *****************************************************************************
INFO 0BEFORE Step Added. Executing...
INFO Connecting MQQueueManager IB9QMGR
INFO 0BEFORE Deleting replay folder C:/rockit/github/test.rockitizer/examples/splitcustomer.rockitizer/src/test/resources/SplitCustomerTestOK/output
INFO a001putCustomerBatch Copying /src/test/resources/a001putCustomerBatch to /target/replay/a001putCustomerBatch
INFO
INFO *****************************************************************************
INFO a001putCustomerBatch Step Added. Executing...
INFO a001putCustomerBatch [Connector:MQPUT.SPLITCUSTOMER.BATCH.IN] - Writing ...
INFO Message successfully written to SPLITCUSTOMER.BATCH.IN
INFO a002getCustomerBatch Copying /src/test/resources/a002getCustomerBatch to /target/replay/a002getCustomerBatch
INFO
INFO *****************************************************************************
INFO a002getCustomerBatch Step Added. Executing...
INFO Waiting 1000ms for results
INFO MQConnectorOut [SPLITCUSTOMER.CUSTOMER.OUT] get message size 186
INFO a002getCustomerBatch [Connector:MQGET.SPLITCUSTOMER.CUSTOMER.OUT] - Reading ...
INFO MQConnectorOut [SPLITCUSTOMER.CUSTOMER.OUT] get message size 213
INFO a002getCustomerBatch [Connector:MQGET.SPLITCUSTOMER.CUSTOMER.OUT] - Reading ...
INFO MQConnectorOut [SPLITCUSTOMER.CUSTOMER.OUT] get message size 188
INFO a002getCustomerBatch [Connector:MQGET.SPLITCUSTOMER.CUSTOMER.OUT] - Reading ...
INFO MQConnectorOut [SPLITCUSTOMER.CUSTOMER.OUT] get message size 247
INFO a002getCustomerBatch [Connector:MQGET.SPLITCUSTOMER.CUSTOMER.OUT] - Reading ...
INFO #############################################################################
INFO # <SplitCustomerTestOK>: Assertion
INFO #############################################################################
INFO Number of assertions processed successfully: 3 [
com.rockit.common.blackboxtester.assertions.XMLFileAssertion@ae9b55,
com.rockit.common.blackboxtester.assertions.FileAssertion@1700915,
com.rockit.common.blackboxtester.assertions.FileAssertion@1de60b4
]
Issue:
Base64.class from java 8 package
Solution:
Java 1.8 recommended. Use the code compatibility option to Java 1.7 for all IIB versions prior 10.0.0.12
MIT