@Test
public void testProcessOneWayThreadWaitTimeout() throws Exception
{
final int threadTimeout = 20;
ThreadingProfile threadingProfile = new ChainedThreadingProfile(
muleContext.getDefaultThreadingProfile());
threadingProfile.setThreadWaitTimeout(threadTimeout);
// Need 3 threads: 1 for polling, 2 to process work successfully without timeout
threadingProfile.setMaxThreadsActive(3);
threadingProfile.setPoolExhaustedAction(ThreadingProfile.WHEN_EXHAUSTED_WAIT);
threadingProfile.setMuleContext(muleContext);
MessageProcessor mockListener = mock(MessageProcessor.class);
when(mockListener.process((MuleEvent)any())).thenAnswer(new Answer<MuleEvent>()
{
public MuleEvent answer(InvocationOnMock invocation) throws Throwable