diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/selector/SelectorTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/selector/SelectorTest.java index 66a7af4d94..3ad84302f5 100644 --- a/activemq-unit-tests/src/test/java/org/apache/activemq/selector/SelectorTest.java +++ b/activemq-unit-tests/src/test/java/org/apache/activemq/selector/SelectorTest.java @@ -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");