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/03/16 16:22:11 UTC

[42/61] [abbrv] activemq-artemis git commit: fixing byteman tests

fixing byteman 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/cdb904ce
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/cdb904ce
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/cdb904ce

Branch: refs/heads/refactor-openwire
Commit: cdb904ce5bd5ca1fb879062772d7c52b23eee0f8
Parents: 0e21654
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Feb 23 22:04:16 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed Mar 16 11:19:15 2016 -0400

----------------------------------------------------------------------
 .../protocol/openwire/OpenWireConnection.java   |  7 +-
 .../FailoverConsumerOutstandingCommitTest.java  | 88 +++++++++-----------
 .../FailoverConsumerUnconsumedTest.java         | 24 +++---
 .../failover/FailoverDuplicateTest.java         | 12 +--
 .../failover/FailoverPrefetchZeroTest.java      | 11 +--
 .../failover/FailoverTransactionTest.java       | 33 ++++----
 6 files changed, 85 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
----------------------------------------------------------------------
diff --git a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
index dbbb59f..7c1c094 100644
--- a/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
+++ b/artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
@@ -690,7 +690,12 @@ public class OpenWireConnection extends AbstractRemotingConnection implements Se
    }
 
    // This will listen for commands throught the protocolmanager
-   class CommandProcessor implements CommandVisitor {
+   public class CommandProcessor implements CommandVisitor {
+
+
+      public AMQConnectionContext getContext() {
+         return OpenWireConnection.this.getContext();
+      }
 
       @Override
       public Response processAddConnection(ConnectionInfo info) throws Exception {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/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 78a8a0b..705c033 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
@@ -6,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- *      http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -40,6 +40,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;
@@ -55,6 +56,7 @@ import org.junit.Test;
 
 @RunWith(BMUnitRunner.class)
 public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTest {
+
    private static final Logger LOG = LoggerFactory.getLogger(FailoverConsumerOutstandingCommitTest.class);
    private static final String QUEUE_NAME = "FailoverWithOutstandingCommit";
    private static final String MESSAGE_TEXT = "Test message ";
@@ -78,22 +80,17 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
 
    @Test
    @BMRules(
-      rules = {
-              @BMRule(
-                      name = "set no return response",
-                      targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
-                      targetMethod = "processCommitTransactionOnePhase",
-                      targetLocation = "ENTRY",
-                      binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.holdResponse(context)"),
-              @BMRule(
-                      name = "stop broker before commit",
-                      targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-                      targetMethod = "commit",
-                      targetLocation = "ENTRY",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()"),
-      }
-   )
+      rules = {@BMRule(
+         name = "set no return response",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+         targetMethod = "processCommitTransactionOnePhase",
+         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",
+         targetLocation = "ENTRY",
+         action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()"),})
    public void testFailoverConsumerDups() throws Exception {
       doTestFailoverConsumerDups(true);
    }
@@ -173,40 +170,37 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
 
    @Test
    @BMRules(
-      rules = {
-              @BMRule(
-                      name = "set no return response",
-                      targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
-                      targetMethod = "processCommitTransactionOnePhase",
-                      targetLocation = "ENTRY",
-                      binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.holdResponse(context)"),
-              @BMRule(
-                      name = "stop broker before commit",
-                      targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-                      targetMethod = "commit",
-                      targetLocation = "ENTRY",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction();return")})
+      rules = {@BMRule(
+         name = "set no return response",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+         targetMethod = "processCommitTransactionOnePhase",
+         targetLocation = "ENTRY",
+         binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
+         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",
+         targetLocation = "ENTRY",
+         action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction();return")})
    public void TestFailoverConsumerOutstandingSendTxIncomplete() throws Exception {
       doTestFailoverConsumerOutstandingSendTx(false);
    }
 
    @Test
    @BMRules(
-      rules = {
-              @BMRule(
-                      name = "set no return response",
-                      targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
-                      targetMethod = "processCommitTransactionOnePhase",
-                      targetLocation = "ENTRY",
-                      binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.holdResponse(context)"),
-              @BMRule(
-                      name = "stop broker after commit",
-                      targetClass = "org.apache.activemq.artemis.core.server.impl.ServerSessionImpl",
-                      targetMethod = "commit",
-                      targetLocation = "AT EXIT",
-                      action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()")})
+      rules = {@BMRule(
+         name = "set no return response",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
+         targetMethod = "processCommitTransactionOnePhase",
+         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",
+         targetLocation = "AT EXIT",
+         action = "org.apache.activemq.transport.failover.FailoverConsumerOutstandingCommitTest.stopServerInTransaction()")})
    public void TestFailoverConsumerOutstandingSendTxComplete() throws Exception {
       doTestFailoverConsumerOutstandingSendTx(true);
    }
@@ -362,9 +356,9 @@ public class FailoverConsumerOutstandingCommitTest extends OpenwireArtemisBaseTe
       producer.close();
    }
 
-   public static void holdResponse(AMQConnectionContext context) {
+   public static void holdResponse(OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
-         context.setDontSendReponse(true);
+         context.getContext().setDontSendReponse(true);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java
index 75c27d7..10927f2 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverConsumerUnconsumedTest.java
@@ -40,6 +40,7 @@ import org.apache.activemq.ActiveMQMessageConsumer;
 import org.apache.activemq.ActiveMQMessageTransformation;
 import org.apache.activemq.ActiveMQSession;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection;
 import org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConnectionContext;
 import org.apache.activemq.artemis.core.server.impl.QueueImpl;
 import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
@@ -92,11 +93,10 @@ public class FailoverConsumerUnconsumedTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processAddConsumer",
                            targetLocation = "ENTRY",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker2(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker2($0)")
            }
    )
    public void testFailoverConsumerDups() throws Exception {
@@ -109,11 +109,10 @@ public class FailoverConsumerUnconsumedTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processAddConsumer",
                            targetLocation = "ENTRY",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker2(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker2($0)")
            }
    )
    public void testFailoverConsumerDupsNoAdvisoryWatch() throws Exception {
@@ -127,11 +126,10 @@ public class FailoverConsumerUnconsumedTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processAddConsumer",
                            targetLocation = "ENTRY",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverConsumerUnconsumedTest.holdResponseAndStopBroker($0)")
            }
    )
    public void testFailoverClientAckMissingRedelivery() throws Exception {
@@ -362,10 +360,10 @@ public class FailoverConsumerUnconsumedTest extends OpenwireArtemisBaseTest {
       return idGen;
    }
 
-   public static void holdResponseAndStopBroker(AMQConnectionContext context) {
+   public static void holdResponseAndStopBroker(OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
          if (consumerCount.incrementAndGet() == maxConsumers) {
-            context.setDontSendReponse(true);
+            context.getContext().setDontSendReponse(true);
             Executors.newSingleThreadExecutor().execute(new Runnable() {
                public void run() {
                   try {
@@ -381,10 +379,10 @@ public class FailoverConsumerUnconsumedTest extends OpenwireArtemisBaseTest {
       }
    }
 
-   public static void holdResponseAndStopBroker2(AMQConnectionContext context) {
+   public static void holdResponseAndStopBroker2(OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
          if (consumerCount.incrementAndGet() == maxConsumers + (watchTopicAdvisories.get() ? 1 : 0)) {
-            context.setDontSendReponse(true);
+            context.getContext().setDontSendReponse(true);
             Executors.newSingleThreadExecutor().execute(new Runnable() {
                public void run() {
                   try {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java
index e801b3c..89d006a 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverDuplicateTest.java
@@ -33,6 +33,7 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
+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.embedded.EmbeddedJMS;
 import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest;
@@ -93,11 +94,10 @@ public class FailoverDuplicateTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processMessage",
                            targetLocation = "EXIT",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverDuplicateTest.holdResponseAndStopConn(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverDuplicateTest.holdResponseAndStopConn($0)")
            }
    )
    public void testFailoverSendReplyLost() throws Exception {
@@ -211,10 +211,10 @@ public class FailoverDuplicateTest extends OpenwireArtemisBaseTest {
       producer.close();
    }
 
-   public static void holdResponseAndStopConn(final AMQConnectionContext context) {
+   public static void holdResponseAndStopConn(final OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
          if (first.compareAndSet(false, true)) {
-            context.setDontSendReponse(true);
+            context.getContext().setDontSendReponse(true);
             Executors.newSingleThreadExecutor().execute(new Runnable() {
                @Override
                public void run() {
@@ -223,7 +223,7 @@ public class FailoverDuplicateTest extends OpenwireArtemisBaseTest {
                      Assert.assertTrue("message received on time", gotMessageLatch.await(60, TimeUnit.SECONDS));
                      Assert.assertTrue("new producers done on time", producersDone.await(120, TimeUnit.SECONDS));
                      LOG.info("Stopping connection post send and receive and multiple producers");
-                     context.getConnection().fail(null, "test Failoverduplicatetest");
+                     context.getContext().getConnection().fail(null, "test Failoverduplicatetest");
                   }
                   catch (Exception e) {
                      e.printStackTrace();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java
index fcb60e5..5981845 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverPrefetchZeroTest.java
@@ -31,6 +31,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
+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.embedded.EmbeddedJMS;
 import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest;
@@ -77,11 +78,10 @@ public class FailoverPrefetchZeroTest extends OpenwireArtemisBaseTest {
    @BMRules(
       rules = {@BMRule(
          name = "set no return response and stop the broker",
-         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+         targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
          targetMethod = "processMessagePull",
          targetLocation = "ENTRY",
-         binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-         action = "org.apache.activemq.transport.failover.FailoverPrefetchZeroTest.holdResponseAndStopBroker(context)")})
+         action = "org.apache.activemq.transport.failover.FailoverPrefetchZeroTest.holdResponseAndStopBroker($0)")})
    public void testPrefetchZeroConsumerThroughRestart() throws Exception {
       broker = createBroker();
       broker.start();
@@ -141,9 +141,10 @@ public class FailoverPrefetchZeroTest extends OpenwireArtemisBaseTest {
       producer.close();
    }
 
-   public static void holdResponseAndStopBroker(final AMQConnectionContext context) {
+   public static void holdResponseAndStopBroker(final OpenWireConnection.CommandProcessor context) {
+      new Exception("trace").printStackTrace();
       if (doByteman.get()) {
-         context.setDontSendReponse(true);
+         context.getContext().setDontSendReponse(true);
          pullDone.countDown();
          Executors.newSingleThreadExecutor().execute(new Runnable() {
             public void run() {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/cdb904ce/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
index c129791..a3e023a 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverTransactionTest.java
@@ -20,6 +20,7 @@ import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.ActiveMQMessageConsumer;
 import org.apache.activemq.AutoFailTestSupport;
+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.embedded.EmbeddedJMS;
 import org.apache.activemq.broker.artemiswrapper.OpenwireArtemisBaseTest;
@@ -137,11 +138,10 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processCommitTransactionOnePhase",
                            targetLocation = "EXIT",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker($0)")
            }
    )
    public void testFailoverCommitReplyLost() throws Exception {
@@ -233,11 +233,11 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processMessage",
                            targetLocation = "EXIT",
                            binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker($0)")
            }
    )
    public void testFailoverSendReplyLost() throws Exception {
@@ -318,11 +318,10 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processMessage",
                            targetLocation = "EXIT",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopProxyOnFirstSend(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopProxyOnFirstSend($0)")
            }
    )
    public void testFailoverConnectionSendReplyLost() throws Exception {
@@ -515,11 +514,10 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processMessageAck",
                            targetLocation = "ENTRY",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.holdResponseAndStopBroker($0)")
            }
    )
    public void testFailoverConsumerAckLost() throws Exception {
@@ -683,11 +681,10 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
            rules = {
                    @BMRule(
                            name = "set no return response and stop the broker",
-                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection",
+                           targetClass = "org.apache.activemq.artemis.core.protocol.openwire.OpenWireConnection$CommandProcessor",
                            targetMethod = "processRemoveConsumer",
                            targetLocation = "ENTRY",
-                           binding = "owconn:OpenWireConnection = $0; context = owconn.getContext()",
-                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.stopBrokerOnCounter(context)")
+                           action = "org.apache.activemq.transport.failover.FailoverTransactionTest.stopBrokerOnCounter($0)")
            }
    )
    public void testPoolingNConsumesAfterReconnect() throws Exception {
@@ -975,9 +972,9 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
       producer.close();
    }
 
-   public static void holdResponseAndStopBroker(final AMQConnectionContext context) {
+   public static void holdResponseAndStopBroker(final OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
-         context.setDontSendReponse(true);
+         context.getContext().setDontSendReponse(true);
          Executors.newSingleThreadExecutor().execute(new Runnable() {
             public void run() {
                LOG.info("Stopping broker post commit...");
@@ -995,11 +992,11 @@ public class FailoverTransactionTest extends OpenwireArtemisBaseTest {
       }
    }
 
-   public static void holdResponseAndStopProxyOnFirstSend(final AMQConnectionContext context) {
+   public static void holdResponseAndStopProxyOnFirstSend(final OpenWireConnection.CommandProcessor context) {
       if (doByteman.get()) {
          if (firstSend) {
             firstSend = false;
-            context.setDontSendReponse(true);
+            context.getContext().setDontSendReponse(true);
             Executors.newSingleThreadExecutor().execute(new Runnable() {
                public void run() {
                   LOG.info("Stopping connection post send...");