1 22 package org.jboss.test.messagedriven.support; 23 24 import javax.jms.Message ; 25 26 32 public class CheckMessagePropertyOperation extends Operation 33 { 34 protected int msgNo; 35 protected String property; 36 protected Object value; 37 38 public CheckMessagePropertyOperation(BasicMessageDrivenUnitTest test, int msgNo, String property, Object value) 39 { 40 super(test); 41 this.msgNo = msgNo; 42 this.property = property; 43 this.value = value; 44 } 45 46 public void run() throws Exception 47 { 48 Message message = (Message ) test.getMessages().get(msgNo); 49 if (message.propertyExists(property) == false) 50 throw new Exception ("For msgNo=" + msgNo + " property does not exist property= " + property + " Expected=" + value + " msg=" + message); 51 Object actual = message.getObjectProperty(property); 52 if (value.equals(actual) == false) 53 throw new Exception ("For msgNo=" + msgNo + " property= " + property + " Expected=" + value + " actual=" + actual + " msg=" + message); 54 } 55 } 56 | Popular Tags |