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 2016/08/02 18:23:40 UTC

[1/2] activemq-artemis git commit: Fix AcceptorControlUsingCoreTest

Repository: activemq-artemis
Updated Branches:
  refs/heads/master 4cecc9575 -> e24f59838


Fix AcceptorControlUsingCoreTest


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

Branch: refs/heads/master
Commit: a69ce7bc813631a953b81800c2ce62717356bf18
Parents: 4cecc95
Author: jbertram <jb...@apache.org>
Authored: Tue Aug 2 12:56:01 2016 -0500
Committer: jbertram <jb...@apache.org>
Committed: Tue Aug 2 12:56:01 2016 -0500

----------------------------------------------------------------------
 .../management/AcceptorControlTest.java         | 22 +++++++++++++-------
 .../AcceptorControlUsingCoreTest.java           |  5 +++++
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a69ce7bc/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
index a6b4a82..1414234 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlTest.java
@@ -17,6 +17,7 @@
 package org.apache.activemq.artemis.tests.integration.management;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
+import org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory;
 import org.apache.activemq.artemis.tests.integration.SimpleNotificationService;
 import org.apache.activemq.artemis.utils.RandomUtil;
 import org.junit.Test;
@@ -43,6 +44,10 @@ public class AcceptorControlTest extends ManagementTestBase {
 
    // Public --------------------------------------------------------
 
+   public boolean usingCore() {
+      return false;
+   }
+
    @Test
    public void testAttributes() throws Exception {
       TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
@@ -113,12 +118,13 @@ public class AcceptorControlTest extends ManagementTestBase {
    @Test
    public void testNotifications() throws Exception {
       TransportConfiguration acceptorConfig = new TransportConfiguration(InVMAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
-      Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig);
+      TransportConfiguration acceptorConfig2 = new TransportConfiguration(NettyAcceptorFactory.class.getName(), new HashMap<String, Object>(), RandomUtil.randomString());
+      Configuration config = createBasicConfig().addAcceptorConfiguration(acceptorConfig).addAcceptorConfiguration(acceptorConfig2);
       ActiveMQServer service = createServer(false, config);
       service.setMBeanServer(mbeanServer);
       service.start();
 
-      AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());
+      AcceptorControl acceptorControl = createManagementControl(acceptorConfig2.getName());
 
       SimpleNotificationService.Listener notifListener = new SimpleNotificationService.Listener();
 
@@ -128,17 +134,17 @@ public class AcceptorControlTest extends ManagementTestBase {
 
       acceptorControl.stop();
 
-      Assert.assertEquals(1, notifListener.getNotifications().size());
-      Notification notif = notifListener.getNotifications().get(0);
+      Assert.assertEquals(usingCore() ? 5 : 1, notifListener.getNotifications().size());
+      Notification notif = notifListener.getNotifications().get(usingCore() ? 2 : 0);
       Assert.assertEquals(CoreNotificationType.ACCEPTOR_STOPPED, notif.getType());
-      Assert.assertEquals(InVMAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
+      Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
 
       acceptorControl.start();
 
-      Assert.assertEquals(2, notifListener.getNotifications().size());
-      notif = notifListener.getNotifications().get(1);
+      Assert.assertEquals(usingCore() ? 10 : 2, notifListener.getNotifications().size());
+      notif = notifListener.getNotifications().get(usingCore() ? 7 : 1);
       Assert.assertEquals(CoreNotificationType.ACCEPTOR_STARTED, notif.getType());
-      Assert.assertEquals(InVMAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
+      Assert.assertEquals(NettyAcceptorFactory.class.getName(), notif.getProperties().getSimpleStringProperty(new SimpleString("factory")).toString());
    }
 
    // Package protected ---------------------------------------------

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a69ce7bc/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
index 68a12dc..a1bd0b3 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/AcceptorControlUsingCoreTest.java
@@ -87,6 +87,11 @@ public class AcceptorControlUsingCoreTest extends AcceptorControlTest {
    // Public --------------------------------------------------------
 
    @Override
+   public boolean usingCore() {
+      return true;
+   }
+
+   @Override
    @Test
    public void testStartStop() throws Exception {
       // this test does not make sense when using core messages:


[2/2] activemq-artemis git commit: This closes #696

Posted by cl...@apache.org.
This closes #696


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

Branch: refs/heads/master
Commit: e24f59838d9d3b04eae3dcd4c40a191d53cf4966
Parents: 4cecc95 a69ce7b
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Aug 2 14:23:34 2016 -0400
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Aug 2 14:23:34 2016 -0400

----------------------------------------------------------------------
 .../management/AcceptorControlTest.java         | 22 +++++++++++++-------
 .../AcceptorControlUsingCoreTest.java           |  5 +++++
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------