use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchRegularPartUTF8Positive.
@Test
public void isMatchRegularPartUTF8Positive() throws RbvException, PackageException {
MimePackage utf8Package = new MimePackage();
utf8Package.addPart("Изчерпателна информация", MimePackage.PART_TYPE_TEXT_PLAIN, "utf-8");
ImapMetaData utf8MetaData = new ImapMetaData(utf8Package);
//expected true
StringInMimePartRule rule = new StringInMimePartRule("Изчерпателна", false, 0, false, "isMatchRegularPartPositive1", true);
assertTrue(rule.isMatch(utf8MetaData));
//expected false
rule = new StringInMimePartRule("Изчерпатслна", false, 0, false, "isMatchRegularPartPositive2", false);
assertTrue(rule.isMatch(utf8MetaData));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchRegexAttachmentNegative.
@Test
public void isMatchRegexAttachmentNegative() throws RbvException {
//expected true
StringInMimePartRule rule = new StringInMimePartRule("asd.?", true, 0, true, "isMatchRegexAttachmentNegative1", true);
assertFalse(rule.isMatch(metaData));
//expected false
rule = new StringInMimePartRule("You .* now", true, 0, true, "isMatchRegexAttachmentNegative2", false);
assertFalse(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchNullMetaData.
@Test(expected = RbvException.class)
public void isMatchNullMetaData() throws RbvException {
StringInMimePartRule rule = new StringInMimePartRule("US AIR FORCE", false, 2, false, "isMatchNullMetaData", false);
assertFalse(rule.isMatch(null));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchRegularPartPositive.
@Test
public void isMatchRegularPartPositive() throws RbvException {
//expected true
StringInMimePartRule rule = new StringInMimePartRule("US AIR FORCE", false, 2, false, "isMatchRegularPartPositive1", true);
assertTrue(rule.isMatch(metaData));
//expected false
rule = new StringInMimePartRule("asdfasdf", false, 2, false, "isMatchRegularPartPositive2", false);
assertTrue(rule.isMatch(metaData));
}
use of com.axway.ats.rbv.imap.rules.StringInMimePartRule in project ats-framework by Axway.
the class Test_StringInMimePartRule method isMatchRegexRegularPartNegative.
@Test
public void isMatchRegexRegularPartNegative() throws RbvException {
//expected true
StringInMimePartRule rule = new StringInMimePartRule("US .? FORCE", true, 2, false, "isMatchRegexRegularPartNegative1", true);
assertFalse(rule.isMatch(metaData));
//expected false
rule = new StringInMimePartRule("US .* FORCE", true, 2, false, "isMatchRegexRegularPartNegative2", false);
assertFalse(rule.isMatch(metaData));
}
Aggregations