Package org.mule.execution

Examples of org.mule.execution.MuleMessageProcessingManager


            DefaultObjectStoreFactoryBean.createDefaultUserObjectStore());
        registry.registerObject(MuleProperties.DEFAULT_USER_TRANSIENT_OBJECT_STORE_NAME,
            DefaultObjectStoreFactoryBean.createDefaultUserTransientObjectStore());
        registry.registerObject(MuleProperties.OBJECT_STORE_MANAGER, new MuleObjectStoreManager());
        registry.registerObject(MuleProperties.OBJECT_DEFAULT_MESSAGE_PROCESSING_MANAGER,
            new MuleMessageProcessingManager());

        registry.registerObject(MuleProperties.OBJECT_MULE_ENDPOINT_FACTORY, new DefaultEndpointFactory());
        registry.registerObject(MuleProperties.OBJECT_MULE_STREAM_CLOSER_SERVICE,
            new DefaultStreamCloserService());
View Full Code Here


        PhaseAfterValidationBeforeFlow messageProcessPhase = createPhaseAfterValidation();
        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

    @Test
    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));
    }
View Full Code Here

        return notSupportedPhase;
    }

    private void processAndVerifyDefaultPhasesUsingRegistryPhases(Collection<MessageProcessPhase> phasesInRegistry) throws Exception
    {
        MuleMessageProcessingManager manager = createManagerUsingPhasesInRegistry(phasesInRegistry);
        processAndVerifyDefaultPhasesAreExecuted(manager);
    }
View Full Code Here

        processAndVerifyDefaultPhasesAreExecuted(manager);
    }

    private MuleMessageProcessingManager createManagerUsingPhasesInRegistry(Collection<MessageProcessPhase> phasesInRegistry) throws InitialisationException
    {
        MuleMessageProcessingManager manager = new MuleMessageProcessingManager();
        manager.setMuleContext(mockMuleContext);
        when(mockMuleContext.getRegistry().lookupObjects(MessageProcessPhase.class)).thenReturn(phasesInRegistry);
        manager.initialise();
        return manager;
    }
View Full Code Here

TOP

Related Classes of org.mule.execution.MuleMessageProcessingManager

Copyright © 2018 www.massapicom. 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.