Search in sources :

Example 6 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project wso2-axis2-transports by wso2.

the class GreenMailTestEnvironment method setUp.

@Setup
@SuppressWarnings("unused")
private void setUp(LogManager logManager, PortAllocator portAllocator) throws Exception {
    this.logManager = logManager;
    this.portAllocator = portAllocator;
    smtpServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", ServerSetup.PROTOCOL_SMTP);
    storeServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", protocol);
    greenMail = new GreenMail(new ServerSetup[] { smtpServerSetup, storeServerSetup });
    greenMail.start();
    smtpTunnel = new Tunnel(new InetSocketAddress("127.0.0.1", smtpServerSetup.getPort()));
    smtpTunnel.start();
    unallocatedAccounts = new LinkedList<Account>();
    ServerUtil.waitForServer(smtpServerSetup.getPort());
    ServerUtil.waitForServer(storeServerSetup.getPort());
}
Also used : Tunnel(org.apache.axis2.transport.testkit.util.tcpmon.Tunnel) InetSocketAddress(java.net.InetSocketAddress) ServerSetup(com.icegreen.greenmail.util.ServerSetup) GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup) Setup(org.apache.axis2.transport.testkit.tests.Setup)

Example 7 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project robozonky by RoboZonky.

the class EmailingListenerTest method getServerSetup.

private static ServerSetup getServerSetup() {
    final ServerSetup setup = ServerSetupTest.SMTP;
    setup.setServerStartupTimeout(5000);
    setup.setVerbose(true);
    return setup;
}
Also used : ServerSetup(com.icegreen.greenmail.util.ServerSetup)

Example 8 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project robozonky by RoboZonky.

the class EmailSettingsValidatorTest method getServerSetup.

private static ServerSetup getServerSetup() {
    final ServerSetup setup = ServerSetupTest.SMTP;
    setup.setServerStartupTimeout(5000);
    setup.setVerbose(true);
    return setup;
}
Also used : ServerSetup(com.icegreen.greenmail.util.ServerSetup)

Example 9 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project sandbox by irof.

the class Server method main.

public static void main(String[] args) throws Exception {
    GreenMail greenMail = new GreenMail(new ServerSetup[] { new ServerSetup(3025, "0.0.0.0", ServerSetup.PROTOCOL_SMTP), new ServerSetup(3110, "0.0.0.0", ServerSetup.PROTOCOL_POP3) });
    try (AutoCloseable ac = greenMail::stop) {
        greenMail.setUser("xxx@example.com", "xxx", "yyy");
        greenMail.start();
        TimeUnit.SECONDS.sleep(30);
    }
}
Also used : GreenMail(com.icegreen.greenmail.util.GreenMail) ServerSetup(com.icegreen.greenmail.util.ServerSetup)

Example 10 with ServerSetup

use of com.icegreen.greenmail.util.ServerSetup in project sandbox by irof.

the class GreenMailTest method createMessage.

private MimeMessage createMessage() {
    ServerSetup serverSetup = ServerSetupTest.IMAP;
    MimeMessage message = GreenMailUtil.createTextEmail("to@example.com", "from@example.com", "some test subject", "some test body", serverSetup);
    return message;
}
Also used : MimeMessage(javax.mail.internet.MimeMessage) ServerSetup(com.icegreen.greenmail.util.ServerSetup)

Aggregations

ServerSetup (com.icegreen.greenmail.util.ServerSetup)14 GreenMail (com.icegreen.greenmail.util.GreenMail)10 Before (org.junit.Before)5 Properties (java.util.Properties)2 BeforeClass (org.testng.annotations.BeforeClass)2 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)1 UserFilterField (com.sequenceiq.cloudbreak.common.service.user.UserFilterField)1 InputStream (java.io.InputStream)1 InetSocketAddress (java.net.InetSocketAddress)1 Date (java.util.Date)1 MimeMessage (javax.mail.internet.MimeMessage)1 Setup (org.apache.axis2.transport.testkit.tests.Setup)1 Tunnel (org.apache.axis2.transport.testkit.util.tcpmon.Tunnel)1 Services (org.apache.oozie.service.Services)1 SLAEmailEventListener (org.apache.oozie.sla.listener.SLAEmailEventListener)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 JavaMailSender (org.springframework.mail.javamail.JavaMailSender)1 JavaMailSenderImpl (org.springframework.mail.javamail.JavaMailSenderImpl)1