public void testConnectorLifecycle() throws Exception
{
// this test used to use the connector created for this test, but since we need to
// simulate disposal as well we have to create an extra instance here.
Connector localConnector = createConnector();
localConnector.setName(connectorName+"-temp");
// the connector did not come from the registry, so we need to initialise manually
localConnector.initialise();
localConnector.start();
assertNotNull(localConnector);
assertTrue(localConnector.isStarted());
assertTrue(!localConnector.isDisposed());
localConnector.stop();
assertTrue(!localConnector.isStarted());
assertTrue(!localConnector.isDisposed());
localConnector.dispose();
assertTrue(!localConnector.isStarted());
assertTrue(localConnector.isDisposed());
try
{
localConnector.start();
fail("Connector cannot be restarted after being disposing");
}
catch (Exception e)
{
// expected