Skip to content

Commit daba842

Browse files
ARTEMIS-5035 Change some tests to use a random choice for protocol
1 parent 8b265f4 commit daba842

File tree

6 files changed

+13
-51
lines changed

6 files changed

+13
-51
lines changed

tests/artemis-test-support/src/main/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java

+3-5
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,12 @@ protected void clearServers() {
229229
public ActiveMQTestBase() {
230230

231231
}
232-
233232
protected static String randomProtocol() {
234233
String[] protocols = {"AMQP", "OPENWIRE", "CORE"};
235-
236-
return protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % 3];
234+
String protocol = protocols[org.apache.activemq.artemis.tests.util.RandomUtil.randomPositiveInt() % 3];
235+
logger.info("Selecting {} protocol", protocol);
236+
return protocol;
237237
}
238-
239238
protected <T> T serialClone(Object object) throws Exception {
240239
logger.debug("object::{}", object);
241240
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -247,7 +246,6 @@ protected <T> T serialClone(Object object) throws Exception {
247246
return (T) obinp.readObject();
248247

249248
}
250-
251249
@AfterEach
252250
public void tearDown() throws Exception {
253251
try {

tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/IdempotentACKTest.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,8 @@ private void transactSend(Session session, MessageProducer producer, int initial
155155

156156

157157
@Test
158-
public void testAMQP() throws Exception {
159-
testACKs("AMQP");
160-
}
161-
162-
@Test
163-
public void testCORE() throws Exception {
164-
testACKs("CORE");
158+
public void testRandomProtocol() throws Exception {
159+
testACKs(randomProtocol());
165160
}
166161

167162
private void testACKs(final String protocol) throws Exception {

tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/InterruptedLargeMessageTest.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,10 @@ public void cleanupServers() {
145145

146146
@Test
147147
@Timeout(240)
148-
public void testAMQP() throws Exception {
149-
testInterrupt("AMQP");
148+
public void testRandomProtocol() throws Exception {
149+
testInterrupt(randomProtocol());
150150
}
151151

152-
@Test
153-
@Timeout(240)
154-
public void testCORE() throws Exception {
155-
testInterrupt("CORE");
156-
}
157152

158153
private void preCreateInternalQueues(String serverLocation) throws Exception {
159154
Configuration configuration = createDefaultConfig(0, false);

tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/brokerConnection/mirror/PagedSNFSoakTest.java

+2-13
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,8 @@ public void cleanupServers() {
123123

124124
@Test
125125
@Timeout(240)
126-
public void testAMQP() throws Exception {
127-
testAccumulateAndSend("AMQP");
128-
}
129-
130-
@Test
131-
@Timeout(240)
132-
public void testCORE() throws Exception {
133-
testAccumulateAndSend("CORE");
134-
}
135-
136-
@Test
137-
public void testOpenWire() throws Exception {
138-
testAccumulateAndSend("OPENWIRE");
126+
public void testRandomProtocol() throws Exception {
127+
testAccumulateAndSend(randomProtocol());
139128
}
140129

141130
private void testAccumulateAndSend(final String protocol) throws Exception {

tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/client/LargeMessageSoakTest.java

+2-12
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,8 @@ public void setUp() throws Exception {
5858
}
5959

6060
@Test
61-
public void testAMQP() throws Exception {
62-
testSendReceive("AMQP");
63-
}
64-
65-
@Test
66-
public void testCORE() throws Exception {
67-
testSendReceive("CORE");
68-
}
69-
70-
@Test
71-
public void testOpenWire() throws Exception {
72-
testSendReceive("OPENWIRE");
61+
public void testRandomProtocol() throws Exception {
62+
testSendReceive(randomProtocol());
7363
}
7464

7565
public void testSendReceive(String protocol) throws Exception {

tests/soak-tests/src/test/java/org/apache/activemq/artemis/tests/soak/paging/M_and_M_FactoryTest.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,8 @@ public void before() throws Exception {
124124

125125

126126
@Test
127-
public void testM_and_M_AMQP() throws Exception {
128-
test_M_and_M_Sorting( "AMQP", 2000, 2, 2, 500);
129-
}
130-
131-
@Test
132-
public void testM_and_M_CORE() throws Exception {
133-
test_M_and_M_Sorting( "CORE", 2000, 2, 2, 500);
127+
public void testM_and_M_RandomProtocol() throws Exception {
128+
test_M_and_M_Sorting(randomProtocol(), 2000, 2, 2, 500);
134129
}
135130

136131
public void test_M_and_M_Sorting(String protocol, int batchSize, int restarts, int clientRuns, int killClientEveryX) throws Exception {

0 commit comments

Comments
 (0)