Package javax.jms

Examples of javax.jms.StreamMessage.readString()


      conn.start();

      StreamMessage rm = (StreamMessage)queueCons.receive();

      ProxyAssertSupport.assertNull(rm.readString());
   }

   // Protected -----------------------------------------------------

   @Override
View Full Code Here


      ProxyAssertSupport.assertEquals(new Float(9.0), new Float(sm.readFloat()));
      ProxyAssertSupport.assertEquals(10, sm.readInt());
      ProxyAssertSupport.assertEquals(11l, sm.readLong());
      ProxyAssertSupport.assertEquals("this is an object", sm.readObject());
      ProxyAssertSupport.assertEquals((short)12, sm.readShort());
      ProxyAssertSupport.assertEquals("this is a String", sm.readString());
   }

}
View Full Code Here

         sender.send(message);

         Message m = receiver.receive(TestConfig.TIMEOUT);
         Assert.assertTrue("The message should be an instance of StreamMessage.\n", m instanceof StreamMessage);
         StreamMessage msg = (StreamMessage)m;
         Assert.assertEquals("pi", msg.readString());
         Assert.assertEquals(3.14159, msg.readDouble(), 0);
      }
      catch (JMSException e)
      {
         fail(e);
View Full Code Here

         sender.send(message);

         Message m = receiver.receive(TestConfig.TIMEOUT);
         Assert.assertTrue("The message should be an instance of StreamMessage.\n", m instanceof StreamMessage);
         StreamMessage msg = (StreamMessage)m;
         Assert.assertEquals("pi", msg.readString());
         Assert.assertEquals(3.14159, msg.readDouble(), 0);
      }
      catch (JMSException e)
      {
         fail(e);
View Full Code Here

         log.trace("Sent stream messages");
  
         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            StreamMessage m = (StreamMessage)consumer.receive(2000);
            String v = m.readString();
            assertEquals("stream-message", v);
            m.clearBody();
         }
  
         consumerSess.recover();
View Full Code Here

         StreamMessage sm = null;
         for(int i = 0; i < NUM_MESSAGES; i++)
         {
            sm = (StreamMessage)consumer.receive();
           
            String value = sm.readString();
           
            assertEquals("stream-message", value);
         }
        
         sm.acknowledge();
View Full Code Here

         log.trace("Sent stream messages");
  
         for (int i = 0; i < NUM_MESSAGES; i++)
         {
            StreamMessage m = (StreamMessage)consumer.receive(2000);
            String v = m.readString();
            assertEquals("stream-message", v);
            m.clearProperties();
         }
  
         consumerSess.recover();
View Full Code Here

         StreamMessage sm = null;
         for(int i = 0; i < NUM_MESSAGES; i++)
         {
            sm = (StreamMessage)consumer.receive();
           
            String value = sm.readString();
           
            assertEquals("stream-message", value);
           
            float prop = sm.getFloatProperty("float_property");
            int prop2 = sm.getIntProperty("int_property");
View Full Code Here

                message.readByte();
                fail("Should have received NumberFormatException");
            } catch (NumberFormatException e) {
            }

            assertEquals("This is a test to see how it works.", message.readString());

            // Invalid conversion should throw exception and not move the stream
            // position.
            try {
                message.readByte();
View Full Code Here

         ObjectMessage om2 = (ObjectMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", (String)om2.getObject());

         StreamMessage sm2 = (StreamMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", sm2.readString());

         TextMessage tm2 = (TextMessage)theConsumer.receive(1500);
         ProxyAssertSupport.assertEquals("aardvark", tm2.getText());
      }
      finally
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.