Search in sources :

Example 6 with AsyncDelegateMessageProcessor

use of org.mule.runtime.core.internal.processor.AsyncDelegateMessageProcessor in project mule by mulesoft.

the class AsyncRequestReplyRequesterTestCase method testSingleEventNoTimeoutAsync.

@Test
public void testSingleEventNoTimeoutAsync() throws Exception {
    asyncReplyMP = new TestAsyncRequestReplyRequester(muleContext);
    SensingNullMessageProcessor target = getSensingNullMessageProcessor();
    AsyncDelegateMessageProcessor asyncMP = createAsyncMessageProcessor(target);
    initialiseIfNeeded(asyncMP, true, muleContext);
    asyncMP.start();
    asyncReplyMP.setListener(asyncMP);
    asyncReplyMP.setReplySource(target.getMessageSource());
    asyncReplyMP.setMuleContext(muleContext);
    CoreEvent resultEvent = asyncReplyMP.process(testEvent());
    // Can't assert same because we copy event for async and also on async reply currently
    assertEquals(((PrivilegedEvent) testEvent()).getMessageAsString(muleContext), ((PrivilegedEvent) resultEvent).getMessageAsString(muleContext));
}
Also used : CoreEvent(org.mule.runtime.core.api.event.CoreEvent) AsyncDelegateMessageProcessor(org.mule.runtime.core.internal.processor.AsyncDelegateMessageProcessor) SensingNullMessageProcessor(org.mule.tck.SensingNullMessageProcessor) Test(org.junit.Test)

Aggregations

AsyncDelegateMessageProcessor (org.mule.runtime.core.internal.processor.AsyncDelegateMessageProcessor)6 Test (org.junit.Test)4 CoreEvent (org.mule.runtime.core.api.event.CoreEvent)3 DefaultMessageProcessorChainBuilder (org.mule.runtime.core.privileged.processor.chain.DefaultMessageProcessorChainBuilder)3 SensingNullMessageProcessor (org.mule.tck.SensingNullMessageProcessor)3 MuleException (org.mule.runtime.api.exception.MuleException)2 InitialisationException (org.mule.runtime.api.lifecycle.InitialisationException)2 ResponseTimeoutException (org.mule.runtime.core.privileged.routing.ResponseTimeoutException)2 Description (io.qameta.allure.Description)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 TimeoutException (java.util.concurrent.TimeoutException)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Ignore (org.junit.Ignore)1 NameableObject (org.mule.runtime.api.meta.NameableObject)1 Latch (org.mule.runtime.api.util.concurrent.Latch)1 Processor (org.mule.runtime.core.api.processor.Processor)1 MessageProcessorBuilder (org.mule.runtime.core.privileged.processor.MessageProcessorBuilder)1 JUnitLambdaProbe (org.mule.tck.probe.JUnitLambdaProbe)1 PollingProber (org.mule.tck.probe.PollingProber)1