activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [1/6] activemq-artemis git commit: Fix ActiveMQServerControlUsingCoreTest
Date Wed, 04 May 2016 20:55:19 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master bb8d095c1 -> 99acd6883


Fix ActiveMQServerControlUsingCoreTest

When using the "core" control some of the metrics change slightly and
those changes have to be accounted for in the tests.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/170d5c12
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/170d5c12
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/170d5c12

Branch: refs/heads/master
Commit: 170d5c12966173be71c9251e2a80ffb777025145
Parents: bb8d095
Author: jbertram <jbertram@apache.org>
Authored: Wed May 4 14:12:02 2016 -0500
Committer: jbertram <jbertram@apache.org>
Committed: Wed May 4 14:12:22 2016 -0500

----------------------------------------------------------------------
 .../management/ActiveMQServerControlTest.java         | 14 +++++++++-----
 .../ActiveMQServerControlUsingCoreTest.java           |  4 ++++
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/170d5c12/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index b66636a..4a9ca24 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -82,6 +82,10 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
 
    // Public --------------------------------------------------------
 
+   public boolean usingCore() {
+      return false;
+   }
+
    @Test
    public void testGetAttributes() throws Exception {
       ActiveMQServerControl serverControl = createManagementControl();
@@ -923,8 +927,8 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
          createSessionFactory(locator).close();
       }
 
-      assertEquals(CONNECTION_COUNT, serverControl.getTotalConnectionCount());
-      assertEquals(0, serverControl.getConnectionCount());
+      assertEquals(CONNECTION_COUNT + (usingCore() ? 1 : 0), serverControl.getTotalConnectionCount());
+      assertEquals(0 + (usingCore() ? 1 : 0), serverControl.getConnectionCount());
 
       locator.close();
    }
@@ -962,7 +966,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       session.commit();
 
       assertEquals(2, serverControl.getTotalMessagesAdded());
-      assertEquals(0, serverControl.getTotalMessageCount());
+      assertEquals(0 + (usingCore() ? 1 : 0), serverControl.getTotalMessageCount());
 
       consumer1.close();
       consumer2.close();
@@ -1008,7 +1012,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       session.commit();
 
       assertEquals(2, serverControl.getTotalMessagesAcknowledged());
-      assertEquals(0, serverControl.getTotalMessageCount());
+      assertEquals(0  + (usingCore() ? 1 : 0), serverControl.getTotalMessageCount());
 
       consumer1.close();
       consumer2.close();
@@ -1040,7 +1044,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
       ClientConsumer consumer1 = session.createConsumer(random1);
       ClientConsumer consumer2 = session.createConsumer(random2);
 
-      assertEquals(2, serverControl.getTotalConsumerCount());
+      assertEquals(2 + (usingCore() ? 1 : 0), serverControl.getTotalConsumerCount());
       assertEquals(1, queueControl1.getConsumerCount());
       assertEquals(1, queueControl2.getConsumerCount());
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/170d5c12/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index 7fb5a5b..e760b01 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -664,6 +664,10 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
          }
       };
    }
+
+   public boolean usingCore() {
+      return true;
+   }
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------


Mime
View raw message