Package org.apache.qpid.client.message

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


    public void testBooleanPropertyLookup()
    {
        try
        {
            JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();

            tm.setBooleanProperty("value", true);
            Assert.assertEquals(true, tm.getBooleanProperty("value"));
            Assert.assertEquals("true", tm.getStringProperty("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here


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

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

public class TextMessageTest extends TestCase
{
    public void testTextOnConstruction() throws Exception
    {
        JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
        tm.setText("pies");
        String val = tm.getText();
        assertEquals(val, "pies");
    }
View Full Code Here

        assertEquals(val, "pies");
    }

    public void testClearBody() throws Exception
    {
        JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
        tm.setText("pies");
        tm.clearBody();
        String val = tm.getText();
        assertNull(val);
        tm.setText("Banana");
        val = tm.getText();
        assertEquals(val, "Banana");
    }
View Full Code Here

    public void testBooleanPropertyLookup()
    {
        try
        {
            JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();

            tm.setBooleanProperty("value", true);
            Assert.assertEquals(true, tm.getBooleanProperty("value"));
            Assert.assertEquals("true", tm.getStringProperty("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
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

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

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

public class TextMessageTest
{
    @Test
    public void testTextOnConstruction() throws Exception
    {
        JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
        tm.setText("pies");
        String val = tm.getText();
        Assert.assertEquals(val, "pies");
    }
View Full Code Here

    }

    @Test
    public void testClearBody() throws Exception
    {
        JMSTextMessage tm = TestMessageHelper.newJMSTextMessage();
        tm.setText("pies");
        tm.clearBody();
        String val = tm.getText();
        Assert.assertNull(val);
        tm.setText("Banana");
        val = tm.getText();
        Assert.assertEquals(val, "Banana");
    }
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.