@Test
public void undeployImapApplication() throws Exception
{
/* Get the receiver so later we can check the stopping condition. This needs to be done before starting to
* dispose because the receiver is removed from the connector. */
final RetrieveMessageReceiver receiver = getReceiver();
// Wait for first message to be processed by the MailMessageProcessor.
disposeLatch.await();
// Launch a new thread "t" to dispose the context.
Thread t = new Thread()
{
@Override
public void run()
{
muleContext.dispose();
}
};
t.start();
// Wait until "t" has begun to stop.
new PollingProber(10000, 100).check(new Probe()
{
public boolean isSatisfied()
{
return (receiver.isStopping() || receiver.isStopped());
}
public String describeFailure()
{
return null;