activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gaohow...@apache.org
Subject activemq-artemis git commit: Fix FailoverConsumerOutstandingCommitTest
Date Fri, 01 Apr 2016 12:17:32 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/refactor-openwire ee3ec87d0 -> 47f735d38


Fix FailoverConsumerOutstandingCommitTest


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

Branch: refs/heads/refactor-openwire
Commit: 47f735d38a8eba449bf553753b5bf4c220a2bc50
Parents: ee3ec87
Author: Howard Gao <howard.gao@gmail.com>
Authored: Fri Apr 1 20:15:24 2016 +0800
Committer: Howard Gao <howard.gao@gmail.com>
Committed: Fri Apr 1 20:15:24 2016 +0800

----------------------------------------------------------------------
 .../FailoverConsumerOutstandingCommitTest.java  | 24 +++++++++-----------
 1 file changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/47f735d3/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
index e44a490..40cbccb 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerOutstandingCommitTest.java
@@ -24,7 +24,6 @@ import static org.junit.Assert.fail;
 
 import java.util.ArrayList;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 
@@ -39,10 +38,7 @@ import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
-import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext;
-import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
 import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
 import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest;
 import org.jboss.byteman.contrib.bmunit.BMRule;
@@ -87,8 +83,8 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
          targetLocation = "ENTRY",
          action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.holdResponse($0)"),
@BMRule(
          name = "stop broker before commit",
-         targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-         targetMethod = "commit",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+         targetMethod = "processCommitTransactionOnePhase",
          targetLocation = "ENTRY",
          action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()"),})
    public void testFailoverConsumerDups() throws Exception {
@@ -181,10 +177,10 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
 
          @BMRule(
             name = "stop broker before commit",
-            targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-            targetMethod = "commit",
+            targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+            targetMethod = "processCommitTransactionOnePhase",
             targetLocation = "ENTRY",
-            action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction();return")})
+            action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction();return
null")})
    public void TestFailoverConsumerOutstandingSendTxIncomplete() throws Exception {
       doTestFailoverConsumerOutstandingSendTx(false);
    }
@@ -198,8 +194,8 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
          targetLocation = "ENTRY",
          action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.holdResponse($0)"),
@BMRule(
          name = "stop broker after commit",
-         targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-         targetMethod = "commit",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+         targetMethod = "processCommitTransactionOnePhase",
          targetLocation = "AT EXIT",
          action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()")})
    public void TestFailoverConsumerOutstandingSendTxComplete() throws Exception {
@@ -236,11 +232,13 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
       testConsumer.setMessageListener(new MessageListener() {
 
          public void onMessage(Message message) {
-            LOG.info("consume one and commit: " + message);
+            LOG.info("consume one: " + message);
             assertNotNull("got message", message);
             receivedMessages.add((TextMessage) message);
             try {
+               LOG.info("send one");
                produceMessage(consumerSession, signalDestination, 1);
+               LOG.info("commit session");
                consumerSession.commit();
             }
             catch (JMSException e) {
@@ -272,8 +270,8 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
 
       // will be stopped by the plugin
       brokerStopLatch.await();
-      server.stop();
       doByteman.set(false);
+      server.stop();
       server = createBroker();
       server.start();
 


Mime
View raw message