Search in sources :

Example 1 with Wiser

use of org.subethamail.wiser.Wiser in project sonarqube by SonarSource.

the class EmailsTest method before.

@BeforeClass
public static void before() throws Exception {
    ADMIN_WS_CLIENT = newAdminWsClient(orchestrator);
    SETTINGS = ADMIN_WS_CLIENT.settingsService();
    SMTP_SERVER = new Wiser(0);
    SMTP_SERVER.start();
    System.out.println("SMTP Server port: " + SMTP_SERVER.getServer().getPort());
}
Also used : Wiser(org.subethamail.wiser.Wiser) BeforeClass(org.junit.BeforeClass)

Example 2 with Wiser

use of org.subethamail.wiser.Wiser in project sonarqube by SonarSource.

the class EmailNotificationChannelTest method setUp.

@Before
public void setUp() {
    smtpServer = new Wiser(0);
    smtpServer.start();
    configuration = mock(EmailSettings.class);
    underTest = new EmailNotificationChannel(configuration, null, null);
}
Also used : Wiser(org.subethamail.wiser.Wiser) EmailSettings(org.sonar.api.config.EmailSettings) Before(org.junit.Before)

Example 3 with Wiser

use of org.subethamail.wiser.Wiser in project Activiti by Activiti.

the class EmailTestCase method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    boolean serverUpAndRunning = false;
    while (!serverUpAndRunning) {
        wiser = new Wiser();
        wiser.setPort(5025);
        try {
            wiser.start();
            serverUpAndRunning = true;
        } catch (RuntimeException e) {
            // Fix for slow port-closing Jenkins
            if (e.getMessage().toLowerCase().contains("bindexception")) {
                Thread.sleep(250L);
            }
        }
    }
}
Also used : Wiser(org.subethamail.wiser.Wiser)

Example 4 with Wiser

use of org.subethamail.wiser.Wiser in project sling by apache.

the class SimpleMailServiceIT method setup.

@Before
public void setup() throws Exception {
    final int smtpPort = findFreePort();
    wiser = new Wiser(smtpPort);
    wiser.start();
}
Also used : Wiser(org.subethamail.wiser.Wiser) Before(org.junit.Before)

Example 5 with Wiser

use of org.subethamail.wiser.Wiser in project kernel by exoplatform.

the class TestMailService method setUp.

public void setUp() throws Exception {
    PortalContainer pcontainer = PortalContainer.getInstance();
    service = (MailService) pcontainer.getComponentInstanceOfType(MailService.class);
    // starting dummy SMTP Server
    mailServer = new Wiser();
    mailServer.setPort(SMTP_PORT);
    mailServer.start();
}
Also used : Wiser(org.subethamail.wiser.Wiser) PortalContainer(org.exoplatform.container.PortalContainer)

Aggregations

Wiser (org.subethamail.wiser.Wiser)43 MailMessageImpl (com.outjected.email.impl.MailMessageImpl)21 Test (org.junit.Test)21 SessionConfig (com.outjected.email.api.SessionConfig)20 MimeMessage (javax.mail.internet.MimeMessage)18 EmailMessage (com.outjected.email.api.EmailMessage)17 BodyPart (javax.mail.BodyPart)15 MimeMultipart (javax.mail.internet.MimeMultipart)15 Before (org.junit.Before)9 URLAttachment (com.outjected.email.impl.attachments.URLAttachment)8 FreeMarkerTemplate (com.outjected.email.impl.templating.freemarker.FreeMarkerTemplate)6 VelocityTemplate (com.outjected.email.impl.templating.velocity.VelocityTemplate)6 BeforeClass (org.junit.BeforeClass)4 ChainedProperties (org.kie.internal.utils.ChainedProperties)4 SMTPAuthenticator (com.outjected.email.util.SMTPAuthenticator)2 File (java.io.File)2 EasyAuthenticationHandlerFactory (org.subethamail.smtp.auth.EasyAuthenticationHandlerFactory)2 SimpleMailConfig (com.outjected.email.impl.SimpleMailConfig)1 PortalContainer (org.exoplatform.container.PortalContainer)1 DefaultUserInfo (org.jbpm.services.task.identity.DefaultUserInfo)1