NO-JIRA: more fixes on plugintests

some asynchronously things on the server were making these to fail.
add some checkpoints to make sure it happens smoothly.
This commit is contained in:
Clebert Suconic 2017-07-13 09:19:13 -04:00
parent 36a948b225
commit 0bfdcb764c
3 changed files with 9 additions and 3 deletions

View File

@ -176,8 +176,10 @@ public class CorePluginTest extends JMSTestBase {
prod.setTimeToLive(500);
MessageConsumer cons = sess.createConsumer(queue);
TextMessage msg1 = sess.createTextMessage("test");
prod.send(msg1);
for (int i = 0; i < 10; i++) {
TextMessage msg1 = sess.createTextMessage("test");
prod.send(msg1);
}
Thread.sleep(500);
assertNull(cons.receive(500));

View File

@ -278,7 +278,7 @@ public class MethodCalledVerifier implements ActiveMQServerPlugin {
} catch (Exception e) {
e.printStackTrace();
}
assertTrue("validating method " + name, count <= methodCalls.getOrDefault(name, new AtomicInteger()).get());
assertTrue("validating method " + name + " expected less than " + count, count <= methodCalls.getOrDefault(name, new AtomicInteger()).get());
});
}

View File

@ -109,6 +109,10 @@ public class StompPluginTest extends StompTestBase {
System.out.println("received " + frame);
Assert.assertEquals(Stomp.Responses.MESSAGE, frame.getCommand());
verifier.validatePluginMethodsAtLeast(1, MESSAGE_ACKED, BEFORE_SEND, AFTER_SEND, BEFORE_MESSAGE_ROUTE, AFTER_MESSAGE_ROUTE, BEFORE_DELIVER,
AFTER_DELIVER);
// unsub
unsubscribe(newConn, "a-sub");