assertEquals("4", ((TestMessageProcessor) chain.getMessageProcessors().get(1)).getLabel());
}
public void testLocalEndpoints() throws MuleException
{
ImmutableEndpoint endpoint =
((ServiceCompositeMessageSource) muleContext.getRegistry().lookupService("localEndpoints").getMessageSource()).getEndpoint("ep3");
List <MessageProcessor> processors = endpoint.getMessageProcessors();
assertNotNull(processors);
assertEquals(2, processors.size());
assertEquals("A", ((TestMessageProcessor) processors.get(0)).getLabel());
assertEquals("B", ((TestMessageProcessor) processors.get(1)).getLabel());
processors = endpoint.getResponseMessageProcessors();
assertNotNull(processors);
assertEquals(1, processors.size());
assertTrue(processors.get(0) instanceof MessageProcessorChain);
MessageProcessorChain chain = (MessageProcessorChain) processors.get(0);
assertEquals(2, chain.getMessageProcessors().size());
assertEquals("C", ((TestMessageProcessor) chain.getMessageProcessors().get(0)).getLabel());
assertEquals("D", ((TestMessageProcessor) chain.getMessageProcessors().get(1)).getLabel());
MessageProcessor mp =
((OutboundPassThroughRouter) ((OutboundRouterCollection)muleContext.getRegistry().lookupService("localEndpoints").
getOutboundMessageProcessor()).getRoutes().get(0)).getRoute("ep4");
endpoint = (ImmutableEndpoint) mp;
processors = endpoint.getMessageProcessors();
assertNotNull(processors);
assertEquals(2, processors.size());
assertEquals("E", ((TestMessageProcessor) processors.get(0)).getLabel());
assertEquals("F", ((TestMessageProcessor) processors.get(1)).getLabel());
processors = endpoint.getResponseMessageProcessors();
assertNotNull(processors);
assertEquals(1, processors.size());
assertTrue(processors.get(0) instanceof MessageProcessorChain);
chain = (MessageProcessorChain) processors.get(0);
assertEquals(2, chain.getMessageProcessors().size());