Examples of XBTextMessage


Examples of org.xmlBlaster.jms.XBTextMessage

   public void testTextMessage() {
      try {
         { // 1. key, content and qos all null in constructor
            byte[] content = null;
            XBTextMessage msg = new XBTextMessage(null, content);

            String txt1 = "funny Things happen";
            msg.setText(txt1);
            String txt2 = msg.getText();
            assertEquals("normal text comparison", txt1, txt2);
        
            txt1 = null;
            msg.setText(txt1);
            txt2 = msg.getText();
            assertEquals("normal text comparison", txt1, txt2);
         }
        
         { // 2. content not null in constructor
            XBTextMessage msg = new XBTextMessage(null, "oh I am a text msg".getBytes());

            String txt1 = "funny Things happen";
            msg.setText(txt1);
            String txt2 = msg.getText();
            assertEquals("normal text comparison", txt1, txt2);
        
            txt1 = null;
            msg.setText(txt1);
            txt2 = msg.getText();
            assertEquals("normal text comparison", txt1, txt2);
         }
      }
      catch (Exception ex) {
         ex.printStackTrace();
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.