From 9ffe062c412bc6b5a7dbb9878c14b2b035126b70 Mon Sep 17 00:00:00 2001 From: Clebert Suconic Date: Wed, 19 Jul 2023 10:23:15 -0400 Subject: [PATCH] NO-JIRA Moving SimpleManagement to test-support --- .../activemq/artemis/cli/commands/AbstractAction.java | 2 +- .../apache/activemq/artemis/utils}/SimpleManagement.java | 8 ++------ .../smoke/brokerConnection/MirroredSubscriptionTest.java | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) rename tests/{smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common => artemis-test-support/src/main/java/org/apache/activemq/artemis/utils}/SimpleManagement.java (94%) diff --git a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java index 3eebaf4e2c..5c4662d18a 100644 --- a/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java +++ b/artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AbstractAction.java @@ -27,7 +27,7 @@ import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory; public abstract class AbstractAction extends ConnectionAbstract { - // TODO: This call could be replaced by a direct call into ManagementHelpr.doManagement and their lambdas + // TODO: This call could be replaced by a direct call into ManagementHelper.doManagement and their lambdas public void performCoreManagement(ManagementCallback cb) throws Exception { try (ActiveMQConnectionFactory factory = createCoreConnectionFactory(); ServerLocator locator = factory.getServerLocator(); diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SimpleManagement.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/SimpleManagement.java similarity index 94% rename from tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SimpleManagement.java rename to tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/SimpleManagement.java index 5b9a34b2df..144224ab9b 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/common/SimpleManagement.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/utils/SimpleManagement.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.activemq.artemis.tests.smoke.common; +package org.apache.activemq.artemis.utils; import java.util.HashMap; import java.util.Map; @@ -30,7 +30,6 @@ public class SimpleManagement { private static final String SIMPLE_OPTIONS = "{\"field\":\"\",\"value\":\"\",\"operation\":\"\"}"; - /** Simple management function that will return a list of Pair */ public static Map listQueues(String uri, String user, String password, int maxRows) throws Exception { Map queues = new HashMap<>(); ManagementHelper.doManagement(uri, user, password, t -> setupListQueue(t, maxRows), t -> listQueueResult(t, queues), SimpleManagement::failed); @@ -45,7 +44,6 @@ public class SimpleManagement { final String result = (String) ManagementHelper.getResult(message, String.class); - JsonObject queuesAsJsonObject = JsonUtil.readJsonObject(result); JsonArray array = queuesAsJsonObject.getJsonArray("data"); @@ -55,7 +53,6 @@ public class SimpleManagement { String messageCount = object.getString("messageCount"); mapQueues.put(name, Integer.parseInt(messageCount)); } - } private static void failed(ClientMessage message) throws Exception { @@ -64,5 +61,4 @@ public class SimpleManagement { throw new Exception("Failed " + result); } - -} +} \ No newline at end of file diff --git a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java index f82817a15d..bbcf47ab3c 100644 --- a/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java +++ b/tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/brokerConnection/MirroredSubscriptionTest.java @@ -32,10 +32,10 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.activemq.artemis.tests.smoke.common.SimpleManagement; import org.apache.activemq.artemis.tests.smoke.common.SmokeTestBase; import org.apache.activemq.artemis.tests.util.CFUtil; import org.apache.activemq.artemis.util.ServerUtil; +import org.apache.activemq.artemis.utils.SimpleManagement; import org.apache.activemq.artemis.utils.Wait; import org.junit.Assert; import org.junit.Before;