Author |
Message
|
Souciance_Rashti |
Posted: Tue May 09, 2017 2:34 am Post subject: Automatic tests/mockup comparable to a maven flow |
|
|
Newbie
Joined: 09 May 2017 Posts: 7
|
Hello,
Is there something equivalent to a maven flow in IIB 10 with regards to test and build? Here is my scenario.
1. Rather than starting with writing a message a flow, I want to start to write the tests. Running the test first time will off course result in error.
2. As I write/create my message flow the tests should start to pass until all the tests are green.
3. I would like to run the tests when I build the bar file so that I know that any changes introduced didn't break the existing functionality.
Does something like that exist out of the box or would you have write something on your own?
Thanks
Souciance |
|
Back to top |
|
 |
mqjeff |
Posted: Tue May 09, 2017 3:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Have you considered simply using Maven?
What you're talking about, fundamentally, is a development workflow - i.e. test driven development. Such a workflow should easily apply to any kind of software development, and will apply to message flows.
You can put together an ant file, or other such, to do the build and deploy of your message flow. I would expect (but don't know, since I've never used Maven) that you can run that ant flow from Maven as part of your Maven workflow.
After that, it's a matter of sending and receiving messages from your message flow and making sure that the results are correct. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Souciance_Rashti |
Posted: Tue May 09, 2017 4:30 am Post subject: |
|
|
Newbie
Joined: 09 May 2017 Posts: 7
|
Ok, it would be something to build on your own then via Ant or Maven.
Ideally, it would be great to have ways to mock away certain nodes that are actually connect to endpoints that are not available without changing the flow itself. That can then be used as part of test.
For instance you may have an SAP adapter that connects to SAP. But this is not available to you locally so in your tests you mock that way and simply inject the idoc message you want to test the flow.
To accomplish that I guess you would have to write the message flow programatically using the Integration API? |
|
Back to top |
|
 |
Souciance_Rashti |
Posted: Tue May 09, 2017 4:31 am Post subject: |
|
|
Newbie
Joined: 09 May 2017 Posts: 7
|
A clarification:
I meant running the previous scenario in an automatic manner. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue May 09, 2017 4:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Souciance_Rashti wrote: |
A clarification:
I meant running the previous scenario in an automatic manner. |
Have you considered the use of JUnit?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Souciance_Rashti |
Posted: Tue May 09, 2017 4:44 am Post subject: |
|
|
Newbie
Joined: 09 May 2017 Posts: 7
|
fjb_saper wrote: |
Souciance_Rashti wrote: |
A clarification:
I meant running the previous scenario in an automatic manner. |
Have you considered the use of JUnit?  |
How would you use JUnit to test part of or a complete message flow? Especially if they contain only standard nodes and esql modules? |
|
Back to top |
|
 |
ceteareth |
Posted: Mon Jul 24, 2017 11:59 pm Post subject: |
|
|
Acolyte
Joined: 12 Aug 2012 Posts: 51
|
right now im thinking of the same thing....
you can use junit to send a HTTP request or send a message to a queue then get the response. afterwards you can compare actual and expected response.
Now the problem here is how bout asynchronous requests. Will you be satisfied to just check that you should receive empty response(HTTP 200 OK) ?? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jul 25, 2017 4:54 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ceteareth wrote: |
right now im thinking of the same thing....
you can use junit to send a HTTP request or send a message to a queue then get the response. afterwards you can compare actual and expected response.
Now the problem here is how bout asynchronous requests. Will you be satisfied to just check that you should receive empty response(HTTP 200 OK) ?? |
Surely Junit would let you wait for a second response or make a second call to get the async response? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
ceteareth |
Posted: Wed Jul 26, 2017 5:29 pm Post subject: |
|
|
Acolyte
Joined: 12 Aug 2012 Posts: 51
|
theres no async response. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 27, 2017 3:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ceteareth wrote: |
theres no async response. |
Then why is it a request?
A request gets a response. An HTTP call gets a return code.
The HTTP response code from your async request indicates that the request has been received - not that it has been processed.
THe response code from a synchronous request indicates that the message has been received - and will include whatever data is supposed to be included as a response to that call.
So - async http return code == message received, sync http return code = message processed or not, with data in the message body. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|