int threadsBeforeStart = Thread.activeCount();
MuleContext ctx = new DefaultMuleContextFactory().createMuleContext();
ctx.start();
assertTrue(Thread.activeCount() > threadsBeforeStart);
ctx.stop();
ctx.dispose();
// Check that workManager ("MuleServer") thread no longer exists.
assertTrue(Thread.activeCount() == threadsBeforeStart);
assertTrue(ctx.isDisposed());
assertFalse(ctx.isInitialised());
assertFalse(ctx.isStarted());