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)) {