Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQMapMessage.copy()


            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


            System.out.println("Caught: " + mfe);
            mfe.printStackTrace();
            fail("object formats should be correct");
        }
       
        msg = (ActiveMQMapMessage) msg.copy();

        assertTrue(msg.getObject("boolean") instanceof Boolean);
        assertEquals(msg.getObject("boolean"), booleanValue);
        assertEquals(msg.getBoolean("boolean"), booleanValue.booleanValue());
        assertTrue(msg.getObject("byte") instanceof Byte);
View Full Code Here

        msg.setLong("long", 1);
        msg.setObject("object", "stringObj");
        msg.setShort("short", (short) 1);
        msg.setString("string", "string");

        msg = (ActiveMQMapMessage) msg.copy();

        Enumeration mapNamesEnum = msg.getMapNames();
        ArrayList mapNamesList = Collections.list(mapNamesEnum);

        assertEquals(mapNamesList.size(), 12);
View Full Code Here

    public void testItemExists() throws JMSException {
        ActiveMQMapMessage mapMessage = new ActiveMQMapMessage();

        mapMessage.setString("exists", "test");
       
        mapMessage = (ActiveMQMapMessage) mapMessage.copy();

        assertTrue(mapMessage.itemExists("exists"));
        assertFalse(mapMessage.itemExists("doesntExist"));
    }
View Full Code Here

       
        assertNull(mapMessage.getString("String"));
        mapMessage.clearBody();
        mapMessage.setString("String", "String");
       
        mapMessage = (ActiveMQMapMessage) mapMessage.copy();

        mapMessage.getString("String");           
    }

    public void testReadOnlyBody() throws JMSException {
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.