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);
}
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);
}
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);
}
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));
}
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));
}
Aggregations