Package org.mule.api.processor

Examples of org.mule.api.processor.MessageProcessor.process()


            throw new IllegalArgumentException("Flow " + name + " does not exist");
        }

        initialiseSubFlow(flow);

        return flow.process(event);
    }

    private void initialiseSubFlow(MessageProcessor flow) throws InitialisationException
    {
        if (flow instanceof SubflowInterceptingChainLifecycleWrapper)
View Full Code Here


        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());

        try
        {
            result = mpChain.process(requestEvent);
            fail("Filter should have thrown a FilterException");
        }
        catch (FilterUnacceptedException e)
        {
            // expected
View Full Code Here

        endpoint.setListener(inboundListener);
        requestEvent = createTestRequestEvent(endpoint);
        responseEvent = createTestResponseEvent(endpoint);

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());
        result = mpChain.process(requestEvent);

        assertMessageSentSame(true);
        assertEquals(responseEvent.getMessage(), result.getMessage());

    }
View Full Code Here

        // Required for UnauthorisedException creation
        RequestContext.setEvent(requestEvent);

        try
        {
            result = mpChain.process(requestEvent);
            fail("Exception expected");
        }
        catch (TestSecurityFilter.StaticMessageUnauthorisedException e)
        {
            requestEvent.getFlowConstruct().getExceptionListener().handleException(e, requestEvent);
View Full Code Here

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());

        try
        {
            result = mpChain.process(requestEvent);
            fail("Filter should have thrown a FilterException");
        }
        catch (FilterUnacceptedException e)
        {
            // expected
View Full Code Here

        requestEvent = createTestRequestEvent(endpoint);
        responseEvent = createTestResponseEvent(endpoint);
        responseEvent.getMessage().setExceptionPayload(new DefaultExceptionPayload(new RuntimeException()));

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());
        result = mpChain.process(requestEvent);

        assertMessageSentSame(true);
        assertEquals(responseEvent.getMessage(), result.getMessage());
        final int status = result.getMessage().getOutboundProperty("status", 0);
        assertEquals(500, status);
View Full Code Here

        // Required for UnauthorisedException creation
        RequestContext.setEvent(requestEvent);

        try
        {
            result = mpChain.process(requestEvent);
            fail("Exception expected");
        }
        catch (TestSecurityFilter.StaticMessageUnauthorisedException e)
        {
            // expected
View Full Code Here

        endpoint.setListener(inboundListener);
        requestEvent = createTestRequestEvent(endpoint);
        responseEvent = createTestResponseEvent(endpoint);

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());
        result = mpChain.process(requestEvent);

        assertTrue(listener.latch.await(RECEIVE_TIMEOUT, TimeUnit.MILLISECONDS));
        assertEquals(EndpointMessageNotification.MESSAGE_RECEIVED, listener.messageNotification.getAction());
        assertEquals(endpoint.getEndpointURI().getUri().toString(),
            listener.messageNotification.getEndpoint());
View Full Code Here

        endpoint.setListener(inboundListener);
        requestEvent = createTestRequestEvent(endpoint);
        responseEvent = createTestResponseEvent(endpoint);

        MessageProcessor mpChain = ((AbstractEndpoint) endpoint).getMessageProcessorChain(requestEvent.getFlowConstruct());
        result = mpChain.process(requestEvent);

        assertMessageSent(true);
        assertEquals(TEST_MESSAGE + InboundAppendTransformer.APPEND_STRING,
            inboundListener.sensedEvent.getMessageAsString());
View Full Code Here

    {
        DefaultMessageProcessorChainBuilder builder = new DefaultMessageProcessorChainBuilder();
        builder.chain(new TestMessageProcessor("1"), new TestMessageProcessor("2"), new TestMessageProcessor("3"));
        MessageProcessor mpChain = builder.build();
       
        result = mpChain.process(requestEvent);
        assertEquals(TEST_MESSAGE + ":1:2:3", result.getMessage().getPayload());
    }

    public void testNoProcessors() throws Exception
    {
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.