Package org.mule.transport.email

Examples of org.mule.transport.email.FixedPortGreenMailSupport


        if (variant.equals(ConfigVariant.SERVICE))
        {
            //((Lifecycle)getFlowConstruct("RollbackTransactionAndSendEmail")).stop(); is not working as expected
            return;
        }
        FixedPortGreenMailSupport greenMailSupport = new FixedPortGreenMailSupport(dynamicPort2.getNumber());

        List<Integer> ports = new ArrayList<Integer>(6);
        ports.add(dynamicPort1.getNumber());
        ports.add(dynamicPort2.getNumber());
        ports.add(dynamicPort3.getNumber());
        ports.add(dynamicPort4.getNumber());
        ports.add(dynamicPort5.getNumber());
        ports.add(dynamicPort6.getNumber());

        greenMailSupport.startServers(ports);
        LocalMuleClient client = muleContext.getClient();
        client.dispatch("jms://in6?connector=jmsConnectorNoRedelivery", MESSAGE_TO_SEND, null);
        endMessageProcessorExecuted.await(TIMEOUT, TimeUnit.MILLISECONDS);
        ((Lifecycle) getFlowConstruct("RollbackTransactionAndSendEmail")).stop();
        MuleMessage response = client.request("jms://in6?connector=jmsConnectorNoRedelivery", TIMEOUT);
        assertThat(response, IsNull.<Object>notNullValue());
        assertThat(response.getPayloadAsString(), is(MESSAGE_TO_SEND));
        greenMailSupport.getServers().waitForIncomingEmail(AbstractEmailFunctionalTestCase.DELIVERY_DELAY_MS, 1);
        MimeMessage[] messages = greenMailSupport.getServers().getReceivedMessages();
        assertNotNull("did not receive any messages", messages);
        assertEquals("did not receive 1 mail", 1, messages.length);
    }
View Full Code Here

TOP

Related Classes of org.mule.transport.email.FixedPortGreenMailSupport

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.