Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQStreamMessage.writeLong()


    public void testReadLong() {
        ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
        try {
            long test = 4l;
            msg.writeLong(test);
            msg.reset();
            assertTrue(msg.readLong() == test);
            msg.reset();
            assertTrue(msg.readString().equals(new Long(test).toString()));
            msg.reset();
View Full Code Here


            msg.reset();
            assertTrue(((Integer) msg.readObject()).intValue() == testInt);
            msg.clearBody();

            long testLong = 6l;
            msg.writeLong(testLong);
            msg.reset();
            assertTrue(((Long) msg.readObject()).longValue() == testLong);
            msg.clearBody();

            float testFloat = 6.6f;
View Full Code Here

    public void testReset() throws JMSException {
        ActiveMQStreamMessage streamMessage = new ActiveMQStreamMessage();
        try {
            streamMessage.writeDouble(24.5);
            streamMessage.writeLong(311);
        } catch (MessageNotWriteableException mnwe) {
            fail("should be writeable");
        }
        streamMessage.reset();
        try {
View Full Code Here

            message.writeBytes(new byte[3], 0, 2);
            message.writeChar('a');
            message.writeDouble(1.5);
            message.writeFloat((float) 1.5);
            message.writeInt(1);
            message.writeLong(1);
            message.writeObject("stringobj");
            message.writeShort((short) 1);
            message.writeString("string");
        } catch (MessageNotWriteableException mnwe) {
            fail("Should be writeable");
View Full Code Here

            message.writeInt(1);
            fail("Should have thrown exception");
        } catch (MessageNotWriteableException mnwe) {
        }
        try {
            message.writeLong(1);
            fail("Should have thrown exception");
        } catch (MessageNotWriteableException mnwe) {
        }
        try {
            message.writeObject("stringobj");
View Full Code Here

            message.writeBytes(new byte[3], 0, 2);
            message.writeChar('a');
            message.writeDouble(1.5);
            message.writeFloat((float) 1.5);
            message.writeInt(1);
            message.writeLong(1);
            message.writeObject("stringobj");
            message.writeShort((short) 1);
            message.writeString("string");
        } catch (MessageNotWriteableException mnwe) {
            fail("Should be writeable");
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.