Thanks Rohith Sharma K S for your review !
private volatile boolean drained = true; default value has been changed. Would you tell why this change required?
to be consistent with AsyncDispatcher#drained. and seems a default value of true is more reasonable.
I think change in the method static to non-static not necessarily required in MockRM#waitForState. Lets keep it as it is. As a result, MockAM modifications are not at all required.
change from static to non-static is to add drainEventsImplicitly(). if keep it as it is, the invoker (MockAM) maybe have to explicitly call rm#drainEvents
nit: couple of changes which are not modified are appeared in patch. May be check those also, else patch looks very huge. Ex : MockRM class, line no 349, 332
One doubt, if once * disableDrainEventsImplicitly* set then there is no way to enable it. Should we provide enabling method also?
couldn't figure out the scene to disable and then enable, but I'm ok to add enable method
After this patch, can sleeps can be avoided ? If yes, I think we need to remove so that test execute faster.
yes, after drainEvents, all events are processed, no need to sleep-wait anymore