Package org.mule.api.processor

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


        assertSame("Policy has not been registered.", ap, chain.getPolicies().list().iterator().next());

        System.out.println(chain);

        // invoke
        final MuleEvent result = chain.process(getTestEvent("payload "));
        assertNotNull(result);
        final MuleMessage message = result.getMessage();
        assertNotNull(message);
        assertEquals("payload {before} first second {after}", message.getPayload());
View Full Code Here


        assertEquals("Wrong policies count.", 2, chain.getPolicies().list().size());

        System.out.println(chain);

        // invoke
        final MuleEvent result = chain.process(getTestEvent("payload "));
        assertNotNull(result);
        final MuleMessage message = result.getMessage();
        assertNotNull(message);
        assertEquals("payload {before} {before} first second {after} {after}", message.getPayload());
View Full Code Here

    public void testMixStaticFactoryt() throws Exception
    {
        MessageProcessorChain chain = DefaultMessageProcessorChain.from(new TestIntercepting(),
            new TestNonIntercepting(), new TestNonIntercepting(), new TestIntercepting(),
            new TestNonIntercepting(), new TestNonIntercepting());
        MuleEvent restul = chain.process(getTestEventUsingFlow(""));
        assertEquals(
            "InterceptingMessageProcessorMessageProcessorMessageProcessorInterceptingMessageProcessorMessageProcessorMessageProcessor",
            restul.getMessageAsString());
    }
View Full Code Here

    public void testMix2StaticFactory() throws Exception
    {
        MessageProcessorChain chain = DefaultMessageProcessorChain.from(new TestNonIntercepting(),
            new TestIntercepting(), new TestNonIntercepting(), new TestNonIntercepting(),
            new TestNonIntercepting(), new TestIntercepting());
        MuleEvent restul = chain.process(getTestEventUsingFlow(""));
        assertEquals(
            "MessageProcessorInterceptingMessageProcessorMessageProcessorMessageProcessorMessageProcessorInterceptingMessageProcessor",
            restul.getMessageAsString());
    }
View Full Code Here

    public void testMixStaticFactoryt() throws Exception
    {
        MessageProcessorChain chain = DefaultMessageProcessorChain.from(new TestIntercepting(),
            new TestNonIntercepting(), new TestNonIntercepting(), new TestIntercepting(),
            new TestNonIntercepting(), new TestNonIntercepting());
        MuleEvent restul = chain.process(getTestEventUsingFlow(""));
        assertEquals(
            "InterceptingMessageProcessorMessageProcessorMessageProcessorInterceptingMessageProcessorMessageProcessorMessageProcessor",
            restul.getMessage().getPayload());
    }
View Full Code Here

    public void testMix2StaticFactory() throws Exception
    {
        MessageProcessorChain chain = DefaultMessageProcessorChain.from(new TestNonIntercepting(),
            new TestIntercepting(), new TestNonIntercepting(), new TestNonIntercepting(),
            new TestNonIntercepting(), new TestIntercepting());
        MuleEvent restul = chain.process(getTestEventUsingFlow(""));
        assertEquals(
            "MessageProcessorInterceptingMessageProcessorMessageProcessorMessageProcessorMessageProcessorInterceptingMessageProcessor",
            restul.getMessage().getPayload());
    }
View Full Code Here

            withSettings().extraInterfaces(OutboundEndpoint.class));
        OutboundEndpoint outboundEndpoint = (OutboundEndpoint) mp;
        when(outboundEndpoint.getExchangePattern()).thenReturn(MessageExchangePattern.ONE_WAY);

        MessageProcessorChain chain = new DefaultMessageProcessorChainBuilder().chain(mp).build();
        MuleEvent response = chain.process(event);
        assertNull(response);
    }

    @Test
    public void testOneWayOutboundEndpointWithFlow() throws Exception
View Full Code Here

        OutboundEndpoint outboundEndpoint = (OutboundEndpoint) mp;
        when(outboundEndpoint.getExchangePattern()).thenReturn(MessageExchangePattern.ONE_WAY);
        when(mp.process(Mockito.any(MuleEvent.class))).thenReturn(VoidMuleEvent.getInstance());

        MessageProcessorChain chain = new DefaultMessageProcessorChainBuilder().chain(mp).build();
        MuleEvent response = chain.process(event);
        assertSame(event, response);
    }

    static class TestNonIntercepting implements MessageProcessor
    {
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.