Package org.mule.execution

Examples of org.mule.execution.MuleMessageProcessingManager.processMessage()


        when(completeMessageProcessTemplateAndContext.validateMessage()).thenReturn(true);
        when(messageProcessPhase.compareTo(any(MessageProcessPhase.class))).thenCallRealMethod();
        when(messageProcessPhase.supportsTemplate(any(MessageProcessTemplate.class))).thenCallRealMethod();
        doCallRealMethod().when(messageProcessPhase).runPhase(any(MessageProcessTemplate.class), any(MessageProcessContext.class), any(PhaseResultNotifier.class));
        MuleMessageProcessingManager manager = createManagerUsingPhasesInRegistry(Arrays.<MessageProcessPhase>asList(messageProcessPhase));
        manager.processMessage(completeMessageProcessTemplateAndContext, completeMessageProcessTemplateAndContext);
        verify(completeMessageProcessTemplateAndContext, times(0)).routeEvent(any(MuleEvent.class));
        verify(completeMessageProcessTemplateAndContext, times(1)).validateMessage();
        verify(completeMessageProcessTemplateAndContext, times(1)).messageProcessingEnded();
    }
View Full Code Here


    public void testExceptionHandlerIsCalledDuringPhaseFailure() throws Exception
    {
        MessageProcessPhase failureMessageProcessPhase = createFailureMessageProcessPhase();
        when(mockMuleContext.getExceptionListener()).thenReturn(mockExceptionListener);
        MuleMessageProcessingManager manager = createManagerUsingPhasesInRegistry(Arrays.asList(failureMessageProcessPhase));
        manager.processMessage(completeMessageProcessTemplateAndContext, completeMessageProcessTemplateAndContext);
        verify(mockExceptionListener, times(1)).handleException(any(MuleException.class));
    }

    private MessageProcessPhase createFailureMessageProcessPhase()
    {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.