You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2023/07/20 17:34:01 UTC

[activemq-artemis] branch main updated: NO-JIRA Moving SimpleManagement to test-support

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 9ffe062c41 NO-JIRA Moving SimpleManagement to test-support
9ffe062c41 is described below

commit 9ffe062c412bc6b5a7dbb9878c14b2b035126b70
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Wed Jul 19 10:23:15 2023 -0400

    NO-JIRA Moving SimpleManagement to test-support
---
 .../org/apache/activemq/artemis/cli/commands/AbstractAction.java  | 2 +-
 .../java/org/apache/activemq/artemis/utils}/SimpleManagement.java | 8 ++------
 .../tests/smoke/brokerConnection/MirroredSubscriptionTest.java    | 2 +-
 3 files changed, 4 insertions(+), 8 deletions(-)

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<ClientMessage> 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<Name of Queue, Number of Messages> */
    public static Map<String, Integer> listQueues(String uri, String user, String password, int maxRows) throws Exception {
       Map<String, Integer> 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;