Does anyone know how we can unit test IBM MQ Message Flows in an isolated way using stubs?
up vote
0
down vote
favorite
I am new to IBM-MQ and trying to understand how we can perform unit testing on message flows.
I am aware of the tools like CA Lisa to do Service Virtualization and testing at system testing level.
But in my case I am looking for the unit testing framework like Java Junit tests where developer can create tests and required stubs to test the IBM MQ Message flows independently.
Thank You in advance.
ibm-mq messagebroker ibm-integration-bus
add a comment |
up vote
0
down vote
favorite
I am new to IBM-MQ and trying to understand how we can perform unit testing on message flows.
I am aware of the tools like CA Lisa to do Service Virtualization and testing at system testing level.
But in my case I am looking for the unit testing framework like Java Junit tests where developer can create tests and required stubs to test the IBM MQ Message flows independently.
Thank You in advance.
ibm-mq messagebroker ibm-integration-bus
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am new to IBM-MQ and trying to understand how we can perform unit testing on message flows.
I am aware of the tools like CA Lisa to do Service Virtualization and testing at system testing level.
But in my case I am looking for the unit testing framework like Java Junit tests where developer can create tests and required stubs to test the IBM MQ Message flows independently.
Thank You in advance.
ibm-mq messagebroker ibm-integration-bus
I am new to IBM-MQ and trying to understand how we can perform unit testing on message flows.
I am aware of the tools like CA Lisa to do Service Virtualization and testing at system testing level.
But in my case I am looking for the unit testing framework like Java Junit tests where developer can create tests and required stubs to test the IBM MQ Message flows independently.
Thank You in advance.
ibm-mq messagebroker ibm-integration-bus
ibm-mq messagebroker ibm-integration-bus
edited Nov 9 at 9:30
Morag Hughson
4,390531
4,390531
asked Nov 9 at 8:39
Ven_QA
65
65
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
We write integration tests against deployed flows. We use the Spring Testframework and Junit as a base.
Here are some thoughts about our testing:
For synchronous dependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things like SMTP and LDAP.
For asynchronous dependencies like IBM MQ we use in our tests the JmsTemplate or directly the IBM MQ classes for JMS to send and receive messages. Before each test we clean the queues with PCF messages.
For file nodes we use the environment variable
MQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert that no message arrived we subscribe in our Junit tests to Monitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
add a comment |
up vote
0
down vote
Start using the MQ Messaging REST API Using the messaging REST API available in MQ V9.1.0.0 well actually V9.0.0.4 I believe.
I used to use all sort of workarounds in the past but if you want to just PUT messages on to queues and GET them off them and have MQ 9.1 installed or can install it then you can use the MQ Messaging REST API
An HTTP POST to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will PUT your message on to Q1
An HTTP DELETE to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will GET your message from Q1
I'm using Postman to do this but there is no reason you can't use SoapUI or any of your other favourite test tools.
One caveat at the moment is that you are limited to Text messages but given a very high percentage of messages are XML or JSON or CSV there's a fair chance this may fit the bill for you.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
We write integration tests against deployed flows. We use the Spring Testframework and Junit as a base.
Here are some thoughts about our testing:
For synchronous dependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things like SMTP and LDAP.
For asynchronous dependencies like IBM MQ we use in our tests the JmsTemplate or directly the IBM MQ classes for JMS to send and receive messages. Before each test we clean the queues with PCF messages.
For file nodes we use the environment variable
MQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert that no message arrived we subscribe in our Junit tests to Monitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
add a comment |
up vote
1
down vote
We write integration tests against deployed flows. We use the Spring Testframework and Junit as a base.
Here are some thoughts about our testing:
For synchronous dependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things like SMTP and LDAP.
For asynchronous dependencies like IBM MQ we use in our tests the JmsTemplate or directly the IBM MQ classes for JMS to send and receive messages. Before each test we clean the queues with PCF messages.
For file nodes we use the environment variable
MQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert that no message arrived we subscribe in our Junit tests to Monitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
add a comment |
up vote
1
down vote
up vote
1
down vote
We write integration tests against deployed flows. We use the Spring Testframework and Junit as a base.
Here are some thoughts about our testing:
For synchronous dependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things like SMTP and LDAP.
For asynchronous dependencies like IBM MQ we use in our tests the JmsTemplate or directly the IBM MQ classes for JMS to send and receive messages. Before each test we clean the queues with PCF messages.
For file nodes we use the environment variable
MQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert that no message arrived we subscribe in our Junit tests to Monitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.
We write integration tests against deployed flows. We use the Spring Testframework and Junit as a base.
Here are some thoughts about our testing:
For synchronous dependencies we either write mock flows that we deploy in a separate IIB application, or we use JUnit helpers for things like SMTP and LDAP.
For asynchronous dependencies like IBM MQ we use in our tests the JmsTemplate or directly the IBM MQ classes for JMS to send and receive messages. Before each test we clean the queues with PCF messages.
For file nodes we use the environment variable
MQSI_FILENODES_ROOT_DIRECTORYin the real flow and in Junit to easily find the files. We also clean the File input and output directories before each test to start clean.To speed up the unit tests and to test things like assert that no message arrived we subscribe in our Junit tests to Monitoring Events. When we receive the Transaction End event we are sure the flow is finished and can assert that a file is there, that no message is on a certain queue, etc.
answered Nov 10 at 16:15
Daniel Steinmann
431313
431313
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
add a comment |
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
Many thanks for the detailed explanation, Daniel. This helps me to define our testing strategy. Any thoughts on using Java API in Flow Exerciser from IBM Integration Bus for unit tests?
– Ven_QA
Nov 20 at 4:22
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
I started to do integration testing with IIB 9; Flow Exerciser was added in IIB 10. I tried it with the first IIB 10 release, but it noticed that my tests took a lot longer to run. So I stayed with my approach in the answer. Since IIB 10 matured over time, I could give it a again; thanks for mentioning it.
– Daniel Steinmann
Nov 20 at 16:53
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Thank you, Daniel.
– Ven_QA
Nov 22 at 10:18
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
Glad I could help. If you are satisfied with my answer, you can Accept it.
– Daniel Steinmann
Nov 23 at 13:49
add a comment |
up vote
0
down vote
Start using the MQ Messaging REST API Using the messaging REST API available in MQ V9.1.0.0 well actually V9.0.0.4 I believe.
I used to use all sort of workarounds in the past but if you want to just PUT messages on to queues and GET them off them and have MQ 9.1 installed or can install it then you can use the MQ Messaging REST API
An HTTP POST to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will PUT your message on to Q1
An HTTP DELETE to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will GET your message from Q1
I'm using Postman to do this but there is no reason you can't use SoapUI or any of your other favourite test tools.
One caveat at the moment is that you are limited to Text messages but given a very high percentage of messages are XML or JSON or CSV there's a fair chance this may fit the bill for you.
add a comment |
up vote
0
down vote
Start using the MQ Messaging REST API Using the messaging REST API available in MQ V9.1.0.0 well actually V9.0.0.4 I believe.
I used to use all sort of workarounds in the past but if you want to just PUT messages on to queues and GET them off them and have MQ 9.1 installed or can install it then you can use the MQ Messaging REST API
An HTTP POST to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will PUT your message on to Q1
An HTTP DELETE to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will GET your message from Q1
I'm using Postman to do this but there is no reason you can't use SoapUI or any of your other favourite test tools.
One caveat at the moment is that you are limited to Text messages but given a very high percentage of messages are XML or JSON or CSV there's a fair chance this may fit the bill for you.
add a comment |
up vote
0
down vote
up vote
0
down vote
Start using the MQ Messaging REST API Using the messaging REST API available in MQ V9.1.0.0 well actually V9.0.0.4 I believe.
I used to use all sort of workarounds in the past but if you want to just PUT messages on to queues and GET them off them and have MQ 9.1 installed or can install it then you can use the MQ Messaging REST API
An HTTP POST to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will PUT your message on to Q1
An HTTP DELETE to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will GET your message from Q1
I'm using Postman to do this but there is no reason you can't use SoapUI or any of your other favourite test tools.
One caveat at the moment is that you are limited to Text messages but given a very high percentage of messages are XML or JSON or CSV there's a fair chance this may fit the bill for you.
Start using the MQ Messaging REST API Using the messaging REST API available in MQ V9.1.0.0 well actually V9.0.0.4 I believe.
I used to use all sort of workarounds in the past but if you want to just PUT messages on to queues and GET them off them and have MQ 9.1 installed or can install it then you can use the MQ Messaging REST API
An HTTP POST to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will PUT your message on to Q1
An HTTP DELETE to .../ibmmq/rest/v1/messaging/qmgr/QMGR1/queue/Q1/message will GET your message from Q1
I'm using Postman to do this but there is no reason you can't use SoapUI or any of your other favourite test tools.
One caveat at the moment is that you are limited to Text messages but given a very high percentage of messages are XML or JSON or CSV there's a fair chance this may fit the bill for you.
answered yesterday
TJA
1,17111421
1,17111421
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53222305%2fdoes-anyone-know-how-we-can-unit-test-ibm-mq-message-flows-in-an-isolated-way-us%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown