1 22 package org.jboss.test.messagedriven.support; 23 24 import javax.jms.Message ; 25 26 32 public class CheckJMSDestinationOperation extends Operation 33 { 34 protected int msgNo; 35 protected String destination; 36 37 public CheckJMSDestinationOperation(BasicMessageDrivenUnitTest test, int msgNo, String destination) 38 { 39 super(test); 40 this.msgNo = msgNo; 41 this.destination = destination; 42 } 43 44 public void run() throws Exception 45 { 46 Message message = (Message ) test.getMessages().get(msgNo); 47 String actual = message.getJMSDestination().toString(); 48 if (actual == null || actual.startsWith(destination) == false) 49 throw new Exception ("For msgNo=" + msgNo + " destination=" + actual + " Expected=" + destination + " msg=" + message); 50 } 51 } 52 | Popular Tags |