Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
joram
joram
Commits
00773e2d
Commit
00773e2d
authored
Jun 18, 2020
by
Andre Freyssinet
Browse files
Tests issues with JNDI names including '/' (JORAM-356).
parent
d03e624e
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/src/joram/bridgerest/BridgeRestTest1.java
View file @
00773e2d
...
...
@@ -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
,
foreignQueue
Name
);
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
,
acqQueue
Name
,
"tmp/"
+
foreignQueue
Name
);
acqQueue
.
setFreeReading
();
System
.
out
.
println
(
"joram acquisition queue = "
+
acqQueue
);
jndiCtx
.
bind
(
"
acqQueue
"
,
acqQueue
);
jndiCtx
.
bind
(
acqQueue
Name
,
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
(
acqQueue
Name
);
ConnectionFactory
foreignCF
=
(
ConnectionFactory
)
jndiCtx
.
lookup
(
"foreignCF"
);
Destination
foreignQueue
=
(
Destination
)
jndiCtx
.
lookup
(
"foreignQueue
"
);
Destination
foreignQueue
=
(
Destination
)
jndiCtx
.
lookup
(
"
tmp/"
+
foreignQueue
Name
);
jndiCtx
.
close
();
Connection
bridgeCnx
=
bridgeCF
.
createConnection
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment