}
// MULE-494
public void testInitialStateStopped() throws Exception
{
Service c = muleContext.getRegistry().lookupService("stoppedComponent");
assertEquals("stopped", c.getInitialState());
// Service initially stopped
assertFalse(c.isStarted());
assertTrue(c.isStopped());
assertFalse(c.isPaused());
// The connector should be started, but with no listeners registered.
AbstractConnector connector = (AbstractConnector)muleContext.getRegistry().lookupConnector("connector.test.mule.default");
assertNotNull(connector);
assertTrue(connector.isStarted());
MessageReceiver[] receivers = connector.getReceivers("*stopped*");
assertEquals(0, receivers.length);
// Start the service.
c.start();
assertTrue(c.isStarted());
assertFalse(c.isStopped());
assertFalse(c.isPaused());
// The listeners should now be registered and started.
assertTrue(connector.isStarted());
receivers = connector.getReceivers("*stopped*");
assertEquals(1, receivers.length);