Search in sources :

Example 26 with MimePackage

use of com.axway.ats.action.objects.MimePackage in project ats-framework by Axway.

the class Test_StringInMimePartRule method setUp.

@Before
public void setUp() throws PackageException, RbvException {
    mailMessage = new MimePackage(Test_StringInMimePartRule.class.getResourceAsStream("mail_with_text_plain_attachment.msg"));
    metaData = new ImapMetaData(mailMessage);
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) Before(org.junit.Before)

Example 27 with MimePackage

use of com.axway.ats.action.objects.MimePackage in project ats-framework by Axway.

the class Test_OrRuleOperation method setUpTest_AndRuleOperation.

@BeforeClass
public static void setUpTest_AndRuleOperation() throws PackageException, RbvException {
    MimePackage testMessage = new MimePackage(Test_ImapStorage.class.getResourceAsStream("mail.msg"));
    //init the meta data with the test message
    metaData = new ImapMetaData(testMessage);
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) Test_ImapStorage(com.axway.ats.rbv.imap.Test_ImapStorage) BeforeClass(org.junit.BeforeClass)

Example 28 with MimePackage

use of com.axway.ats.action.objects.MimePackage in project ats-framework by Axway.

the class Test_AndRuleOperation method setUpTest_AndRuleOperation.

@BeforeClass
public static void setUpTest_AndRuleOperation() throws PackageException, RbvException {
    MimePackage testMessage = new MimePackage(Test_ImapStorage.class.getResourceAsStream("mail.msg"));
    //init the meta data with the test message
    metaData = new ImapMetaData(testMessage);
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) Test_ImapStorage(com.axway.ats.rbv.imap.Test_ImapStorage) BeforeClass(org.junit.BeforeClass)

Example 29 with MimePackage

use of com.axway.ats.action.objects.MimePackage in project ats-framework by Axway.

the class Test_StringInMimePartRule method isMatchRegexRegularPartUTF8WholeMessagePositive.

@Test
public void isMatchRegexRegularPartUTF8WholeMessagePositive() throws RbvException, PackageException {
    MimePackage utf8Package = new MimePackage(Test_StringInMimePartRule.class.getResourceAsStream("mail_with_one_attachment.msg"));
    utf8Package.addPart("Изчерпателна информация", MimePackage.PART_TYPE_TEXT_PLAIN, "utf-8");
    ImapMetaData utf8MetaData = new ImapMetaData(utf8Package);
    //expected true
    StringInMimePartRule rule = new StringInMimePartRule(".*информация$", true, "isMatchRegexRegularPartPositive1", true);
    assertTrue(rule.isMatch(utf8MetaData));
    //expected false
    rule = new StringInMimePartRule("Изчерпателна.*яа", true, "isMatchRegexRegularPartPositive2", false);
    assertTrue(rule.isMatch(utf8MetaData));
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) StringInMimePartRule(com.axway.ats.rbv.imap.rules.StringInMimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 30 with MimePackage

use of com.axway.ats.action.objects.MimePackage in project ats-framework by Axway.

the class Test_StringInMimePartRule method isMatchRegularPartUTF8WholeMessagePositive.

@Test
public void isMatchRegularPartUTF8WholeMessagePositive() throws RbvException, PackageException {
    MimePackage utf8Package = new MimePackage(Test_StringInMimePartRule.class.getResourceAsStream("mail_with_one_attachment.msg"));
    utf8Package.addPart("Изчерпателна информация", MimePackage.PART_TYPE_TEXT_PLAIN, "utf-8");
    ImapMetaData utf8MetaData = new ImapMetaData(utf8Package);
    //expected true
    StringInMimePartRule rule = new StringInMimePartRule("Изчерпателна", false, "isMatchRegularPartPositive1", true);
    assertTrue(rule.isMatch(utf8MetaData));
    //expected false
    rule = new StringInMimePartRule("Изчерпатслна", false, "isMatchRegularPartPositive2", false);
    assertTrue(rule.isMatch(utf8MetaData));
}
Also used : MimePackage(com.axway.ats.action.objects.MimePackage) ImapMetaData(com.axway.ats.rbv.imap.ImapMetaData) StringInMimePartRule(com.axway.ats.rbv.imap.rules.StringInMimePartRule) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

MimePackage (com.axway.ats.action.objects.MimePackage)53 Test (org.junit.Test)35 BaseTest (com.axway.ats.action.BaseTest)29 ImapMetaData (com.axway.ats.rbv.imap.ImapMetaData)15 Before (org.junit.Before)7 PackageException (com.axway.ats.action.objects.model.PackageException)6 BaseTest (com.axway.ats.rbv.BaseTest)6 FileInputStream (java.io.FileInputStream)6 MimePart (javax.mail.internet.MimePart)6 NoSuchMimePartException (com.axway.ats.action.objects.model.NoSuchMimePartException)5 RbvException (com.axway.ats.rbv.model.RbvException)5 Test_ImapStorage (com.axway.ats.rbv.imap.Test_ImapStorage)4 StringInMimePartRule (com.axway.ats.rbv.imap.rules.StringInMimePartRule)4 MimePartRule (com.axway.ats.rbv.imap.rules.MimePartRule)2 InputStream (java.io.InputStream)2 MessagingException (javax.mail.MessagingException)2 BeforeClass (org.junit.BeforeClass)2 MailSender (com.axway.ats.action.mail.MailSender)1 MailTransportListener (com.axway.ats.action.mail.model.MailTransportListener)1 DELIVERY_STATE (com.axway.ats.action.mail.model.MailTransportListener.DELIVERY_STATE)1