mocking - JMS Queue testing with spock -


i using activemq , trying send , whether possible test if own created mock sent message queue. using activemq & want automate test where, mock send message queue , spock make sure message has been sent.

you can first create queuebrowser , using enumeration number of messages. let loop run till enumeration object has elements. check message in loop, if there. code should somehow looks this

        queuebrowser qbrowser = session.createbrowser(queuename);         enumeration messages = qbrowser.getenumeration();         while (messages.hasmoreelements())         {              textmessage message = (textmessage) messages.nextelement();             string a=message.gettext();               if (message there)             {                 return true;             }         } 

cheers :)


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -