use of com.zimbra.cs.session.SomeAccountsWaitSet in project zm-mailbox by Zimbra.
the class TestImapNotificationsViaWaitsets method runOp.
@Override
protected void runOp(MailboxOperation op, ZMailbox zmbox, ZFolder folder) throws Exception {
ImapServerListener listener = ImapServerListenerPool.getInstance().get(zmbox);
String wsID = listener.getWSId();
SomeAccountsWaitSet ws = (SomeAccountsWaitSet) (WaitSetMgr.lookup(wsID));
long lastSequence = ws.getCurrentSeqNo();
op.run(zmbox);
boolean applied = false;
int timeout = 6000;
while (timeout > 0) {
if (listener.getLastKnownSequenceNumber() > lastSequence) {
applied = true;
break;
}
timeout -= 500;
try {
Thread.sleep(500);
} catch (InterruptedException e) {
break;
}
}
assertTrue("operation not applied within 6 seconds", applied);
String failure = op.checkResult();
assertNull(failure, failure);
}
Aggregations