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());
}
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;
}
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;
}
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);
}
}
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;
}
Aggregations