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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -