Github user clebertsuconic commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1532#discussion_r138755728
  
    --- Diff: 
tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
 ---
    @@ -1585,6 +1586,47 @@ public void testXAResourceRolledBackRemoved() throws 
Exception {
           assertNull(transaction);
        }
     
    +   @Test
    +   public void testTempQueueLeak() throws Exception {
    +      final Connection[] connections = new Connection[20];
    +
    +      try {
    +         for (int i = 0; i < connections.length; i++) {
    +            connections[i] = factory.createConnection();
    +            connections[i].start();
    +         }
    +
    +         Session session = connections[0].createSession(false, 
Session.AUTO_ACKNOWLEDGE);
    +
    +         for (int i = 0; i < connections.length; i++) {
    +            TemporaryQueue temporaryQueue = session.createTemporaryQueue();
    +            temporaryQueue.delete();
    +         }
    +
    +         Object[] addressResources = 
server.getManagementService().getResources(AddressControl.class);
    +         AddressControl addressControl = null;
    +
    +         for (Object addressResource : addressResources) {
    +
    +            if (((AddressControl) 
addressResource).getAddress().equals("ActiveMQ.Advisory.TempQueue")) {
    +               addressControl = (AddressControl) addressResource;
    +            }
    +         }
    +
    +         assertNotNull("addressControl for temp advisory", addressControl);
    +
    +         //sleep a bit to allow message count to go down.
    +         Thread.sleep(50);
    --- End diff --
    
    I did it myself.. merged


---

Reply via email to