コード例 #1
0
 /**
  * Tests onMessage method.
  *
  * @throws JMSException
  */
 @Test(expected = RuntimeException.class)
 public void onMessageWithWrongMessageClass() {
   incomingQueueMDB.onMessage(objMessage);
 }
コード例 #2
0
 /**
  * Tests onMessage method with JMSException.
  *
  * @throws JMSException
  */
 @Test(expected = RuntimeException.class)
 public void onMessageWithJMSException() throws JMSException {
   when(textMessage.getText()).thenThrow(new JMSException("Test Exception"));
   incomingQueueMDB.onMessage(textMessage);
 }