Package org.apache.qpid.client.message

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


    public void testBooleanLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();

            mm.setBoolean("value", true);
            Assert.assertEquals(true, mm.getBoolean("value"));
            Assert.assertEquals("true", mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here


    public void testByteLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setByte("value", Byte.MAX_VALUE);

            Assert.assertEquals(Byte.MAX_VALUE, mm.getByte("value"));
            Assert.assertEquals((short) Byte.MAX_VALUE, mm.getShort("value"));
            Assert.assertEquals(Byte.MAX_VALUE, mm.getInt("value"));
            Assert.assertEquals((long) Byte.MAX_VALUE, mm.getLong("value"));
            Assert.assertEquals("" + Byte.MAX_VALUE, mm.getString("value"));

        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
View Full Code Here

    public void testShortLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setShort("value", Short.MAX_VALUE);
            Assert.assertEquals(Short.MAX_VALUE, mm.getShort("value"));
            Assert.assertEquals((int) Short.MAX_VALUE, mm.getInt("value"));
            Assert.assertEquals((long) Short.MAX_VALUE, mm.getLong("value"));
            Assert.assertEquals("" + Short.MAX_VALUE, mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testCharLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();

            mm.setChar("value", 'c');
            Assert.assertEquals('c', mm.getChar("value"));
            Assert.assertEquals("c", mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }

        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();

            mm.setString("value", null);
            mm.getChar("value");
            fail("Expected NullPointerException");

        }
        catch (NullPointerException e)
        {
View Full Code Here

    public void testDoubleLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setDouble("value", Double.MAX_VALUE);
            Assert.assertEquals(Double.MAX_VALUE, mm.getDouble("value"), 0d);
            Assert.assertEquals("" + Double.MAX_VALUE, mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testFloatLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setFloat("value", Float.MAX_VALUE);
            Assert.assertEquals(Float.MAX_VALUE, mm.getFloat("value"), 0f);
            Assert.assertEquals(Double.valueOf(Float.MAX_VALUE), mm.getDouble("value"), 0d);
            Assert.assertEquals("" + Float.MAX_VALUE, mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testIntLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setInt("value", Integer.MAX_VALUE);
            Assert.assertEquals(Integer.MAX_VALUE, mm.getInt("value"));
            Assert.assertEquals((long) Integer.MAX_VALUE, mm.getLong("value"));
            Assert.assertEquals("" + Integer.MAX_VALUE, mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testLongLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            mm.setLong("value", Long.MAX_VALUE);
            Assert.assertEquals(Long.MAX_VALUE, mm.getLong("value"));
            Assert.assertEquals("" + Long.MAX_VALUE, mm.getString("value"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testBytesLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            byte[] bytes = {99, 98, 97, 96, 95};
            mm.setBytes("bytes", bytes);
            assertBytesEqual(bytes, mm.getBytes("bytes"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

    public void testFailedBooleanLookup()
    {
        try
        {
            JMSMapMessage mm = TestMessageHelper.newJMSMapMessage();
            Assert.assertEquals(false, mm.getBoolean("int"));
        }
        catch (JMSException e)
        {
            Assert.fail("JMSException received." + e);
        }
View Full Code Here

TOP

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

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.