Author: jbertram
Date: 2012-02-20 20:42:02 -0500 (Mon, 20 Feb 2012)
New Revision: 12152
Modified:
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/inflow/HornetQActivation.java
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
Log:
HORNETQ-862
Modified:
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/inflow/HornetQActivation.java
===================================================================
---
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/inflow/HornetQActivation.java 2012-02-20
22:43:16 UTC (rev 12151)
+++
trunk/hornetq-ra/hornetq-ra-jar/src/main/java/org/hornetq/ra/inflow/HornetQActivation.java 2012-02-21
01:42:02 UTC (rev 12152)
@@ -368,6 +368,14 @@
spec.isUseLocalTx(),
spec.getTransactionTimeout());
+ result.addMetaData("resource-adapter", "inbound");
+ result.addMetaData("jms-session", "");
+ String clientID = ra.getClientID() == null?spec.getClientID():ra.getClientID();
+ if (clientID != null)
+ {
+ result.addMetaData("jms-client-id", clientID);
+ }
+
HornetQActivation.log.debug("Using queue connection " + result);
return result;
Modified:
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
---
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2012-02-20
22:43:16 UTC (rev 12151)
+++
trunk/tests/integration-tests/src/test/java/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2012-02-21
01:42:02 UTC (rev 12152)
@@ -476,6 +476,9 @@
public void testStartActivationListConnections() throws Exception
{
+ HornetQActivation activation = null;
+ HornetQResourceAdapter ra = null;
+
try
{
startHornetQServer(InVMAcceptorFactory.class.getName());
@@ -484,7 +487,7 @@
JMSServerControl control = createManagementControl();
- HornetQResourceAdapter ra = new HornetQResourceAdapter();
+ ra = new HornetQResourceAdapter();
ra.setConnectorClassName("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
ra.setUserName("userGlobal");
@@ -504,13 +507,13 @@
spec.setPassword("password");
- spec.setDestinationType("Topic");
+ spec.setDestinationType("Queue");
spec.setDestination("test");
spec.setMinSession(1);
spec.setMaxSession(1);
- HornetQActivation activation = new HornetQActivation(ra, new
MessageEndpointFactory(), spec);
+ activation = new HornetQActivation(ra, new MessageEndpointFactory(), spec);
activation.start();
@@ -523,14 +526,15 @@
assertEquals("user", jmsConnectionInfos[0].getUsername());
assertEquals("my-client-id", jmsConnectionInfos[0].getClientID());
-
- activation.stop();
-
- ra.stop();
-
}
finally
{
+ if (activation != null)
+ activation.stop();
+
+ if(ra != null)
+ ra.stop();
+
try
{
/*if (connection != null)
@@ -558,6 +562,9 @@
public void testStartActivationOverrideListConnections() throws Exception
{
+ HornetQActivation activation = null;
+ HornetQResourceAdapter ra = null;
+
try
{
startHornetQServer(InVMAcceptorFactory.class.getName());
@@ -566,7 +573,7 @@
JMSServerControl control = createManagementControl();
- HornetQResourceAdapter ra = new HornetQResourceAdapter();
+ ra = new HornetQResourceAdapter();
ra.setConnectorClassName("org.hornetq.core.remoting.impl.invm.InVMConnectorFactory");
ra.setUserName("userGlobal");
@@ -588,13 +595,13 @@
spec.setUser("user");
spec.setPassword("password");
- spec.setDestinationType("Topic");
+ spec.setDestinationType("Queue");
spec.setDestination("test");
spec.setMinSession(1);
spec.setMaxSession(1);
- HornetQActivation activation = new HornetQActivation(ra, new
MessageEndpointFactory(), spec);
+ activation = new HornetQActivation(ra, new MessageEndpointFactory(), spec);
activation.start();
@@ -607,14 +614,15 @@
assertEquals("user", jmsConnectionInfos[0].getUsername());
assertEquals("my-client-id", jmsConnectionInfos[0].getClientID());
-
- activation.stop();
-
- ra.stop();
-
}
finally
{
+ if (activation != null)
+ activation.stop();
+
+ if(ra != null)
+ ra.stop();
+
try
{
/*if (connection != null)
Show replies by date