activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [activemq-artemis] branch master updated: NO-JIRA fixing tests
Date Thu, 22 Aug 2019 19:32:36 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 3d7042d  NO-JIRA fixing tests
3d7042d is described below

commit 3d7042d49aa2d5a6777236f458b807c97d2acd89
Author: Clebert Suconic <clebertsuconic@apache.org>
AuthorDate: Thu Aug 22 11:59:44 2019 -0400

    NO-JIRA fixing tests
---
 .../tests/integration/cluster/failover/FailoverTest.java      |  8 +++++++-
 .../artemis/tests/integration/remoting/ReconnectTest.java     | 11 ++++++++++-
 .../replication/SharedNothingReplicationFlowControlTest.java  |  2 +-
 3 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
index 1b6277f..4c40448 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
@@ -186,7 +186,7 @@ public class FailoverTest extends FailoverTestBase {
 
       ClientSessionFactoryInternal sf1 = (ClientSessionFactoryInternal) createSessionFactory(locator);
 
-      final ClientSession session = createSession(sf1, true, true);
+      final ClientSession session = createSession(sf1, true, false);
 
       session.createQueue(FailoverTestBase.ADDRESS, RoutingType.MULTICAST, FailoverTestBase.ADDRESS,
null, true);
 
@@ -218,7 +218,13 @@ public class FailoverTest extends FailoverTestBase {
                log.debug("acking message = id = " + message.getMessageID() + ", counter =
" +
                             message.getIntProperty("counter"));
                message.acknowledge();
+               session.commit();
             } catch (ActiveMQException e) {
+               try {
+                  session.rollback();
+               } catch (Exception e2) {
+                  e.printStackTrace();
+               }
                e.printStackTrace();
                return;
             }
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java
index 8c9ff19..867d4b2 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/remoting/ReconnectTest.java
@@ -46,6 +46,7 @@ import org.apache.activemq.artemis.core.server.ServerSession;
 import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
+import org.apache.activemq.artemis.utils.Wait;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -414,16 +415,24 @@ public class ReconnectTest extends ActiveMQTestBase {
       ClientConsumer clientConsumer2 = session.createConsumer(queueName1);
       clientConsumer1.close();
 
+      Wait.assertEquals(1, () -> getConsumerCount(server, session));
+
       Set<ServerConsumer> serverConsumers = server.getSessionByID(session.getName()).getServerConsumers();
       ServerConsumer serverConsumer = serverConsumers.iterator().next();
-      assertEquals(1, serverConsumers.size());
       assertEquals(clientConsumer2.getConsumerContext().getId(), serverConsumer.getID());
 
+
       session.close();
       sf.close();
       server.stop();
    }
 
+   private int getConsumerCount(ActiveMQServer server, ClientSessionInternal session) {
+      Set<ServerConsumer> serverConsumers = server.getSessionByID(session.getName()).getServerConsumers();
+      return serverConsumers.size();
+
+   }
+
    // Package protected ---------------------------------------------
 
    // Protected -----------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java
index 54aae6e..22521b9 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/replication/SharedNothingReplicationFlowControlTest.java
@@ -266,7 +266,7 @@ public class SharedNothingReplicationFlowControlTest extends ActiveMQTestBase
{
 
       PageStoreFactoryTestable testablePageStoreFactory = (PageStoreFactoryTestable) ((PagingManagerImpl)
backupServer.getPagingManager()).getPagingStoreFactory();
 
-      Assert.assertEquals(openCount.get(), closeCount.get());
+      Wait.assertTrue(() -> openCount.get() ==  closeCount.get());
    }
 
    static AtomicInteger openCount = new AtomicInteger(0);


Mime
View raw message