assertEquals("numReceived after subscribe", 0, this.updateInterceptor.waitOnUpdate(1000L, 0)); // no message arrived?
{
publish();
assertEquals("numReceived after sending", 1, this.updateInterceptor.waitOnUpdate(1500L, oidExact, Constants.STATE_OK, 1));
Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_OK);
assertTrue("Wrong update state", msg.getUpdateQos().isOk());
msg.compareMsg(msgUnit);
assertEquals("Message contentMime is corrupted", contentMime, msg.getUpdateKey().getContentMime());
this.updateInterceptor.clear();
}
{
log.info("Erasing now ...");
this.updateInterceptor.countErased(true);
erase();
assertEquals("erase event is missing", 1, this.updateInterceptor.waitOnUpdate(2500L, oidExact, Constants.STATE_ERASED, 1));
Msg msg = this.updateInterceptor.getMsg(oidExact, Constants.STATE_ERASED);
assertEquals("wrong subscriptionId expected=" + subscribeId, subscribeId, msg.getUpdateQos().getSubscriptionId());
assertTrue("wrong update state", msg.getUpdateQos().isErased());
this.updateInterceptor.clear();
}
log.info("testXPathEraseEvent SUCCESS");