Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQMapMessage


        assertEquals(msg.getString("string"), "string");
        assertEquals(msg.getString("bigString"), bigString);
    }

    public void testGetBoolean() throws JMSException {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        msg.setBoolean(name, true);
        msg.setReadOnlyBody(true);
        assertTrue(msg.getBoolean(name));
        msg.clearBody();
        msg.setString(name, "true");
       
        msg = (ActiveMQMapMessage) msg.copy();
       
        assertTrue(msg.getBoolean(name));
    }
View Full Code Here


       
        assertTrue(msg.getBoolean(name));
    }

    public void testGetByte() throws JMSException {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        msg.setByte(this.name, (byte) 1);
        msg = (ActiveMQMapMessage) msg.copy();
        assertTrue(msg.getByte(this.name) == (byte) 1);
    }
View Full Code Here

        msg = (ActiveMQMapMessage) msg.copy();
        assertTrue(msg.getByte(this.name) == (byte) 1);
    }

    public void testGetShort() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setShort(this.name, (short) 1);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getShort(this.name) == (short) 1);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetChar() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setChar(this.name, 'a');
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getChar(this.name) == 'a');
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetInt() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setInt(this.name, 1);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getInt(this.name) == 1);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetLong() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setLong(this.name, 1);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getLong(this.name) == 1);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetFloat() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setFloat(this.name, 1.5f);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getFloat(this.name) == 1.5f);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetDouble() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            msg.setDouble(this.name, 1.5);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue(msg.getDouble(this.name) == 1.5);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetString() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            String str = "test";
            msg.setString(this.name, str);
            msg = (ActiveMQMapMessage) msg.copy();
            assertEquals(msg.getString(this.name), str);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

            assertTrue(false);
        }
    }

    public void testGetBytes() {
        ActiveMQMapMessage msg = new ActiveMQMapMessage();
        try {
            byte[] bytes1 = new byte[3];
            byte[] bytes2 = new byte[2];
            System.arraycopy(bytes1, 0, bytes2, 0, 2);
            msg.setBytes(this.name, bytes1);
            msg.setBytes(this.name + "2", bytes1, 0, 2);
            msg = (ActiveMQMapMessage) msg.copy();
            assertTrue( Arrays.equals(msg.getBytes(this.name), bytes1));
            assertEquals(msg.getBytes(this.name + "2").length, bytes2.length);
        } catch (JMSException jmsEx) {
            jmsEx.printStackTrace();
            assertTrue(false);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ActiveMQMapMessage

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.