Posted: Fri Nov 21, 2003 9:18 am Post subject: Junit
Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
I've used Junit to write unit tests for MQSI flows in Java. There is also another tool called DBUnit, which allows you to seed any databases with test data before each unit test.
A unit test for MQSI performs the following steps:
1) Check that no other processes have the queues open
2) Clear down the queues
3) Seed the database with test data
4) Put the input test message
5) Wait for output message(s)
6) Check output messages contain expected results
7) Check database contains expected results
If you have several flows chained together in the broker, then it is useful to define read & write aliases over each local queue. You can then have a unit test MQ environment configured to allow each flow to run individually, and a link test environment to test the whole chain of flows. (e.g)
Unit test:
LCLQ --> Flow1 --> LCLQ
LCLQ --> Flow2 --> LCLQ
Link test:
LCLQ --> Flow1 --> LCLQ --> Flow2 --> LCLQ
The basic aim of automated unit tests is to make it as easy as possible to run them. Then developers will run them often. Running the unit tests after you make each individual change to a flow boosts productivity and software quality no end.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum