}
@Test
public void testStopsServiceOnException() throws MuleException, InterruptedException
{
final FlowConstruct service;
if (variant.equals(ConfigVariant.FLOW))
service = muleContext.getRegistry().lookupFlowConstruct("testService5");
else
service = muleContext.getRegistry().lookupService("testService5");
MuleClient client = muleContext.getClient();
client.dispatch("vm://in5", "test", null);
assertExceptionMessage(client.request("vm://out5", RECEIVE_TIMEOUT));
Prober prober = new PollingProber(5000, 100);
prober.check(new Probe()
{
@Override
public boolean isSatisfied()
{
return !service.getLifecycleState().isStarted();
}
@Override
public String describeFailure()
{