clebertsuconic commented on code in PR #6300:
URL: https://github.com/apache/artemis/pull/6300#discussion_r2960879813
##########
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/JMSTemporaryDestinationTest.java:
##########
@@ -137,4 +139,69 @@ public void testDeleteTemporaryTopic() throws Exception {
connection.close();
}
}
+
+ @Test
+ @Timeout(20)
+ public void testTemporaryTopicDeletedOnConnectionClosed() throws Exception {
+ doTestTemporaryDestinationIsDeletedOnConnectionClosed(true, true);
+ }
+
+ @Test
+ @Timeout(20)
+ public void testTemporaryQueueDeletedOnConnectionClosed() throws Exception {
+ doTestTemporaryDestinationIsDeletedOnConnectionClosed(false, true);
+ }
+
+ @Test
+ @Timeout(20)
+ public void
testTemporaryTopicDeletedOnConnectionClosedWithoutExplicitConsumerClose()
throws Exception {
+ doTestTemporaryDestinationIsDeletedOnConnectionClosed(true, false);
+ }
+
+ @Test
+ @Timeout(20)
+ public void
testTemporaryQueueDeletedOnConnectionClosedWithoutExplicitConsumerClose()
throws Exception {
+ doTestTemporaryDestinationIsDeletedOnConnectionClosed(false, false);
+ }
+
+ private void doTestTemporaryDestinationIsDeletedOnConnectionClosed(boolean
topic, boolean closeConsumer) throws Exception {
+ final String addressName;
+ try (Connection connection = createConnection()) {
+ final Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+ final Destination destination;
+
+ if (topic) {
+ destination = session.createTemporaryTopic();
+
+ assertNotNull(destination);
+ assertTrue(destination instanceof TemporaryTopic);
+
+ addressName = ((TemporaryTopic) destination).getTopicName();
+ } else {
+ destination = session.createTemporaryQueue();
+
+ assertNotNull(destination);
+ assertTrue(destination instanceof TemporaryQueue);
+
+ addressName = ((TemporaryQueue) destination).getQueueName();
+ }
+
+ logger.info("Address being used is {}", addressName);
Review Comment:
logger.info -> logger.debug
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]