Package org.jboss.jms.message

Examples of org.jboss.jms.message.JBossMessage


         if (iterator == null)
         {
            iterator = createIterator();
         }

         JBossMessage r = (JBossMessage)iterator.next();
  
         if (trace) { log.trace(this + " returning " + r); }
        
         return r;
      }  
View Full Code Here


      if (!(m1 instanceof JBossMessage) && !(m2 instanceof JBossMessage))
      {
         fail();
      }
     
      JBossMessage jm1 = (JBossMessage)m1;
      JBossMessage jm2 = (JBossMessage)m2;
     
      assertEquals(jm1.isCorrelationIDBytes(), jm2.isCorrelationIDBytes());
      if (jm1.isCorrelationIDBytes())
      {
         checkByteArraysEqual(jm1.getJMSCorrelationIDAsBytes(), jm2.getJMSCorrelationIDAsBytes());
      }
      else
      {
         assertEquals(jm1.getJMSCorrelationID(), jm2.getJMSCorrelationID());
      }
           
      assertEquals(jm1.getJMSMessageID(), jm2.getJMSMessageID());
      assertEquals(jm1.getJMSRedelivered(), jm2.getJMSRedelivered());
      assertEquals(jm1.getJMSType(), jm2.getJMSType());
      assertEquals(jm1.getJMSDeliveryMode(), jm2.getJMSDeliveryMode());
      assertEquals(jm1.getJMSDestination(), jm2.getJMSDestination());
      assertEquals(jm1.getJMSExpiration(), jm2.getJMSExpiration());
      assertEquals(jm1.getJMSPriority(), jm2.getJMSPriority());
      assertEquals(jm1.getJMSReplyTo(), jm2.getJMSReplyTo());
      assertEquals(jm1.getJMSTimestamp(), jm2.getJMSTimestamp());

      checkMapsEquivalent(jm1.getJMSProperties(), jm2.getJMSProperties());
     

   }
View Full Code Here

  
   protected Message createMessage(byte i, boolean reliable) throws Exception
   {
      HashMap coreHeaders = generateFilledMap(true);        
         
      JBossMessage m =
         new JBossMessage(i,
            reliable,
            System.currentTimeMillis() + 1000 * 60 * 60,
            System.currentTimeMillis(),
            i,
            coreHeaders,
            null);
     
      setDestination(m, i);
      setReplyTo(m, i);    
      m.setJMSType("testType");
      setCorrelationID(m, i);
     
      m.setPayload(new WibblishObject());
     
      return m;
   }
View Full Code Here

         testPacket(req, PacketSupport.REQ_SESSION_UNSUBSCRIBE);                          
      }
     
      public void testSessionSendRequest() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         RequestSupport req =
            new SessionSendRequest(23, (byte)77, msg, false);
                
         testPacket(req, PacketSupport.REQ_SESSION_SEND);                          
View Full Code Here

     
      // Browser
     
      public void testBrowserNextMessageResponse() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         ResponseSupport resp =
            new BrowserNextMessageResponse(msg);
                
         testPacket(resp, PacketSupport.RESP_BROWSER_NEXTMESSAGE);                          
View Full Code Here

         testPacket(resp, PacketSupport.RESP_BROWSER_HASNEXTMESSAGE);                          
      }
     
      public void testBrowserNextMessageBlockResponse() throws Exception
      {
         JBossMessage msg = new JBossMessage(123);
        
         ResponseSupport resp =
            new BrowserNextMessageBlockResponse(new JBossMessage[] { msg });
                
         testPacket(resp, PacketSupport.RESP_BROWSER_NEXTMESSAGEBLOCK);                          
View Full Code Here

        
         prod.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
         
         MapMessage m = sess.createMapMessage();
        
         JBossMessage check1 = ((MessageProxy)m).getMessage();
        
         m.setString("map_entry", "map_value");        
         m.setStringProperty("property_entry", "property_value");  
        
         m.setJMSReplyTo(new JBossQueue("wibble"));
        
         JBossMessage check2 = ((MessageProxy)m).getMessage();
        
         checkSameUnderlyingMessage(check1, check2, true);
         checkSameBody(check1, check2, true);
        
         prod.send(m);
        
         JBossMessage check3 = ((MessageProxy)m).getMessage();
        
         //Underlying message should be the same before and after
         checkSameUnderlyingMessage(check2, check3, true);
         checkSameBody(check2, check3, true);
        
         prod.send(m);
        
         JBossMessage check4 = ((MessageProxy)m).getMessage();
        
         assertFalse(check3.getMessageID() == check4.getMessageID());
        
         //The underlying message should now be different
         checkSameUnderlyingMessage(check3, check4, false);
        
         //But the body should be the same
         checkSameBody(check3, check4, true);
        
         prod.send(m);
        
         JBossMessage check5 = ((MessageProxy)m).getMessage();
        
         // The message should be different
         assertFalse(check4.getMessageID() == check5.getMessageID());
        
         checkSameUnderlyingMessage(check4, check5, false);
        
         //But the body should be the same
         checkSameBody(check4, check5, true);
        
         //Now set another header
        
         m.setJMSType("type123");
        
         JBossMessage check6 = ((MessageProxy)m).getMessage();
        
        
         //The message should be different
         checkSameUnderlyingMessage(check5, check6, false);
        
         //But the body should be the same
         checkSameBody(check5, check6, true);
        
         prod.send(m);
        
         JBossMessage check7 = ((MessageProxy)m).getMessage();
                 
         //The message should be the same
        
         checkSameUnderlyingMessage(check6, check7, true);
        
         // But the body should be the same
         checkSameBody(check6, check7, true);
        
         // Set the body
         m.setString("key1", "blah");
        
         JBossMessage check8 = ((MessageProxy)m).getMessage();
        
         //The message should be the same
        
         checkSameUnderlyingMessage(check7, check8, true);
        
         // But the body should not be the same
         checkSameBody(check7, check8, false);
        
         //And the body not the same
        
         checkSameUnderlyingMessage(check7, check8, false);
        
         prod.send(m);
        
         JBossMessage check9 = ((MessageProxy)m).getMessage();
        
         //The message should be the same
        
         checkSameUnderlyingMessage(check8, check9, true);
        
View Full Code Here

        
         m = (MapMessage)cons.receive(2000);
        
         assertNotNull(m);
                          
         JBossMessage check1 = ((MessageProxy)m).getMessage();        
        
         prod.send(m);
        
         JBossMessage check3 = ((MessageProxy)m).getMessage();
        
         //Underlying message should be different
         checkSameUnderlyingMessage(check1, check3, true);
         checkSameBody(check1, check3, true);
        
         prod.send(m);
        
         JBossMessage check4 = ((MessageProxy)m).getMessage();
        
         assertFalse(check3.getMessageID() == check4.getMessageID());
        
         //The underlying message should now be different
         checkSameUnderlyingMessage(check3, check4, false);
        
         //But the body should be the same
         checkSameBody(check3, check4, true);
        
         prod.send(m);
        
         JBossMessage check5 = ((MessageProxy)m).getMessage();
        
         // The message should be different
         assertFalse(check4.getMessageID() == check5.getMessageID());
        
         checkSameUnderlyingMessage(check4, check5, false);
        
         //But the body should be the same
         checkSameBody(check4, check5, true);
        
         //Now set another header
        
         m.setJMSType("type123");
        
         JBossMessage check6 = ((MessageProxy)m).getMessage();
        
        
         //The message should be different
         checkSameUnderlyingMessage(check5, check6, false);
        
         //But the body should be the same
         checkSameBody(check5, check6, true);
        
         prod.send(m);
        
         JBossMessage check7 = ((MessageProxy)m).getMessage();
                 
         //The message should be the same
        
         checkSameUnderlyingMessage(check6, check7, true);
        
         // But the body should be the same
         checkSameBody(check6, check7, true);
        
         // Set the body
         m.setString("key1", "blah");
        
         JBossMessage check8 = ((MessageProxy)m).getMessage();
        
         //The message should be the same
        
         checkSameUnderlyingMessage(check7, check8, true);
        
         // But the body should not be the same
         checkSameBody(check7, check8, false);
        
         //And the body not the same
        
         checkSameUnderlyingMessage(check7, check8, false);
        
         prod.send(m);
        
         JBossMessage check9 = ((MessageProxy)m).getMessage();
        
         //The message should be the same
        
         checkSameUnderlyingMessage(check8, check9, true);
        
View Full Code Here

   }
  
   protected void setUp() throws Exception
   {
      super.setUp();
      message = new JBossMessage(0);
   }
View Full Code Here

   {
      Message m = null;
     
      if (type == JBossMessage.TYPE) //1
      {
         m = new JBossMessage();
      }
      else if (type == JBossObjectMessage.TYPE) //2
      {
         m = new JBossObjectMessage();
      }
View Full Code Here

TOP

Related Classes of org.jboss.jms.message.JBossMessage

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.