}
public void testSend() throws Exception
{
//muleContext.getRegistry().registerConnector(createConnector(false));
OutboundEndpoint endpoint = muleContext.getEndpointFactory().getOutboundEndpoint(
getTestEndpointURI());
Service service = getTestService(uniqueName("testComponent"), FunctionalTestComponent.class);
// TODO Simplify this API for adding an outbound endpoint.
OutboundPassThroughRouter passThroughRouter = new OutboundPassThroughRouter();
passThroughRouter.addRoute(endpoint);
((OutboundRouterCollection) service.getOutboundMessageProcessor()).addRoute(passThroughRouter);
//muleContext.getRegistry().registerComponent(service);
MuleMessage message = new DefaultMuleMessage(MESSAGE, muleContext);
message.setOutboundProperty(MailProperties.TO_ADDRESSES_PROPERTY, EMAIL);
MuleSession session = getTestSession(getTestService("apple", Apple.class), muleContext);
DefaultMuleEvent event = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, session,
new ResponseOutputStream(System.out));
endpoint.process(event);
getServers().waitForIncomingEmail(AbstractEmailFunctionalTestCase.DELIVERY_DELAY_MS, 1);
MimeMessage[] messages = getServers().getReceivedMessages();
assertNotNull("did not receive any messages", messages);
assertEquals("did not receive 1 mail", 1, messages.length);