* SEE MULE-3975
*/
@Test
public void testDoThreadingFalse() throws Exception
{
final Latch latch = new Latch();
final String serviceName = "testDoThreadingFalse";
service.setName(serviceName);
ChainedThreadingProfile threadingProfile = (ChainedThreadingProfile) muleContext.getDefaultServiceThreadingProfile();
threadingProfile.setDoThreading(false);
service.setThreadingProfile(threadingProfile);
final Thread mainThread = Thread.currentThread();
final SimpleCallableJavaComponent component = new SimpleCallableJavaComponent(new Callable()
{
@Override
public Object onCall(MuleEventContext eventContext) throws Exception
{
assertEquals(mainThread, Thread.currentThread());
latch.countDown();
return null;
}
});
component.setMuleContext(muleContext);
service.setComponent(component);
muleContext.getRegistry().registerService(service);
service.process(MuleTestUtils.getTestEvent("test",
getTestInboundEndpoint(MessageExchangePattern.ONE_WAY), muleContext));
assertTrue(latch.await(200, TimeUnit.MILLISECONDS));
}