gemmellr commented on code in PR #4737:
URL: https://github.com/apache/activemq-artemis/pull/4737#discussion_r1447697032
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateTest.java:
##########
@@ -381,26 +382,36 @@ public void testCleanupAfterReboot(String protocol,
boolean useDelay) throws Exc
try (Connection connection = cf.createConnection()) {
Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
Queue queue = session.createQueue(QUEUE_NAME);
- MessageProducer producer = session.createProducer(queue);
- producer.send(session.createTextMessage(randomString));
+ Topic topic = session.createTopic(TOPIC_NAME);
+ MessageProducer producer = session.createProducer(null);
+ producer.send(queue, session.createTextMessage(randomString));
+ producer.send(topic, session.createTextMessage(randomString));
}
info =
server.getPostOffice().getAddressInfo(SimpleString.toSimpleString(QUEUE_NAME));
Assert.assertNotNull(info);
Assert.assertTrue(info.isAutoCreated());
+ info =
server.getPostOffice().getAddressInfo(SimpleString.toSimpleString(TOPIC_NAME));
+ Assert.assertNotNull(info);
+ Assert.assertTrue(info.isAutoCreated());
+
server.stop();
try (AssertionLoggerHandler loggerHandler = new
AssertionLoggerHandler()) {
server.start();
- Assert.assertFalse(loggerHandler.findText("AMQ224113")); // this time
around the queue had messages, it has to exist
+ Assert.assertFalse(loggerHandler.matchText("AMQ224113.*" +
QUEUE_NAME)); // this time around the queue had messages, it has to exist
+ Assert.assertTrue(loggerHandler.matchText("AMQ224113.*" +
TOPIC_NAME)); // this time around the queue had messages, it has to exist
Review Comment:
In addition to fixing the comment, I would also move the topic-related
AMQ224113 assertion down beneath the AMQ224112 queue-related assertion that
currently follows. That would then group the two queue-related assertFalse
checks together to note the queue (and related address) were not deleted, then
the topic-related one that checks the unused topic address was deleted. (or
the opposite, move the topic one up to leave the two queue ones below)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]