Package org.codehaus.activemq.message

Examples of org.codehaus.activemq.message.ActiveMQMapMessage


  }

  public void testReadPacket() {
    ActiveMQMapMessageReader reader = new ActiveMQMapMessageReader();
    ActiveMQMapMessageWriter writer = new ActiveMQMapMessageWriter();
    ActiveMQMapMessage msg1 = new ActiveMQMapMessage();
    try {
      msg1.setTable(this.table);
      super.initializeMessage(msg1);
      byte[] data = writer.writePacketToByteArray(msg1);
      ActiveMQMapMessage msg2 = (ActiveMQMapMessage) reader.readPacketFromByteArray(data);
      super.testEquals(msg1, msg2);
      assertTrue(msg1.getTable().equals(msg2.getTable()));
    }
        catch(JMSException jmsEx){
            jmsEx.printStackTrace();
            assertTrue(false);
        }
View Full Code Here


  public void testTime() {

    ActiveMQMapMessageReader reader = new ActiveMQMapMessageReader();
    ActiveMQMapMessageWriter writer = new ActiveMQMapMessageWriter();
    ActiveMQMapMessage msg1 = new ActiveMQMapMessage();

    ActiveMQMapMessage msg2 = null;
    try {
      int count = 10000;
      long startTime = System.currentTimeMillis();

      msg1.setTable(this.table);
View Full Code Here

    super(arg0);
  }

  public void testGetPacketType()
  {
    ActiveMQMapMessage msg = new ActiveMQMapMessage();
    assertTrue(msg.getPacketType()==Packet.ACTIVEMQ_MAP_MESSAGE);
  }
View Full Code Here

  public void testShallowCopy()
  {
   
        try {
            ActiveMQMapMessage msg = new ActiveMQMapMessage();
            msg.setString("fred", "fred");
           
            ActiveMQMapMessage msg2;
           
            msg2 = (ActiveMQMapMessage)msg.shallowCopy();
            assertTrue(msg2.getTable() != null && msg2.getTable()==msg.getTable());
        }
        catch (JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            assertTrue(false);
View Full Code Here

       
  }

  public void testDeepCopy()
  {
    ActiveMQMapMessage msg = new ActiveMQMapMessage();
   
   
    try {
            ActiveMQMapMessage msg2 = (ActiveMQMapMessage)msg.deepCopy();
            assertTrue(msg2.getTable() != null && msg2.getTable()!=msg.getTable());
        }
        catch (JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            assertTrue(false);
View Full Code Here

        }
  }

  public void testSetTable()
  {
    ActiveMQMapMessage msg = new ActiveMQMapMessage();
   
    Hashtable table = new Hashtable();
    msg.setTable(table);
    try {
            assertTrue(msg.getTable()==table);
        }
        catch (JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            assertTrue(false);
View Full Code Here

  }


  public void testGetBoolean()
  {
    ActiveMQMapMessage msg = new ActiveMQMapMessage();
    try {
      msg.setBoolean(name,true);
      msg.setReadOnly(true);
      assertTrue(msg.getBoolean(name));
      msg.clearBody();
      msg.setString(name,"true");
      assertTrue(msg.getBoolean(name));
    }catch(JMSException jmsEx){
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

  }

  public void testGetByte()
  {

    ActiveMQMapMessage msg = new ActiveMQMapMessage();
    try {
      msg.setByte(this.name,(byte)1);
      msg.setReadOnly(true);
      assertTrue(msg.getByte(this.name)==(byte)1);
    }catch(JMSException jmsEx){
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

    }
  }

  public void testGetShort()
  {
    ActiveMQMapMessage msg = new ActiveMQMapMessage();
    try {
      msg.setByte(this.name,(byte)1);
      msg.setReadOnly(true);
      assertTrue(msg.getByte(this.name)==(byte)1);
    }catch(JMSException jmsEx){
      jmsEx.printStackTrace();
      assertTrue(false);
    }
  }
View Full Code Here

    /**
     * @return a new Packet instance
     */

    public Packet createPacket() {
        return new ActiveMQMapMessage();
    }
View Full Code Here

TOP

Related Classes of org.codehaus.activemq.message.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.