Examples of XBBytesMessage


Examples of org.xmlBlaster.jms.XBBytesMessage

            byte[] buf1 = baos.toByteArray();
            assertEquals("Wrong size of output buffer", buf.length, buf1.length);
         }
         { // 1. key, content and qos all null in constructor
            byte[] content = null;
            XBBytesMessage msg = new XBBytesMessage(null, content);
           
            content = new byte[256];
            for (int i=0; i < 256; i++) {
               content[i] = (byte)i;
            }
           
            msg.writeBytes(content, 0, content.length);
            XBDestination dest = new XBDestination("someTopic", null);
            msg.setJMSDestination(dest);
            msg.reset();
           
            byte[] content2 = new byte[256];
            msg.readBytes(content2);
            for (int i=0; i < content.length; i++)
               assertEquals("byte nr. '" + i + "' is wrong", content[i], content2[i]);
         }
         { // 1. key, content and qos all null in constructor
            byte[] content = null;
            XBBytesMessage msg = new XBBytesMessage(null, content);
           
            content = new byte[256];
            for (int i=0; i < 256; i++) {
               content[i] = (byte)i;
            }
           
            msg.writeBytes(content, 0, content.length);
            XBDestination dest = new XBDestination("someTopic", null);
            msg.setJMSDestination(dest);
            msg.reset();
            MsgUnit msgUnit = MessageHelper.convertToMessageUnit(new Global(), msg);
           
            byte[] content2 = msgUnit.getContent();
            assertEquals("Wrong length", content.length, content2.length);
            msg.readBytes(content2);
            for (int i=0; i < content.length; i++)
               assertEquals("byte nr. '" + i + "' is wrong", content[i], content2[i]);
         }
      }
      catch (Exception ex) {
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.