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.










share|improve this question



























    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.










    share|improve this question

























      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.










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 9:30









      Morag Hughson

      4,390531




      4,390531










      asked Nov 9 at 8:39









      Ven_QA

      65




      65






















          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_DIRECTORY in 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.






          share|improve this answer




















          • 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

















          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.






          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            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

























            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_DIRECTORY in 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.






            share|improve this answer




















            • 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














            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_DIRECTORY in 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.






            share|improve this answer




















            • 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












            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_DIRECTORY in 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.






            share|improve this answer












            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_DIRECTORY in 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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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
















            • 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












            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.






            share|improve this answer
























              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.






              share|improve this answer






















                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                TJA

                1,17111421




                1,17111421



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Kleinkühnau

                    Makov (Slowakei)

                    Deutsches Schauspielhaus