ARTEMIS-5035 Change some tests to use a random choice for protocol

This commit is contained in:
Clebert Suconic 2024-09-05 14:13:12 -04:00 committed by clebertsuconic
parent 8b265f4625
commit daba842984
6 changed files with 13 additions and 51 deletions

View File

@ -229,13 +229,12 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
public ActiveMQTestBase() {
}
protected static String randomProtocol() {
String[] protocols = {"AMQP", "OPENWIRE", "CORE"};
return protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % 3];
String protocol = protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % 3];
logger.info("Selecting {} protocol", protocol);
return protocol;
}
protected <T> T serialClone(Object object) throws Exception {
logger.debug("object::{}", object);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@ -247,7 +246,6 @@ public abstract class ActiveMQTestBase extends ArtemisTestCase {
return (T) obinp.readObject();
}
@AfterEach
public void tearDown() throws Exception {
try {

View File

@ -155,13 +155,8 @@ public class IdempotentACKTest extends SoakTestBase {
@Test
public void testAMQP() throws Exception {
testACKs("AMQP");
}
@Test
public void testCORE() throws Exception {
testACKs("CORE");
public void testRandomProtocol() throws Exception {
testACKs(randomProtocol());
}
private void testACKs(final String protocol) throws Exception {

View File

@ -145,15 +145,10 @@ public class InterruptedLargeMessageTest extends SoakTestBase {
@Test
@Timeout(240)
public void testAMQP() throws Exception {
testInterrupt("AMQP");
public void testRandomProtocol() throws Exception {
testInterrupt(randomProtocol());
}
@Test
@Timeout(240)
public void testCORE() throws Exception {
testInterrupt("CORE");
}
private void preCreateInternalQueues(String serverLocation) throws Exception {
Configuration configuration = createDefaultConfig(0, false);

View File

@ -123,19 +123,8 @@ public class PagedSNFSoakTest extends SoakTestBase {
@Test
@Timeout(240)
public void testAMQP() throws Exception {
testAccumulateAndSend("AMQP");
}
@Test
@Timeout(240)
public void testCORE() throws Exception {
testAccumulateAndSend("CORE");
}
@Test
public void testOpenWire() throws Exception {
testAccumulateAndSend("OPENWIRE");
public void testRandomProtocol() throws Exception {
testAccumulateAndSend(randomProtocol());
}
private void testAccumulateAndSend(final String protocol) throws Exception {

View File

@ -58,18 +58,8 @@ public class LargeMessageSoakTest extends ActiveMQTestBase {
}
@Test
public void testAMQP() throws Exception {
testSendReceive("AMQP");
}
@Test
public void testCORE() throws Exception {
testSendReceive("CORE");
}
@Test
public void testOpenWire() throws Exception {
testSendReceive("OPENWIRE");
public void testRandomProtocol() throws Exception {
testSendReceive(randomProtocol());
}
public void testSendReceive(String protocol) throws Exception {

View File

@ -124,13 +124,8 @@ public class M_and_M_FactoryTest extends SoakTestBase {
@Test
public void testM_and_M_AMQP() throws Exception {
test_M_and_M_Sorting( "AMQP", 2000, 2, 2, 500);
}
@Test
public void testM_and_M_CORE() throws Exception {
test_M_and_M_Sorting( "CORE", 2000, 2, 2, 500);
public void testM_and_M_RandomProtocol() throws Exception {
test_M_and_M_Sorting(randomProtocol(), 2000, 2, 2, 500);
}
public void test_M_and_M_Sorting(String protocol, int batchSize, int restarts, int clientRuns, int killClientEveryX) throws Exception {