Examples of TextMessageImpl


Examples of org.mom4j.jms.TextMessageImpl

    {
        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));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.