Commit 00773e2d authored by Andre Freyssinet's avatar Andre Freyssinet
Browse files

Tests issues with JNDI names including '/' (JORAM-356).

parent d03e624e
......@@ -82,6 +82,9 @@ public class BridgeRestTest1 extends TestCase implements MessageListener {
}
}
private final static String foreignQueueName = "foreignQueue";
private final static String acqQueueName = "acqQueue";
private void admin() throws Exception {
javax.jms.ConnectionFactory bridgeCF = TcpConnectionFactory.create("localhost", 16010);
......@@ -92,7 +95,7 @@ public class BridgeRestTest1 extends TestCase implements MessageListener {
User.create("anonymous", "anonymous", 1);
// create The foreign destination and connectionFactory on server 1
Queue foreignQueue = Queue.create(1, "foreignQueue");
Queue foreignQueue = Queue.create(1, foreignQueueName);
foreignQueue.setFreeReading();
foreignQueue.setFreeWriting();
System.out.println("foreign queue = " + foreignQueue);
......@@ -100,7 +103,8 @@ public class BridgeRestTest1 extends TestCase implements MessageListener {
javax.jms.ConnectionFactory foreignCF = TcpConnectionFactory.create("localhost", 16011);
// bind foreign destination and connectionFactory
jndiCtx.rebind("foreignQueue", foreignQueue);
Context tmpCtx = jndiCtx.createSubcontext("tmp");
tmpCtx.rebind(foreignQueueName, foreignQueue);
jndiCtx.rebind("foreignCF", foreignCF);
// Create a REST acquisition queue on server.
......@@ -108,11 +112,11 @@ public class BridgeRestTest1 extends TestCase implements MessageListener {
.setMediaTypeJson(true)
.setTimeout(5000)
.setIdleTimeout(10)
.create(0, "acqQueue", "foreignQueue");
.create(0, acqQueueName, "tmp/" + foreignQueueName);
acqQueue.setFreeReading();
System.out.println("joram acquisition queue = " + acqQueue);
jndiCtx.bind("acqQueue", acqQueue);
jndiCtx.bind(acqQueueName, acqQueue);
jndiCtx.rebind("bridgeCF", bridgeCF);
jndiCtx.close();
......@@ -128,9 +132,9 @@ public class BridgeRestTest1 extends TestCase implements MessageListener {
public void test() throws Exception {
Context jndiCtx = new InitialContext();
ConnectionFactory bridgeCF = (ConnectionFactory) jndiCtx.lookup("bridgeCF");
Destination acqQueue = (Destination) jndiCtx.lookup("acqQueue");
Destination acqQueue = (Destination) jndiCtx.lookup(acqQueueName);
ConnectionFactory foreignCF = (ConnectionFactory) jndiCtx.lookup("foreignCF");
Destination foreignQueue = (Destination) jndiCtx.lookup("foreignQueue");
Destination foreignQueue = (Destination) jndiCtx.lookup("tmp/" + foreignQueueName);
jndiCtx.close();
Connection bridgeCnx = bridgeCF.createConnection();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment