Search in sources :

Example 6 with Wiser

use of org.subethamail.wiser.Wiser in project modesti by jlsalmon.

the class MailConfig method wiser.

@Bean(initMethod = "start", destroyMethod = "stop")
public Wiser wiser() {
    Wiser wiser = new Wiser();
    wiser.setPort(25000);
    wiser.setHostname("localhost");
    return wiser;
}
Also used : Wiser(org.subethamail.wiser.Wiser) Bean(org.springframework.context.annotation.Bean)

Example 7 with Wiser

use of org.subethamail.wiser.Wiser in project jbpm by kiegroup.

the class EmailNotificationPublisherTest method setUp.

@Before
public void setUp() throws Exception {
    System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath());
    TemplateManager.reset();
    ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
    emailHost = props.getProperty("mail.smtp.host", "localhost");
    emailPort = props.getProperty("mail.smtp.port", "2345");
    wiser = new Wiser();
    wiser.setHostname(emailHost);
    wiser.setPort(Integer.parseInt(emailPort));
    wiser.start();
    Thread.sleep(200);
    connection = new Connection(emailHost, emailPort);
    userInfo = new DefaultUserInfo(true);
}
Also used : Wiser(org.subethamail.wiser.Wiser) ChainedProperties(org.kie.internal.utils.ChainedProperties) File(java.io.File) DefaultUserInfo(org.jbpm.services.task.identity.DefaultUserInfo) Before(org.junit.Before)

Example 8 with Wiser

use of org.subethamail.wiser.Wiser in project jbpm by kiegroup.

the class EmailWorkItemHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath());
    TemplateManager.reset();
    ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
    emailHost = props.getProperty("mail.smtp.host", "localhost");
    emailPort = props.getProperty("mail.smtp.port", "2345");
    wiser = new Wiser();
    wiser.setHostname(emailHost);
    wiser.setPort(Integer.parseInt(emailPort));
    wiser.start();
    Thread.sleep(200);
}
Also used : Wiser(org.subethamail.wiser.Wiser) ChainedProperties(org.kie.internal.utils.ChainedProperties) File(java.io.File) Before(org.junit.Before)

Example 9 with Wiser

use of org.subethamail.wiser.Wiser in project jbpm by kiegroup.

the class SendHtmlTest method setUp.

@Before
public void setUp() throws Exception {
    uniqueTestNum = random.nextInt(Integer.MAX_VALUE);
    emailHost = "localhost";
    int emailPortInt;
    do {
        emailPortInt = random.nextInt((2 * Short.MAX_VALUE - 1));
    } while (emailPortInt < 4096);
    emailPort = Integer.toString(emailPortInt);
    wiser = new Wiser(Integer.parseInt(emailPort));
    wiser.start();
}
Also used : Wiser(org.subethamail.wiser.Wiser) Before(org.junit.Before)

Example 10 with Wiser

use of org.subethamail.wiser.Wiser in project jbpm by kiegroup.

the class TaskReminderTest method setup.

@Before
public void setup() {
    final ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
    wiser = new Wiser();
    wiser.setHostname(props.getProperty("mail.smtp.host", "localhost"));
    wiser.setPort(Integer.parseInt(props.getProperty("mail.smtp.port", "2345")));
    wiser.start();
    try {
        Thread.sleep(1000);
    } catch (Throwable t) {
    // Do nothing
    }
    pds = setupPoolingDataSource();
    emf = Persistence.createEntityManagerFactory("org.jbpm.services.task");
    this.taskService = (InternalTaskService) HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).getTaskService();
}
Also used : Wiser(org.subethamail.wiser.Wiser) ChainedProperties(org.kie.internal.utils.ChainedProperties) Before(org.junit.Before)

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