Implementation of the javax.jms.TextMessage interface
2728293031323334353637383940414243444546474849505152535455565758596061626364
{ final String query = "JMSPriority = 4 OR (JMSPriority = 5 AND color = 'green') AND " + "NOT(stored = FALSE AND init = TRUE) AND name IS NULL"; TextMessageImpl msg = new TextMessageImpl(); msg.setJMSPriority(4); msg.setStringProperty("color", "blue"); msg.setBooleanProperty("stored", true); msg.setBooleanProperty("init", true); Element e = Query.parse(query); int count = 1; Assert.assertTrue("match - " + (count++), e.match(msg)); msg.setJMSPriority(5); Assert.assertTrue("match - " + (count++), !e.match(msg)); msg.setStringProperty("color", "green"); Assert.assertTrue("match - " + (count++), e.match(msg)); msg.setBooleanProperty("stored", false); Assert.assertTrue("match - " + (count++), !e.match(msg)); msg.setBooleanProperty("init", false); Assert.assertTrue("match - " + (count++), e.match(msg)); msg.setStringProperty("name", "any_name"); Assert.assertTrue("match - " + (count++), !e.match(msg)); }