Examples of JcrMessageURIGenerator


Examples of org.jboss.internal.soa.esb.message.urigen.JcrMessageURIGenerator

    private static Logger logger = Logger.getLogger(JcrMessageURIGeneratorUnitTest.class);
    private static int MAX_COUNT = 10;
 
  public void testUniqueness() {
    Hashtable<URI, String> hash = new Hashtable<URI, String>();
    JcrMessageURIGenerator jmurig = new JcrMessageURIGenerator();
    Message msg1 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
   
    msg1.getBody().add("bar");
    try {
      msg1.getHeader().getCall().setTo(new HTTPEpr("http://foo.bar"));
      msg1.getHeader().getCall().setMessageID(new URI("urn:1234"));
    } catch (URISyntaxException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }
   
    for (int i = 0 ; i < MAX_COUNT; i++) {
      URI uuid = null;
      try {
        uuid = jmurig.generateMessageURI(msg1);
      } catch (URIGenerationException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      if (!hash.contains(uuid)) {
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.