ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MA0T Msgtest Testing for no message

Post new topic  Reply to topic
 MA0T Msgtest Testing for no message « View previous topic :: View next topic » 
Author Message
jsware
PostPosted: Wed Dec 18, 2013 4:30 am    Post subject: MA0T Msgtest Testing for no message Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

Hi,

I am using the MA0T SupportPac (MsgTest) utility to create some regression tests for a message flow.

The flow has an Input queue and two output queues.

The flow reads from the input queue and outputs to one/both output queues based on the content.

So, I have a bunch of running tests to put a message on the input queue, get a message from the correct output queue and compare it against a regular expression to confirm it is a valid output message.

I want to be able to confirm a message only outputs to one/both output queues. Sometimes I need to check that there is no output message.

I do this with the following Msgtext XML:
Quote:
<GetMsg>
<Q>SAMPLE.OUT2</Q>
<GmoWait>100</GmoWait>
</GetMsg>
<If Cond="%LastRC%.NE.2033">
<StdOut>Unexpected OUT2 Msg (CC=%LastCC% RC=%LastRC% Len=%LastDataLen%)</StdOut>
<FailTest/>
</If>
<StdOut>No OUT2 Msg OK (CC=%LastCC% RC=%LastRC%)</StdOut>

This works fine and if a message is found on the wrong output queue, it fails the test because that is unexpected.

This is great except the msgtest return code includes the fact that the GetMsg "failed" with a 2033. If I try to <SuppressRC>2033</SuppressRC> in the GetMsg element, this upsets the check because it then thinks there was a message on the queue (it changes LastRC to 0).

Any idea how I can check for no message on a queue in a way that does not count towards the return code value? I need the return code value to be zero otherwise can't tell whether the test run completed successfully or not.

Kind Regards
John.
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 18, 2013 11:26 am    Post subject: Re: MA0T Msgtest Testing for no message Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

jsware wrote:

This is great except the msgtest return code includes the fact that the GetMsg "failed" with a 2033. If I try to <SuppressRC>2033</SuppressRC> in the GetMsg element, this upsets the check because it then thinks there was a message on the queue (it changes LastRC to 0).

Any idea how I can check for no message on a queue in a way that does not count towards the return code value? I need the return code value to be zero otherwise can't tell whether the test run completed successfully or not.

Kind Regards
John.


Why? The test returning with 2033 value may be the completion of your test. The question is how long are you willing to wait for a message? RC 2033 means no message found matching the requested values... deal with it!

If you want to ignore this type of RC use the JMS/JMX interface where a null object is returned in place of the message....
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jsware
PostPosted: Thu Dec 19, 2013 12:43 am    Post subject: Re: MA0T Msgtest Testing for no message Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

fjb_saper wrote:
If you want to ignore this type of RC use the JMS/JMX interface where a null object is returned in place of the message....

Eh? The MA0T SupportPac isn't a Java program. I am using MA0T - i.e. the MsgTest utility - to perform automated regression tests of code.

fjb_saper wrote:

Why? The test returning with 2033 value may be the completion of your test. The question is how long are you willing to wait for a message? RC 2033 means no message found matching the requested values... deal with it!


I don't want to ignore the RC2033. An RC2033 is what I expect - I want to check that there is no message on a particular output queue of a message flow because if there is the test will have failed. This is what the MsgTest XML given above does.

The problem I have is that the expected RC2033 gets counted with all the other non-zero RC test cases (like a RC2033 on a queue where I expect a message). So I can't tell whether MsgTest completed successfully or not because it gives me a non-zero return code even when all the tests check out.
_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
jsware
PostPosted: Fri Dec 20, 2013 12:52 am    Post subject: SOLVED: MA0T Msgtest Testing for no message Reply with quote

Chevalier

Joined: 17 May 2001
Posts: 455

I found a way to work this. If you wrap your Get with a "dummy" For loop and BreakOnRC, then when 2033 is received, it breaks out of the loop, but is treated as successful, so it does not add to the failure count which eventually becomes the msgtest utility's return code.

For example:
Quote:
<For Name="NoMsg" From="1" To="1" Incr="1">
<GetMsg>
<Q>SAMPLE.OUT2</Q>
<GmoWait>100</GmoWait>
<BreakOnRC>2033</BreakOnRC>
</GetMsg>
</For>
<If Cond="%LastRC%.NE.2033">
<StdOut>Unexpected OUT2 Msg (CC=%LastCC% RC=%LastRC% Len=%LastDataLen%)</StdOut>
<FailTest/>
</If>
<StdOut>No OUT2 Msg OK (CC=%LastCC% RC=%LastRC%)</StdOut>

_________________
Regards
John
The pain of low quaility far outlasts the joy of low price.
Back to top
View user's profile Send private message
timjohnarm
PostPosted: Sun May 11, 2014 2:31 pm    Post subject: Source code provided. Reply with quote

Apprentice

Joined: 28 Sep 2004
Posts: 40
Location: Melbourne Australia

If you want a new feature or command the source code is provided. Whilst in need of a good refactoring you should be able to find the point at which you could change things fairly easily.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » MA0T Msgtest Testing for no message
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.