当前位置: 首页>>代码示例>>Java>>正文


Java WiserMessage类代码示例

本文整理汇总了Java中org.subethamail.wiser.WiserMessage的典型用法代码示例。如果您正苦于以下问题:Java WiserMessage类的具体用法?Java WiserMessage怎么用?Java WiserMessage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WiserMessage类属于org.subethamail.wiser包,在下文中一共展示了WiserMessage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSimpleTextMailWhenMultiTenant

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
public void testSimpleTextMailWhenMultiTenant() throws Exception {
    String tenantId = "myEmailTenant";

    org.flowable.engine.repository.Deployment deployment = repositoryService.createDeployment()
            .addClasspathResource("org/activiti/engine/test/bpmn/mail/EmailSendTaskTest.testSimpleTextMail.bpmn20.xml")
            .tenantId(tenantId)
            .deploymentProperty(DeploymentProperties.DEPLOY_AS_FLOWABLE5_PROCESS_DEFINITION, Boolean.TRUE)
            .deploy();
    String procId = runtimeService.startProcessInstanceByKeyAndTenantId("simpleTextOnly", tenantId).getId();

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "[email protected]",
            Collections.singletonList("[email protected]"), null);
    assertProcessEnded(procId);

    repositoryService.deleteDeployment(deployment.getId(), true);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:21,代码来源:EmailServiceTaskTest.java

示例2: testSimpleTextMailMultipleRecipients

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testSimpleTextMailMultipleRecipients() {
    runtimeService.startProcessInstanceByKey("simpleTextOnlyMultipleRecipients");

    // 3 recipients == 3 emails in wiser with different receivers
    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(3, messages.size());

    // sort recipients for easy assertion
    List<String> recipients = new ArrayList<String>();
    for (WiserMessage message : messages) {
        recipients.add(message.getEnvelopeReceiver());
    }
    Collections.sort(recipients);

    assertEquals("[email protected]", recipients.get(0));
    assertEquals("[email protected]", recipients.get(1));
    assertEquals("[email protected]", recipients.get(2));
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:EmailServiceTaskTest.java

示例3: testTextMailExpressions

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailExpressions() throws Exception {

    String sender = "[email protected]";
    String recipient = "[email protected]";
    String recipientName = "Mr. Fozzie";
    String subject = "Fozzie, you should see this!";

    Map<String, Object> vars = new HashMap<String, Object>();
    vars.put("sender", sender);
    vars.put("recipient", recipient);
    vars.put("recipientName", recipientName);
    vars.put("subject", subject);

    runtimeService.startProcessInstanceByKey("textMailExpressions", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    assertEmailSend(message, false, subject, "Hello " + recipientName + ", this is an e-mail",
            sender, Collections.singletonList(recipient), null);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:EmailServiceTaskTest.java

示例4: testTextMailWithFileAttachments

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithFileAttachments() throws Exception {
    HashMap<String, Object> vars = new HashMap<String, Object>();
    vars.put("attachmentsBean", new AttachmentsBean());
    runtimeService.startProcessInstanceByKey("textMailWithFileAttachments", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    File[] files = new AttachmentsBean().getFiles();
    assertEquals(1 + files.length, mm.getCount());
    for (int i = 0; i < files.length; i++) {
        String attachmentFileName = mm.getBodyPart(1 + i).getDataHandler().getName();
        assertEquals(files[i].getName(), attachmentFileName);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:EmailServiceTaskTest.java

示例5: testTextMailWithFileAttachmentsByPath

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithFileAttachmentsByPath() throws Exception {
    HashMap<String, Object> vars = new HashMap<String, Object>();
    vars.put("attachmentsBean", new AttachmentsBean());
    runtimeService.startProcessInstanceByKey("textMailWithFileAttachmentsByPath", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    File[] files = new AttachmentsBean().getFiles();
    assertEquals(1 + files.length, mm.getCount());
    for (int i = 0; i < files.length; i++) {
        String attachmentFileName = mm.getBodyPart(1 + i).getDataHandler().getName();
        assertEquals(files[i].getName(), attachmentFileName);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:EmailServiceTaskTest.java

示例6: testTextMailWithDataSourceAttachment

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithDataSourceAttachment() throws Exception {
    String fileName = "file-name-to-be-displayed";
    String fileContent = "This is the file content";
    HashMap<String, Object> vars = new HashMap<String, Object>();
    vars.put("attachmentsBean", new AttachmentsBean());
    vars.put("fileContent", fileContent);
    vars.put("fileName", fileName);
    runtimeService.startProcessInstanceByKey("textMailWithDataSourceAttachment", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    assertEquals(2, mm.getCount());
    String attachmentFileName = mm.getBodyPart(1).getDataHandler().getName();
    assertEquals(fileName, attachmentFileName);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:EmailServiceTaskTest.java

示例7: testSimpleTextMail

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testSimpleTextMail() throws Exception {
    String procId = runtimeService.startProcessInstanceByKey("simpleTextOnly").getId();

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(0, messages.size());

    waitForJobExecutorToProcessAllJobs(5000L, 25L);

    messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    EmailServiceTaskTest.assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "[email protected]",
            Collections.singletonList("[email protected]"), null);
    assertProcessEnded(procId);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:AsyncEmailTaskTest.java

示例8: testSimpleTextMailSendTask

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testSimpleTextMailSendTask() throws Exception {
    runtimeService.startProcessInstanceByKey("simpleTextOnly");

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(0, messages.size());

    waitForJobExecutorToProcessAllJobs(5000L, 25L);

    messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    EmailServiceTaskTest.assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "[email protected]",
            Collections.singletonList("[email protected]"), null);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:17,代码来源:AsyncEmailTaskTest.java

示例9: testSimpleTextMailWhenMultiTenant

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
public void testSimpleTextMailWhenMultiTenant() throws Exception {
    String tenantId = "myEmailTenant";

    repositoryService.createDeployment()
            .addClasspathResource("org/flowable/engine/test/bpmn/mail/EmailSendTaskTest.testSimpleTextMail.bpmn20.xml")
            .tenantId(tenantId).deploy();
    String procId = runtimeService.startProcessInstanceByKeyAndTenantId("simpleTextOnly", tenantId).getId();

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "[email protected]", Collections.singletonList(
            "[email protected]"), null);
    assertProcessEnded(procId);

    deleteDeployments();
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:EmailServiceTaskTest.java

示例10: testSimpleTextMailForNonExistentTenant

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
public void testSimpleTextMailForNonExistentTenant() throws Exception {
    String tenantId = "nonExistentTenant";

    repositoryService.createDeployment()
            .addClasspathResource("org/flowable/engine/test/bpmn/mail/EmailSendTaskTest.testSimpleTextMail.bpmn20.xml")
            .tenantId(tenantId).deploy();
    String procId = runtimeService.startProcessInstanceByKeyAndTenantId("simpleTextOnly", tenantId).getId();

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    assertEmailSend(message, false, "Hello Kermit!", "This a text only e-mail.", "[email protected]", Collections.singletonList(
            "[email protected]"), null);
    assertProcessEnded(procId);

    deleteDeployments();
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:EmailServiceTaskTest.java

示例11: testSimpleTextMailMultipleRecipients

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testSimpleTextMailMultipleRecipients() {
    runtimeService.startProcessInstanceByKey("simpleTextOnlyMultipleRecipients");

    // 3 recipients == 3 emails in wiser with different receivers
    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(3, messages.size());

    // sort recipients for easy assertion
    List<String> recipients = new ArrayList<>();
    for (WiserMessage message : messages) {
        recipients.add(message.getEnvelopeReceiver());
    }
    Collections.sort(recipients);

    assertEquals("[email protected]", recipients.get(0));
    assertEquals("[email protected]", recipients.get(1));
    assertEquals("[email protected]", recipients.get(2));
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:20,代码来源:EmailServiceTaskTest.java

示例12: testTextMailExpressions

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailExpressions() throws Exception {

    String sender = "[email protected]";
    String recipient = "[email protected]";
    String recipientName = "Mr. Fozzie";
    String subject = "Fozzie, you should see this!";

    Map<String, Object> vars = new HashMap<>();
    vars.put("sender", sender);
    vars.put("recipient", recipient);
    vars.put("recipientName", recipientName);
    vars.put("subject", subject);

    runtimeService.startProcessInstanceByKey("textMailExpressions", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());

    WiserMessage message = messages.get(0);
    assertEmailSend(message, false, subject, "Hello " + recipientName + ", this is an e-mail", sender, Collections.singletonList(
            recipient), null);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:24,代码来源:EmailServiceTaskTest.java

示例13: testTextMailWithFileAttachments

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithFileAttachments() throws Exception {
    HashMap<String, Object> vars = new HashMap<>();
    vars.put("attachmentsBean", new AttachmentsBean());
    runtimeService.startProcessInstanceByKey("textMailWithFileAttachments", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    File[] files = new AttachmentsBean().getFiles();
    assertEquals(1 + files.length, mm.getCount());
    for (int i = 0; i < files.length; i++) {
        String attachmentFileName = mm.getBodyPart(1 + i).getDataHandler().getName();
        assertEquals(files[i].getName(), attachmentFileName);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:EmailServiceTaskTest.java

示例14: testTextMailWithFileAttachmentsByPath

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithFileAttachmentsByPath() throws Exception {
    HashMap<String, Object> vars = new HashMap<>();
    vars.put("attachmentsBean", new AttachmentsBean());
    runtimeService.startProcessInstanceByKey("textMailWithFileAttachmentsByPath", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    File[] files = new AttachmentsBean().getFiles();
    assertEquals(1 + files.length, mm.getCount());
    for (int i = 0; i < files.length; i++) {
        String attachmentFileName = mm.getBodyPart(1 + i).getDataHandler().getName();
        assertEquals(files[i].getName(), attachmentFileName);
    }
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:18,代码来源:EmailServiceTaskTest.java

示例15: testTextMailWithDataSourceAttachment

import org.subethamail.wiser.WiserMessage; //导入依赖的package包/类
@Deployment
public void testTextMailWithDataSourceAttachment() throws Exception {
    String fileName = "file-name-to-be-displayed";
    String fileContent = "This is the file content";
    HashMap<String, Object> vars = new HashMap<>();
    vars.put("attachmentsBean", new AttachmentsBean());
    vars.put("fileContent", fileContent);
    vars.put("fileName", fileName);
    runtimeService.startProcessInstanceByKey("textMailWithDataSourceAttachment", vars);

    List<WiserMessage> messages = wiser.getMessages();
    assertEquals(1, messages.size());
    WiserMessage message = messages.get(0);
    MimeMultipart mm = (MimeMultipart) message.getMimeMessage().getContent();
    assertEquals(2, mm.getCount());
    String attachmentFileName = mm.getBodyPart(1).getDataHandler().getName();
    assertEquals(fileName, attachmentFileName);
}
 
开发者ID:flowable,项目名称:flowable-engine,代码行数:19,代码来源:EmailServiceTaskTest.java


注:本文中的org.subethamail.wiser.WiserMessage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。