This closes #677
This commit is contained in:
commit
9a9f23e8a5
|
@ -295,6 +295,13 @@ public final class JsonUtil {
|
||||||
return jsonValue.toString();
|
return jsonValue.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (jsonValue instanceof Object[]) {
|
||||||
|
Object[] array = (Object[]) jsonValue;
|
||||||
|
for (int i = 0; i < array.length; i++) {
|
||||||
|
array[i] = convertJsonValue(array[i], desiredType);
|
||||||
|
}
|
||||||
|
return array;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
return jsonValue;
|
return jsonValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ import org.apache.activemq.artemis.core.client.impl.ClientMessageImpl;
|
||||||
* The ClientRequestor constructor is given a ClientSession and a request address.
|
* The ClientRequestor constructor is given a ClientSession and a request address.
|
||||||
* It creates a temporary queue for the responses and provides a request method that sends the request message and waits for its reply.
|
* It creates a temporary queue for the responses and provides a request method that sends the request message and waits for its reply.
|
||||||
*/
|
*/
|
||||||
public final class ClientRequestor {
|
public final class ClientRequestor implements AutoCloseable {
|
||||||
|
|
||||||
private final ClientSession queueSession;
|
private final ClientSession queueSession;
|
||||||
|
|
||||||
|
|
|
@ -16,15 +16,12 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
import java.util.Map;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.AcceptorControl;
|
import org.apache.activemq.artemis.api.core.management.AcceptorControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class AcceptorControlUsingCoreTest extends AcceptorControlTest {
|
public class AcceptorControlUsingCoreTest extends AcceptorControlTest {
|
||||||
|
|
||||||
// Constants -----------------------------------------------------
|
// Constants -----------------------------------------------------
|
||||||
|
@ -37,20 +34,11 @@ public class AcceptorControlUsingCoreTest extends AcceptorControlTest {
|
||||||
|
|
||||||
// AcceptorControlTest overrides --------------------------------
|
// AcceptorControlTest overrides --------------------------------
|
||||||
|
|
||||||
private ClientSession session;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected AcceptorControl createManagementControl(final String name) throws Exception {
|
protected AcceptorControl createManagementControl(final String name) throws Exception {
|
||||||
ServerLocator locator = createInVMNonHALocator();
|
|
||||||
addServerLocator(locator);
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
addClientSession(session);
|
|
||||||
session.start();
|
|
||||||
|
|
||||||
return new AcceptorControl() {
|
return new AcceptorControl() {
|
||||||
|
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_ACCEPTOR + name);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_ACCEPTOR + name);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getFactoryClassName() {
|
public String getFactoryClassName() {
|
||||||
|
|
|
@ -81,6 +81,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
private static boolean contains(final String name, final String[] strings) {
|
private static boolean contains(final String name, final String[] strings) {
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
for (String str : strings) {
|
for (String str : strings) {
|
||||||
|
IntegrationTestLogger.LOGGER.info("Does " + str + " match " + name);
|
||||||
if (name.equals(str)) {
|
if (name.equals(str)) {
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
@ -900,7 +901,14 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
@Test
|
@Test
|
||||||
public void testForceFailover() throws Exception {
|
public void testForceFailover() throws Exception {
|
||||||
ActiveMQServerControl serverControl = createManagementControl();
|
ActiveMQServerControl serverControl = createManagementControl();
|
||||||
serverControl.forceFailover();
|
try {
|
||||||
|
serverControl.forceFailover();
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
if (!usingCore()) {
|
||||||
|
fail(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
assertFalse(server.isStarted());
|
assertFalse(server.isStarted());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,7 +956,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(CONNECTION_COUNT + (usingCore() ? 1 : 0), serverControl.getTotalConnectionCount());
|
assertEquals(CONNECTION_COUNT + (usingCore() ? 1 : 0), serverControl.getTotalConnectionCount());
|
||||||
assertEquals(0 + (usingCore() ? 1 : 0), serverControl.getConnectionCount());
|
assertEquals((usingCore() ? 1 : 0), serverControl.getConnectionCount());
|
||||||
|
|
||||||
locator.close();
|
locator.close();
|
||||||
}
|
}
|
||||||
|
@ -986,7 +994,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
session.commit();
|
session.commit();
|
||||||
|
|
||||||
assertEquals(2, serverControl.getTotalMessagesAdded());
|
assertEquals(2, serverControl.getTotalMessagesAdded());
|
||||||
assertEquals(0 + (usingCore() ? 1 : 0), serverControl.getTotalMessageCount());
|
assertEquals(0, serverControl.getTotalMessageCount());
|
||||||
|
|
||||||
consumer1.close();
|
consumer1.close();
|
||||||
consumer2.close();
|
consumer2.close();
|
||||||
|
@ -1032,7 +1040,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
session.commit();
|
session.commit();
|
||||||
|
|
||||||
assertEquals(2, serverControl.getTotalMessagesAcknowledged());
|
assertEquals(2, serverControl.getTotalMessagesAcknowledged());
|
||||||
assertEquals(0 + (usingCore() ? 1 : 0), serverControl.getTotalMessageCount());
|
assertEquals(0, serverControl.getTotalMessageCount());
|
||||||
|
|
||||||
consumer1.close();
|
consumer1.close();
|
||||||
consumer2.close();
|
consumer2.close();
|
||||||
|
@ -1064,7 +1072,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
ClientConsumer consumer1 = session.createConsumer(random1);
|
ClientConsumer consumer1 = session.createConsumer(random1);
|
||||||
ClientConsumer consumer2 = session.createConsumer(random2);
|
ClientConsumer consumer2 = session.createConsumer(random2);
|
||||||
|
|
||||||
assertEquals(2 + (usingCore() ? 1 : 0), serverControl.getTotalConsumerCount());
|
assertEquals(usingCore() ? 3 : 2, serverControl.getTotalConsumerCount());
|
||||||
assertEquals(1, queueControl1.getConsumerCount());
|
assertEquals(1, queueControl1.getConsumerCount());
|
||||||
assertEquals(1, queueControl2.getConsumerCount());
|
assertEquals(1, queueControl2.getConsumerCount());
|
||||||
|
|
||||||
|
@ -1086,6 +1094,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
|
|
||||||
ServerLocator locator = createInVMNonHALocator();
|
ServerLocator locator = createInVMNonHALocator();
|
||||||
factories.add(createSessionFactory(locator));
|
factories.add(createSessionFactory(locator));
|
||||||
|
Thread.sleep(200);
|
||||||
factories.add(createSessionFactory(locator));
|
factories.add(createSessionFactory(locator));
|
||||||
addClientSession(factories.get(1).createSession());
|
addClientSession(factories.get(1).createSession());
|
||||||
|
|
||||||
|
@ -1093,17 +1102,34 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
IntegrationTestLogger.LOGGER.info(jsonString);
|
IntegrationTestLogger.LOGGER.info(jsonString);
|
||||||
Assert.assertNotNull(jsonString);
|
Assert.assertNotNull(jsonString);
|
||||||
JsonArray array = JsonUtil.readJsonArray(jsonString);
|
JsonArray array = JsonUtil.readJsonArray(jsonString);
|
||||||
Assert.assertEquals(2, array.size());
|
Assert.assertEquals(usingCore() ? 3 : 2, array.size());
|
||||||
JsonObject first;
|
|
||||||
JsonObject second;
|
String key = "creationTime";
|
||||||
if (array.getJsonObject(0).getJsonNumber("creationTime").longValue() < array.getJsonObject(1).getJsonNumber("creationTime").longValue()) {
|
JsonObject[] sorted = new JsonObject[array.size()];
|
||||||
first = array.getJsonObject(0);
|
for (int i = 0; i < array.size(); i++) {
|
||||||
second = array.getJsonObject(1);
|
sorted[i] = array.getJsonObject(i);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
first = array.getJsonObject(1);
|
if (sorted[0].getJsonNumber(key).longValue() > sorted[1].getJsonNumber(key).longValue()) {
|
||||||
second = array.getJsonObject(0);
|
JsonObject o = sorted[1];
|
||||||
|
sorted[1] = sorted[0];
|
||||||
|
sorted[0] = o;
|
||||||
}
|
}
|
||||||
|
if (usingCore()) {
|
||||||
|
if (sorted[1].getJsonNumber(key).longValue() > sorted[2].getJsonNumber(key).longValue()) {
|
||||||
|
JsonObject o = sorted[2];
|
||||||
|
sorted[2] = sorted[1];
|
||||||
|
sorted[1] = o;
|
||||||
|
}
|
||||||
|
if (sorted[0].getJsonNumber(key).longValue() > sorted[1].getJsonNumber(key).longValue()) {
|
||||||
|
JsonObject o = sorted[1];
|
||||||
|
sorted[1] = sorted[0];
|
||||||
|
sorted[0] = o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject first = sorted[0];
|
||||||
|
JsonObject second = sorted[1];
|
||||||
|
|
||||||
Assert.assertTrue(first.getString("connectionID").length() > 0);
|
Assert.assertTrue(first.getString("connectionID").length() > 0);
|
||||||
Assert.assertTrue(first.getString("clientAddress").length() > 0);
|
Assert.assertTrue(first.getString("clientAddress").length() > 0);
|
||||||
|
@ -1186,23 +1212,41 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
|
||||||
server.createQueue(queueName, queueName, null, false, false);
|
server.createQueue(queueName, queueName, null, false, false);
|
||||||
|
|
||||||
addClientConsumer(session.createConsumer(queueName));
|
addClientConsumer(session.createConsumer(queueName));
|
||||||
|
Thread.sleep(200);
|
||||||
addClientConsumer(session2.createConsumer(queueName));
|
addClientConsumer(session2.createConsumer(queueName));
|
||||||
|
|
||||||
String jsonString = serverControl.listAllConsumersAsJSON();
|
String jsonString = serverControl.listAllConsumersAsJSON();
|
||||||
IntegrationTestLogger.LOGGER.info(jsonString);
|
IntegrationTestLogger.LOGGER.info(jsonString);
|
||||||
Assert.assertNotNull(jsonString);
|
Assert.assertNotNull(jsonString);
|
||||||
JsonArray array = JsonUtil.readJsonArray(jsonString);
|
JsonArray array = JsonUtil.readJsonArray(jsonString);
|
||||||
Assert.assertEquals(2, array.size());
|
Assert.assertEquals(usingCore() ? 3 : 2, array.size());
|
||||||
JsonObject first;
|
|
||||||
JsonObject second;
|
String key = "creationTime";
|
||||||
if (array.getJsonObject(0).getJsonNumber("creationTime").longValue() < array.getJsonObject(1).getJsonNumber("creationTime").longValue()) {
|
JsonObject[] sorted = new JsonObject[array.size()];
|
||||||
first = array.getJsonObject(0);
|
for (int i = 0; i < array.size(); i++) {
|
||||||
second = array.getJsonObject(1);
|
sorted[i] = array.getJsonObject(i);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
first = array.getJsonObject(1);
|
if (sorted[0].getJsonNumber(key).longValue() > sorted[1].getJsonNumber(key).longValue()) {
|
||||||
second = array.getJsonObject(0);
|
JsonObject o = sorted[1];
|
||||||
|
sorted[1] = sorted[0];
|
||||||
|
sorted[0] = o;
|
||||||
}
|
}
|
||||||
|
if (usingCore()) {
|
||||||
|
if (sorted[1].getJsonNumber(key).longValue() > sorted[2].getJsonNumber(key).longValue()) {
|
||||||
|
JsonObject o = sorted[2];
|
||||||
|
sorted[2] = sorted[1];
|
||||||
|
sorted[1] = o;
|
||||||
|
}
|
||||||
|
if (sorted[0].getJsonNumber(key).longValue() > sorted[1].getJsonNumber(key).longValue()) {
|
||||||
|
JsonObject o = sorted[1];
|
||||||
|
sorted[1] = sorted[0];
|
||||||
|
sorted[0] = o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject first = sorted[0];
|
||||||
|
JsonObject second = sorted[1];
|
||||||
|
|
||||||
Assert.assertTrue(first.getJsonNumber("creationTime").longValue() > 0);
|
Assert.assertTrue(first.getJsonNumber("creationTime").longValue() > 0);
|
||||||
Assert.assertNotNull(first.getJsonNumber("consumerID").longValue());
|
Assert.assertNotNull(first.getJsonNumber("consumerID").longValue());
|
||||||
|
|
|
@ -16,13 +16,9 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
|
import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.Parameter;
|
import org.apache.activemq.artemis.api.core.management.Parameter;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.junit.Before;
|
|
||||||
|
|
||||||
public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTest {
|
public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTest {
|
||||||
|
|
||||||
|
@ -46,33 +42,6 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
|
|
||||||
// ActiveMQServerControlTest overrides --------------------------
|
// ActiveMQServerControlTest overrides --------------------------
|
||||||
|
|
||||||
private ClientSession session;
|
|
||||||
private ServerLocator locator;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
locator = createInVMNonHALocator();
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
session.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void restartServer() throws Exception {
|
|
||||||
session.close();
|
|
||||||
|
|
||||||
super.restartServer();
|
|
||||||
|
|
||||||
ServerLocator locator = createInVMNonHALocator();
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
session.start();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// the core messaging proxy doesn't work when the server is stopped so we cant run these 2 tests
|
// the core messaging proxy doesn't work when the server is stopped so we cant run these 2 tests
|
||||||
@Override
|
@Override
|
||||||
public void testScaleDownWithOutConnector() throws Exception {
|
public void testScaleDownWithOutConnector() throws Exception {
|
||||||
|
@ -95,7 +64,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_SERVER);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_SERVER);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSharedStore() {
|
public boolean isSharedStore() {
|
||||||
|
@ -225,7 +194,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getQueueNames() {
|
public String[] getQueueNames() {
|
||||||
return ActiveMQServerControlUsingCoreTest.toStringArray((Object[]) proxy.retrieveAttributeValue("queueNames"));
|
return ActiveMQServerControlUsingCoreTest.toStringArray((Object[]) proxy.retrieveAttributeValue("queueNames", String.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -304,7 +273,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMessageCounterMaxDayCount() {
|
public int getMessageCounterMaxDayCount() {
|
||||||
return (Integer) proxy.retrieveAttributeValue("messageCounterMaxDayCount");
|
return (Integer) proxy.retrieveAttributeValue("messageCounterMaxDayCount", Integer.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -708,7 +677,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String listConsumersAsJSON(String connectionID) throws Exception {
|
public String listConsumersAsJSON(String connectionID) throws Exception {
|
||||||
return (String) proxy.invokeOperation("listConsumersAsJSON");
|
return (String) proxy.invokeOperation("listConsumersAsJSON", connectionID);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -723,7 +692,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String listSessionsAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception {
|
public String listSessionsAsJSON(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception {
|
||||||
return (String) proxy.invokeOperation("listSessionsAsJSON");
|
return (String) proxy.invokeOperation("listSessionsAsJSON", connectionID);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,10 @@ public class AddressControlUsingCoreTest extends ManagementTestBase {
|
||||||
|
|
||||||
private ActiveMQServer server;
|
private ActiveMQServer server;
|
||||||
|
|
||||||
|
private ServerLocator locator;
|
||||||
|
|
||||||
|
private ClientSessionFactory sf;
|
||||||
|
|
||||||
protected ClientSession session;
|
protected ClientSession session;
|
||||||
|
|
||||||
// Static --------------------------------------------------------
|
// Static --------------------------------------------------------
|
||||||
|
@ -165,14 +169,14 @@ public class AddressControlUsingCoreTest extends ManagementTestBase {
|
||||||
server.setMBeanServer(mbeanServer);
|
server.setMBeanServer(mbeanServer);
|
||||||
server.start();
|
server.start();
|
||||||
|
|
||||||
ServerLocator locator = createInVMNonHALocator().setBlockOnNonDurableSend(true);
|
locator = createInVMNonHALocator().setBlockOnNonDurableSend(true);
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
sf = createSessionFactory(locator);
|
||||||
session = sf.createSession(false, true, false);
|
session = sf.createSession(false, true, false);
|
||||||
session.start();
|
session.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CoreMessagingProxy createProxy(final SimpleString address) throws Exception {
|
protected CoreMessagingProxy createProxy(final SimpleString address) throws Exception {
|
||||||
CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_ADDRESS + address);
|
CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_ADDRESS + address);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,13 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
|
import javax.management.MBeanServerFactory;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.TransportConfiguration;
|
import org.apache.activemq.artemis.api.core.TransportConfiguration;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
|
import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.apache.activemq.artemis.core.config.BridgeConfiguration;
|
import org.apache.activemq.artemis.core.config.BridgeConfiguration;
|
||||||
|
@ -35,12 +38,6 @@ import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import javax.management.MBeanServerFactory;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class BridgeControlUsingCoreTest extends ManagementTestBase {
|
public class BridgeControlUsingCoreTest extends ManagementTestBase {
|
||||||
|
|
||||||
// Constants -----------------------------------------------------
|
// Constants -----------------------------------------------------
|
||||||
|
@ -53,8 +50,6 @@ public class BridgeControlUsingCoreTest extends ManagementTestBase {
|
||||||
|
|
||||||
private ActiveMQServer server_1;
|
private ActiveMQServer server_1;
|
||||||
|
|
||||||
private ClientSession session;
|
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
|
||||||
// Public --------------------------------------------------------
|
// Public --------------------------------------------------------
|
||||||
|
@ -69,10 +64,10 @@ public class BridgeControlUsingCoreTest extends ManagementTestBase {
|
||||||
Assert.assertEquals(bridgeConfig.getQueueName(), proxy.retrieveAttributeValue("queueName"));
|
Assert.assertEquals(bridgeConfig.getQueueName(), proxy.retrieveAttributeValue("queueName"));
|
||||||
Assert.assertEquals(bridgeConfig.getForwardingAddress(), proxy.retrieveAttributeValue("forwardingAddress"));
|
Assert.assertEquals(bridgeConfig.getForwardingAddress(), proxy.retrieveAttributeValue("forwardingAddress"));
|
||||||
Assert.assertEquals(bridgeConfig.getFilterString(), proxy.retrieveAttributeValue("filterString"));
|
Assert.assertEquals(bridgeConfig.getFilterString(), proxy.retrieveAttributeValue("filterString"));
|
||||||
Assert.assertEquals(bridgeConfig.getRetryInterval(), ((Long) proxy.retrieveAttributeValue("retryInterval")).longValue());
|
Assert.assertEquals(bridgeConfig.getRetryInterval(), proxy.retrieveAttributeValue("retryInterval", Long.class));
|
||||||
Assert.assertEquals(bridgeConfig.getRetryIntervalMultiplier(), proxy.retrieveAttributeValue("retryIntervalMultiplier"));
|
Assert.assertEquals(bridgeConfig.getRetryIntervalMultiplier(), proxy.retrieveAttributeValue("retryIntervalMultiplier", Double.class));
|
||||||
Assert.assertEquals(bridgeConfig.getReconnectAttempts(), ((Integer) proxy.retrieveAttributeValue("reconnectAttempts")).intValue());
|
Assert.assertEquals(bridgeConfig.getReconnectAttempts(), proxy.retrieveAttributeValue("reconnectAttempts", Integer.class));
|
||||||
Assert.assertEquals(bridgeConfig.isUseDuplicateDetection(), ((Boolean) proxy.retrieveAttributeValue("useDuplicateDetection")).booleanValue());
|
Assert.assertEquals(bridgeConfig.isUseDuplicateDetection(), proxy.retrieveAttributeValue("useDuplicateDetection", Boolean.class));
|
||||||
|
|
||||||
Object[] data = (Object[]) proxy.retrieveAttributeValue("staticConnectors");
|
Object[] data = (Object[]) proxy.retrieveAttributeValue("staticConnectors");
|
||||||
Assert.assertEquals(bridgeConfig.getStaticConnectors().get(0), data[0]);
|
Assert.assertEquals(bridgeConfig.getStaticConnectors().get(0), data[0]);
|
||||||
|
@ -125,14 +120,10 @@ public class BridgeControlUsingCoreTest extends ManagementTestBase {
|
||||||
|
|
||||||
server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
|
server_0 = addServer(ActiveMQServers.newActiveMQServer(conf_0, mbeanServer, false));
|
||||||
server_0.start();
|
server_0.start();
|
||||||
ServerLocator locator = createInVMNonHALocator();
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = addClientSession(sf.createSession(false, true, true));
|
|
||||||
session.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected CoreMessagingProxy createProxy(final String name) throws Exception {
|
protected CoreMessagingProxy createProxy(final String name) throws Exception {
|
||||||
CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_BRIDGE + name);
|
CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_BRIDGE + name);
|
||||||
|
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,6 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.BroadcastGroupControl;
|
import org.apache.activemq.artemis.api.core.management.BroadcastGroupControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
|
|
||||||
|
@ -26,17 +23,12 @@ public class BroadcastGroupControlUsingCoreTest extends BroadcastGroupControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected BroadcastGroupControl createManagementControl(final String name) throws Exception {
|
protected BroadcastGroupControl createManagementControl(final String name) throws Exception {
|
||||||
ServerLocator locator = createInVMNonHALocator();
|
|
||||||
ClientSessionFactory sf = addSessionFactory(createSessionFactory(locator));
|
|
||||||
final ClientSession session = addClientSession(sf.createSession(false, true, true));
|
|
||||||
session.start();
|
|
||||||
|
|
||||||
return new BroadcastGroupControl() {
|
return new BroadcastGroupControl() {
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_BROADCAST_GROUP + name);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_BROADCAST_GROUP + name);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getBroadcastPeriod() {
|
public long getBroadcastPeriod() {
|
||||||
return ((Integer) proxy.retrieveAttributeValue("broadcastPeriod")).longValue();
|
return (Long) proxy.retrieveAttributeValue("broadcastPeriod", Long.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,12 +48,12 @@ public class BroadcastGroupControlUsingCoreTest extends BroadcastGroupControlTes
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getGroupPort() {
|
public int getGroupPort() {
|
||||||
return (Integer) proxy.retrieveAttributeValue("groupPort");
|
return (Integer) proxy.retrieveAttributeValue("groupPort", Integer.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLocalBindPort() {
|
public int getLocalBindPort() {
|
||||||
return (Integer) proxy.retrieveAttributeValue("localBindPort");
|
return (Integer) proxy.retrieveAttributeValue("localBindPort", Integer.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -16,14 +16,10 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
import java.util.Map;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.ClusterConnectionControl;
|
import org.apache.activemq.artemis.api.core.management.ClusterConnectionControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.junit.Before;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionControlTest {
|
public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionControlTest {
|
||||||
|
|
||||||
|
@ -31,9 +27,6 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
// Attributes ----------------------------------------------------
|
// Attributes ----------------------------------------------------
|
||||||
|
|
||||||
private ClientSession session;
|
|
||||||
private ServerLocator locator;
|
|
||||||
|
|
||||||
// Static --------------------------------------------------------
|
// Static --------------------------------------------------------
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
@ -42,12 +35,8 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ClusterConnectionControl createManagementControl(final String name) throws Exception {
|
protected ClusterConnectionControl createManagementControl(final String name) throws Exception {
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
session.start();
|
|
||||||
|
|
||||||
return new ClusterConnectionControl() {
|
return new ClusterConnectionControl() {
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_CLUSTER_CONNECTION + name);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_CLUSTER_CONNECTION + name);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object[] getStaticConnectors() {
|
public Object[] getStaticConnectors() {
|
||||||
|
@ -71,12 +60,12 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxHops() {
|
public int getMaxHops() {
|
||||||
return (Integer) proxy.retrieveAttributeValue("maxHops");
|
return (Integer) proxy.retrieveAttributeValue("maxHops", Integer.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public long getRetryInterval() {
|
public long getRetryInterval() {
|
||||||
return (Long) proxy.retrieveAttributeValue("retryInterval");
|
return (Long) proxy.retrieveAttributeValue("retryInterval", Long.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -91,7 +80,7 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isDuplicateDetection() {
|
public boolean isDuplicateDetection() {
|
||||||
return (Boolean) proxy.retrieveAttributeValue("duplicateDetection");
|
return (Boolean) proxy.retrieveAttributeValue("duplicateDetection", Boolean.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -111,7 +100,7 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isStarted() {
|
public boolean isStarted() {
|
||||||
return (Boolean) proxy.retrieveAttributeValue("started");
|
return (Boolean) proxy.retrieveAttributeValue("started", Boolean.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -133,14 +122,6 @@ public class ClusterConnectionControlUsingCoreTest extends ClusterConnectionCont
|
||||||
|
|
||||||
// Protected -----------------------------------------------------
|
// Protected -----------------------------------------------------
|
||||||
|
|
||||||
@Override
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
locator = createInVMNonHALocator();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Private -------------------------------------------------------
|
// Private -------------------------------------------------------
|
||||||
|
|
||||||
// Inner classes -------------------------------------------------
|
// Inner classes -------------------------------------------------
|
||||||
|
|
|
@ -17,9 +17,12 @@
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
|
||||||
|
import org.apache.activemq.artemis.api.core.ActiveMQException;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
import org.apache.activemq.artemis.api.core.client.ClientMessage;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientRequestor;
|
import org.apache.activemq.artemis.api.core.client.ClientRequestor;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
||||||
|
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
||||||
|
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
||||||
import org.apache.activemq.artemis.api.core.management.ManagementHelper;
|
import org.apache.activemq.artemis.api.core.management.ManagementHelper;
|
||||||
|
|
||||||
public class CoreMessagingProxy {
|
public class CoreMessagingProxy {
|
||||||
|
@ -30,21 +33,16 @@ public class CoreMessagingProxy {
|
||||||
|
|
||||||
private final String resourceName;
|
private final String resourceName;
|
||||||
|
|
||||||
private final ClientSession session;
|
private final ServerLocator locator;
|
||||||
|
|
||||||
private final ClientRequestor requestor;
|
|
||||||
|
|
||||||
// Static --------------------------------------------------------
|
// Static --------------------------------------------------------
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
|
||||||
public CoreMessagingProxy(final ClientSession session, final String resourceName) throws Exception {
|
public CoreMessagingProxy(final ServerLocator locator, final String resourceName) throws Exception {
|
||||||
this.session = session;
|
this.locator = locator;
|
||||||
|
|
||||||
this.resourceName = resourceName;
|
this.resourceName = resourceName;
|
||||||
|
|
||||||
requestor = new ClientRequestor(session, ActiveMQDefaultConfiguration.getDefaultManagementAddress());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public --------------------------------------------------------
|
// Public --------------------------------------------------------
|
||||||
|
@ -58,10 +56,12 @@ public class CoreMessagingProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object retrieveAttributeValue(final String attributeName, final Class desiredType) {
|
public Object retrieveAttributeValue(final String attributeName, final Class desiredType) {
|
||||||
ClientMessage m = session.createMessage(false);
|
try (ClientSessionFactory sessionFactory = locator.createSessionFactory();
|
||||||
ManagementHelper.putAttribute(m, resourceName, attributeName);
|
ClientSession session = getSession(sessionFactory);
|
||||||
ClientMessage reply;
|
ClientRequestor requestor = getClientRequestor(session)) {
|
||||||
try {
|
ClientMessage m = session.createMessage(false);
|
||||||
|
ManagementHelper.putAttribute(m, resourceName, attributeName);
|
||||||
|
ClientMessage reply;
|
||||||
reply = requestor.request(m);
|
reply = requestor.request(m);
|
||||||
Object result = ManagementHelper.getResult(reply, desiredType);
|
Object result = ManagementHelper.getResult(reply, desiredType);
|
||||||
|
|
||||||
|
@ -77,24 +77,38 @@ public class CoreMessagingProxy {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object invokeOperation(final Class desiredType, final String operationName, final Object... args) throws Exception {
|
public Object invokeOperation(final Class desiredType, final String operationName, final Object... args) throws Exception {
|
||||||
ClientMessage m = session.createMessage(false);
|
try (ClientSessionFactory sessionFactory = locator.createSessionFactory();
|
||||||
ManagementHelper.putOperationInvocation(m, resourceName, operationName, args);
|
ClientSession session = getSession(sessionFactory);
|
||||||
ClientMessage reply = requestor.request(m);
|
ClientRequestor requestor = getClientRequestor(session)) {
|
||||||
if (reply != null) {
|
ClientMessage m = session.createMessage(false);
|
||||||
if (ManagementHelper.hasOperationSucceeded(reply)) {
|
ManagementHelper.putOperationInvocation(m, resourceName, operationName, args);
|
||||||
return ManagementHelper.getResult(reply, desiredType);
|
ClientMessage reply = requestor.request(m);
|
||||||
|
if (reply != null) {
|
||||||
|
if (ManagementHelper.hasOperationSucceeded(reply)) {
|
||||||
|
return ManagementHelper.getResult(reply, desiredType);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new Exception((String) ManagementHelper.getResult(reply));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new Exception((String) ManagementHelper.getResult(reply));
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private -------------------------------------------------------
|
// Private -------------------------------------------------------
|
||||||
|
|
||||||
|
private ClientSession getSession(ClientSessionFactory sessionFactory) throws ActiveMQException {
|
||||||
|
ClientSession session = sessionFactory.createSession(false, true, true);
|
||||||
|
session.start();
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
|
||||||
|
private ClientRequestor getClientRequestor(ClientSession session) throws Exception {
|
||||||
|
return new ClientRequestor(session, ActiveMQDefaultConfiguration.getDefaultManagementAddress());
|
||||||
|
}
|
||||||
|
|
||||||
// Inner classes -------------------------------------------------
|
// Inner classes -------------------------------------------------
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,12 +16,8 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.DivertControl;
|
import org.apache.activemq.artemis.api.core.management.DivertControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.junit.Before;
|
|
||||||
|
|
||||||
public class DivertControlUsingCoreTest extends DivertControlTest {
|
public class DivertControlUsingCoreTest extends DivertControlTest {
|
||||||
|
|
||||||
|
@ -29,9 +25,6 @@ public class DivertControlUsingCoreTest extends DivertControlTest {
|
||||||
|
|
||||||
// Attributes ----------------------------------------------------
|
// Attributes ----------------------------------------------------
|
||||||
|
|
||||||
private ClientSession session;
|
|
||||||
private ServerLocator locator;
|
|
||||||
|
|
||||||
// Static --------------------------------------------------------
|
// Static --------------------------------------------------------
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
@ -40,12 +33,8 @@ public class DivertControlUsingCoreTest extends DivertControlTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected DivertControl createManagementControl(final String name) throws Exception {
|
protected DivertControl createManagementControl(final String name) throws Exception {
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
session.start();
|
|
||||||
|
|
||||||
return new DivertControl() {
|
return new DivertControl() {
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_DIVERT + name);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_DIVERT + name);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAddress() {
|
public String getAddress() {
|
||||||
|
@ -91,14 +80,6 @@ public class DivertControlUsingCoreTest extends DivertControlTest {
|
||||||
|
|
||||||
// Protected -----------------------------------------------------
|
// Protected -----------------------------------------------------
|
||||||
|
|
||||||
@Override
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
locator = createInVMNonHALocator();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Private -------------------------------------------------------
|
// Private -------------------------------------------------------
|
||||||
|
|
||||||
// Inner classes -------------------------------------------------
|
// Inner classes -------------------------------------------------
|
||||||
|
|
|
@ -16,29 +16,21 @@
|
||||||
*/
|
*/
|
||||||
package org.apache.activemq.artemis.tests.integration.management;
|
package org.apache.activemq.artemis.tests.integration.management;
|
||||||
|
|
||||||
|
import javax.management.openmbean.CompositeData;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.activemq.artemis.api.core.SimpleString;
|
import org.apache.activemq.artemis.api.core.SimpleString;
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSession;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ClientSessionFactory;
|
|
||||||
import org.apache.activemq.artemis.api.core.client.ServerLocator;
|
|
||||||
import org.apache.activemq.artemis.api.core.management.QueueControl;
|
import org.apache.activemq.artemis.api.core.management.QueueControl;
|
||||||
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
import org.apache.activemq.artemis.api.core.management.ResourceNames;
|
||||||
import org.junit.Before;
|
|
||||||
|
|
||||||
import javax.management.openmbean.CompositeData;
|
|
||||||
|
|
||||||
public class QueueControlUsingCoreTest extends QueueControlTest {
|
public class QueueControlUsingCoreTest extends QueueControlTest {
|
||||||
|
|
||||||
protected ClientSession session;
|
|
||||||
private ServerLocator locator;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected QueueControl createManagementControl(final SimpleString address,
|
protected QueueControl createManagementControl(final SimpleString address,
|
||||||
final SimpleString queue) throws Exception {
|
final SimpleString queue) throws Exception {
|
||||||
return new QueueControl() {
|
return new QueueControl() {
|
||||||
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_QUEUE + queue);
|
private final CoreMessagingProxy proxy = new CoreMessagingProxy(addServerLocator(createInVMNonHALocator()), ResourceNames.CORE_QUEUE + queue);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void flushExecutor() {
|
public void flushExecutor() {
|
||||||
|
@ -395,15 +387,4 @@ public class QueueControlUsingCoreTest extends QueueControlTest {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
@Before
|
|
||||||
public void setUp() throws Exception {
|
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
locator = createInVMNonHALocator();
|
|
||||||
ClientSessionFactory sf = createSessionFactory(locator);
|
|
||||||
session = sf.createSession(false, true, true);
|
|
||||||
session.start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue