Introduction

Automated integration testing for complex integration environments is always a big challenge. Due to the complexity, such integration testing is unfortunately quite often being done manually. These manual tests need numerous tools and come with a high cost. Therefore, the leak of test automation frequently causes the leak of test coverage, and over time can influence product quality. Manual testing also brings with it undesirable side-effects like longer development times, lower agility and increased budgets.

The purpose of this blog is to target the problem of test automation, with a particular focus on IBM Integration Bus. It suggests the approach, based on the open-source test.rockITizer framework which helps enable JUnit-based integration testing for IBM Integration Bus. It is free and distributed under MIT Licence, which means you can freely use, change and redistribute the code.

JUnit based integration testing for IBM Integration Bus with test.rockITizer

Main concepts

The test.rockITizer framework treats IBM Integration Bus as a blackbox. It is based on record / replay / assert logic and compares the current system / interface snapshot with recorded master results using the numerous built-in and user-defined assertions. Therefore it keeps you informed on any suspicious change of system behavior.

JUnit based integration testing for IBM Integration Bus with test.rockitizer: Lifecycle

Furthermore, the framework enables a “Test Driven Development” approach, where iterative development work can aim towards a pre-defined “target” interface, by making changes until the replay snapshot matches.

The framework’s runtime supports several connectors out of the box: MQ / HTTP / DB / SCP, which should be sufficient for most common usecases.

You can refer to the Rockit Consulting documentation for detailed information on core features and the main concepts of the test framework.

Deeper insight

test rockitizer architecture

The setup consists of the following components:

  • A Runtime maven project built as a jar file which contains the implementation of execution runtime, connectors and assertions
  • A Test.Project which is a runtime jar which can be placed in your classpath and contains connector configuration, testplans, and junit starters with assertions

Test.Project

Test plan

Thanks to declarative test plan concept, the test plan knows the IN and OUT connectors of the underlying container (IBM Integration Bus) and stores their payloads on the file system. This makes the test plans, including connectors and payloads environment independent and only has to be created once.

test rockitizer architecture (Click image to view full size.)
Naming conventions:
– The Test plan has an environment neutral folder structure: <testname>/<teststep>/<connector>/<payloads>.
– The Connector is an environment neutral folder following a convention like: <protocol><type>@<ID>, where
– protcol: MQ, HTTP, DB, or SCP etc.
– type GET or PUT
– ID:key from configuration (the value is environment dependent)

Junit Starter

The <testname> JUnit serves as glue, triggering test execution which basically is comprised of the following steps:

  1. Add the steps (step folders) to execution. The rest of processing lies by the framework, based on connector types PUT/GET and Backends MQ/HTTP/DB/SCP
  2. Store the payloads for the GET connectors in the corresponding <testname> output folder
  3. Runs the built-in and configured assertions
  4. Writes test protocol

There is also a more detailed junit starter available which includes an example.


Hands on sample project

If you would like to try JUnit based integration testing for IBM Integration Bus with test.rockITizer, you can do so with the sample project provided by Rockit Consulting. For instructions, see Getting started in the Rockit Consulting documentation.

If you need help trying test.rockITizer, you can email info@rockit.consulting.

Summary

With environment neutral test plan you are able to write the test once and run it anywhere. The junit based test project, allowes you fine tuning and extension of the test logic. It is easy to integrate the test suites in your contionous build and delivery routine. The record/reply and assert approach allowes you easy tracking of your changes in business logic, using the same test plan to re-record the master data if needed.

Moreover the test.rockitizer saves you the time, replacing the bunch of tools like dbviewer, rfhutil, winscp and forces the “test first” approach in your integration development process.

——————————————————————————

License

MIT
——————————————————————————

github URL:
https://github.com/rockitconsulting/test.rockitizer

[contact-form][contact-field label=’Name’ type=’name’ required=’1’/][contact-field label=’Email’ type=’email’ required=’1’/][contact-field label=’Website’ type=’url’/][contact-field label=’Comment’ type=’textarea’ required=’1’/][/contact-form]

3 comments on"JUnit based integration testing for IBM Integration Bus"

  1. This is Very Nice article. We are in a process to implement Testing automation over various protocol. I can understand by the post that this would support MQ and HTTP. Does this tool supports TCP IP. Would request you to provide sample for the same.

    • info@rockit.consulting January 31, 2018

      Actually, there is no Connector for TCP/IP low-level communication implemented yet. The framework distributed under MIT license. You may develop your own TCP/IP connector on top of it. Take HTTPPutConnector implementation as sample

  2. Nice Explanations

Join The Discussion

Your email address will not be published. Required fields are marked *