no jira - add selector on originalDestination attribute test

This commit is contained in:
gtully 2020-07-06 16:56:30 +01:00
parent a436b2177e
commit b3386c8ac7
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import org.apache.activemq.command.ActiveMQMessage;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTextMessage;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.filter.BooleanExpression;
@ -364,6 +365,15 @@ public class SelectorTest extends TestCase {
assertSelector(message, "REGEX('connection1111', REPLACE(JMSMessageID,':',''))", true);
}
public void testMatchOriginalDestinationAttribute() throws Exception {
ActiveMQMessage activeMQMessage = (ActiveMQMessage) createMessage();
ActiveMQQueue originalDest = new ActiveMQQueue("QQ");
activeMQMessage.setOriginalDestination(originalDest);
assertSelector(activeMQMessage, "JMSDestination='" + originalDest.getQualifiedName() +"'", true);
}
protected Message createMessage() throws JMSException {
Message message = createMessage("FOO.BAR");
message.setJMSType("selector-test");