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 053cfbc  NO-JIRA Fix invalid log path in BMRules
     new e500248  This closes #3158
053cfbc is described below

commit 053cfbc1024d694fad1d9675c10e28276b9e74ab
Author: brusdev <[email protected]>
AuthorDate: Mon Jun 1 22:03:43 2020 +0200

    NO-JIRA Fix invalid log path in BMRules
---
 .../activemq/artemis/tests/extras/byteman/LatencyTest.java     |  8 +++++++-
 .../artemis/tests/extras/byteman/OrphanedConsumerTest.java     | 10 ++++++++--
 .../artemis/tests/extras/byteman/StartStopDeadlockTest.java    |  6 +++++-
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java
 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java
index d855990..5709071 100644
--- 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java
+++ 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/LatencyTest.java
@@ -24,11 +24,17 @@ import 
org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.jboss.byteman.contrib.bmunit.BMRule;
 import org.jboss.byteman.contrib.bmunit.BMRules;
 import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
+import org.jboss.logging.Logger;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
 @RunWith(BMUnitRunner.class)
 public class LatencyTest extends ActiveMQTestBase {
+   private static final Logger log = Logger.getLogger(LatencyTest.class);
+
+   private static void debugLog(String message) {
+      log.debug(message);
+   }
 
    /*
    * simple test to make sure connect still works with some network latency  
built into netty
@@ -40,7 +46,7 @@ public class LatencyTest extends ActiveMQTestBase {
          targetClass = "org.jboss.netty.bootstrap.ClientBootstrap",
          targetMethod = "connect",
          targetLocation = "ENTRY",
-         action = "log.debug(\"netty connecting\")"), @BMRule(
+         action = 
"org.apache.activemq.artemis.tests.extras.byteman.LatencyTest.debugLog(\"netty 
connecting\")"), @BMRule(
          name = "sleep OioWorker.run",
          targetClass = "org.jboss.netty.channel.socket.oio.OioWorker",
          targetMethod = "run",
diff --git 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java
 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java
index 01b6589..733a862 100644
--- 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java
+++ 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/OrphanedConsumerTest.java
@@ -30,6 +30,7 @@ import 
org.apache.activemq.artemis.tests.util.ActiveMQTestBase;
 import org.jboss.byteman.contrib.bmunit.BMRule;
 import org.jboss.byteman.contrib.bmunit.BMRules;
 import org.jboss.byteman.contrib.bmunit.BMUnitRunner;
+import org.jboss.logging.Logger;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
@@ -37,6 +38,11 @@ import org.junit.runner.RunWith;
 
 @RunWith(BMUnitRunner.class)
 public class OrphanedConsumerTest extends ActiveMQTestBase {
+   private static final Logger log = 
Logger.getLogger(OrphanedConsumerTest.class);
+
+   private static void debugLog(String message) {
+      log.debug(message);
+   }
 
    private static boolean conditionActive = true;
 
@@ -109,7 +115,7 @@ public class OrphanedConsumerTest extends ActiveMQTestBase {
          targetMethod = "close",
          targetLocation = "AT EXIT",
          condition = 
"org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
-         action = "log.debug(\"throwing stuff\");throw new 
InterruptedException()"), @BMRule(
+         action = 
"org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.debugLog(\"throwing
 stuff\");throw new InterruptedException()"), @BMRule(
          name = "closeEnter",
          targetClass = 
"org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
          targetMethod = "close",
@@ -136,7 +142,7 @@ public class OrphanedConsumerTest extends ActiveMQTestBase {
          targetMethod = "close",
          targetLocation = "AT EXIT",
          condition = 
"org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
-         action = "log.debug(\"throwing stuff\");throw new 
InterruptedException()"), @BMRule(
+         action = 
"org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.debugLog(\"throwing
 stuff\");throw new InterruptedException()"), @BMRule(
          name = "closeEnter",
          targetClass = 
"org.apache.activemq.artemis.core.server.impl.ServerConsumerImpl",
          targetMethod = "close",
diff --git 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java
 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java
index 995e7ab..8bb83f6 100644
--- 
a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java
+++ 
b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/StartStopDeadlockTest.java
@@ -42,6 +42,10 @@ import org.junit.runner.RunWith;
 public class StartStopDeadlockTest extends ActiveMQTestBase {
    private static final Logger log = 
Logger.getLogger(StartStopDeadlockTest.class);
 
+   private static void debugLog(String message) {
+      log.debug(message);
+   }
+
    /*
    * simple test to make sure connect still works with some network latency  
built into netty
    * */
@@ -54,7 +58,7 @@ public class StartStopDeadlockTest extends ActiveMQTestBase {
          targetMethod = "initialisePart2",
          targetLocation = "ENTRY",
          condition = "incrementCounter(\"server-Init\") == 2",
-         action = "log.debug(\"server backup init\"), 
waitFor(\"start-init\")"), @BMRule(
+         action = 
"org.apache.activemq.artemis.tests.extras.byteman.StartStopDeadlockTest.debugLog(\"server
 backup init\"), waitFor(\"start-init\")"), @BMRule(
          name = "JMSServer.stop wait-init",
          targetClass = 
"org.apache.activemq.artemis.jms.server.impl.JMSServerManagerImpl",
          targetMethod = "stop",

Reply via email to