diff --git a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java index d34285cbfe..33786dcce6 100644 --- a/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java +++ b/tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java @@ -229,12 +229,17 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase { public ActiveMQTestBase() { } + protected static String randomProtocol() { - String[] protocols = {"AMQP", "OPENWIRE", "CORE"}; - String protocol = protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % 3]; + return randomProtocol("AMQP", "OPENWIRE", "CORE"); + } + + protected static String randomProtocol(String...protocols) { + String protocol = protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % protocols.length]; logger.info("Selecting {} protocol", protocol); return protocol; } + protected T serialClone(Object object) throws Exception { logger.debug("object::{}", object); ByteArrayOutputStream bout = new ByteArrayOutputStream(); diff --git a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java index dfeb395ee3..4610fc1a5c 100644 --- a/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java +++ b/tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java @@ -125,7 +125,7 @@ public class M_and_M_FactoryTest extends SoakTestBase { @Test public void testM_and_M_RandomProtocol() throws Exception { - test_M_and_M_Sorting(randomProtocol(), 2000, 2, 2, 500); + test_M_and_M_Sorting(randomProtocol("AMQP", "CORE"), 2000, 2, 2, 500); } public void test_M_and_M_Sorting(String protocol, int batchSize, int restarts, int clientRuns, int killClientEveryX) throws Exception {