本文整理汇总了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);
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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));
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}