Package org.apache.qpid.client.message

Examples of org.apache.qpid.client.message.JMSTextMessage


    @Test
    public void testPropertEnu()
    {
        try
        {
            JMSTextMessage text = TestMessageHelper.newJMSTextMessage();

            text.setBooleanProperty("Boolean1", true);
            text.setBooleanProperty("Boolean2", true);
            text.setIntProperty("Int", 2);
            text.setLongProperty("Long", 2);

            Enumeration e = text.getPropertyNames();

            Assert.assertTrue("Boolean1".equals(e.nextElement()));
            Assert.assertTrue("Boolean2".equals(e.nextElement()));
            Assert.assertTrue("Int".equals(e.nextElement()));
            Assert.assertTrue("Long".equals(e.nextElement()));
View Full Code Here


        assertNotNull("Filter object is null", simpleSelectorFilter);
        assertNotNull("Selector string is null", simpleSelectorFilter.getSelector());
        assertEquals("Unexpected selector", "select=5", simpleSelectorFilter.getSelector());
        assertTrue("Filter object is invalid", simpleSelectorFilter != null);

        final JMSTextMessage message = TestMessageHelper.newJMSTextMessage();

        message.setIntProperty("select", 4);
        assertFalse("Selector did match when not expected", simpleSelectorFilter.matches(message));
        message.setIntProperty("select", 5);
        assertTrue("Selector didnt match when expected", simpleSelectorFilter.matches(message));
        message.setIntProperty("select", 6);
        assertFalse("Selector did match when not expected", simpleSelectorFilter.matches(message));
    }
View Full Code Here

        assertNotNull("Filter object is null", simpleSelectorFilter);
        assertNotNull("Selector string is null", simpleSelectorFilter.getSelector());
        assertEquals("Unexpected selector", "select>4", simpleSelectorFilter.getSelector());
        assertTrue("Filter object is invalid", simpleSelectorFilter != null);

        final JMSTextMessage message = TestMessageHelper.newJMSTextMessage();

        message.setStringProperty("select", "5");
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
        message.setStringProperty("select", "elephant");
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
        message.setBooleanProperty("select", false);
        assertFalse("Selector matched when not expected", simpleSelectorFilter.matches(message));
    }
View Full Code Here

{
    public void testPropertyNames()
    {
        try
        {
            JMSTextMessage text = TestMessageHelper.newJMSTextMessage();

            text.setBooleanProperty("Boolean1", true);
            text.setBooleanProperty("Boolean2", true);
            text.setIntProperty("Int", 2);
            text.setLongProperty("Long", 2);

            Enumeration e = text.getPropertyNames();

            assertEquals("Boolean1", e.nextElement());
            assertTrue("Boolean2".equals(e.nextElement()));
            assertTrue("Int".equals(e.nextElement()));
            assertTrue("Long".equals(e.nextElement()));
View Full Code Here

    public void testPropertEnu()
    {
        try
        {
            JMSTextMessage text = TestMessageHelper.newJMSTextMessage();

            text.setBooleanProperty("Boolean1", true);
            text.setBooleanProperty("Boolean2", true);
            text.setIntProperty("Int", 2);
            text.setLongProperty("Long", 2);

            Enumeration e = text.getPropertyNames();

            assertTrue("Boolean1".equals(e.nextElement()));
            assertTrue("Boolean2".equals(e.nextElement()));
            assertTrue("Int".equals(e.nextElement()));
            assertTrue("Long".equals(e.nextElement()));
View Full Code Here

        super.setUp();

        _connection =  new MockAMQConnection("amqp://guest:guest@client/test?brokerlist='tcp://localhost:1'");
        _session = new TestAMQSession(_connection);

        testTextMessage = new JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);

        //Set Message Text
        testTextMessage.setText("testTextMessage text");
        setMessageProperties(testTextMessage);
View Full Code Here

    public TextMessage createTextMessage() throws JMSException
    {
        checkNotClosed();

        JMSTextMessage msg = new JMSTextMessage(getMessageDelegateFactory());
        msg.setAMQSession(this);
        return msg;
    }
View Full Code Here

    {
        synchronized (getFailoverMutex())
        {
            checkNotClosed();

            JMSTextMessage msg = new JMSTextMessage(getMessageDelegateFactory());
            msg.setAMQSession(this);
            return msg;
        }
    }
View Full Code Here

    public TextMessage createTextMessage() throws JMSException
    {
        checkNotClosed();

        JMSTextMessage msg = new JMSTextMessage(getMessageDelegateFactory());
        msg.setAMQSession(this);
        return msg;
    }
View Full Code Here

    public void testPropertyEnum()
    {
        try
        {
            JMSTextMessage text = TestMessageHelper.newJMSTextMessage();

            text.setBooleanProperty("Boolean1", true);
            text.setBooleanProperty("Boolean2", true);
            text.setIntProperty("Int", 2);
            text.setLongProperty("Long", 2);

            Enumeration e = text.getPropertyNames();

            assertTrue("Boolean1".equals(e.nextElement()));
            assertTrue("Boolean2".equals(e.nextElement()));
            assertTrue("Int".equals(e.nextElement()));
            assertTrue("Long".equals(e.nextElement()));
View Full Code Here

TOP

Related Classes of org.apache.qpid.client.message.JMSTextMessage

Copyright © 2018 www.massapicom. 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.