ARTEMIS-1419 Small tweak on openwire Test

This commit is contained in:
Clebert Suconic 2017-09-13 18:25:10 -04:00
parent 02b6b8c8eb
commit 481f753589
1 changed files with 4 additions and 5 deletions

View File

@ -1604,20 +1604,19 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
} }
Object[] addressResources = server.getManagementService().getResources(AddressControl.class); Object[] addressResources = server.getManagementService().getResources(AddressControl.class);
AddressControl addressControl = null;
for (Object addressResource : addressResources) { for (Object addressResource : addressResources) {
if (((AddressControl) addressResource).getAddress().equals("ActiveMQ.Advisory.TempQueue")) { if (((AddressControl) addressResource).getAddress().equals("ActiveMQ.Advisory.TempQueue")) {
addressControl = (AddressControl) addressResource; AddressControl addressControl = (AddressControl) addressResource;
Wait.waitFor(() -> addressControl.getMessageCount() == 0);
assertNotNull("addressControl for temp advisory", addressControl);
assertEquals(0, addressControl.getMessageCount());
} }
} }
assertNotNull("addressControl for temp advisory", addressControl);
//sleep a bit to allow message count to go down. //sleep a bit to allow message count to go down.
Thread.sleep(50);
assertEquals(0, addressControl.getMessageCount());
} finally { } finally {
for (Connection conn : connections) { for (Connection conn : connections) {
if (conn != null) { if (conn != null) {