use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchBothRulesExpectedTrueNegative.
@Test
public void isMatchBothRulesExpectedTrueNegative() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrueNegative", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTrueNegative", true);
firstRule.equals(secondRule);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertFalse(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchOneOfThRulesExpectedFalseNegative.
@Test
public void isMatchOneOfThRulesExpectedFalseNegative() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalseNegative", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalseNegative", false);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertFalse(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchBothRulesExpectedTruePositive.
@Test
public void isMatchBothRulesExpectedTruePositive() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTruePositive", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchBothRulesExpectedTruePositive", true);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertTrue(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.
the class Test_AndRuleOperation method isMatchOneOfThRulesExpectedFalsePositive.
@Test
public void isMatchOneOfThRulesExpectedFalsePositive() throws RbvException {
HeaderRule firstRule = new HeaderRule("Sender", "gmail.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalsePositive", true);
HeaderRule secondRule = new HeaderRule("Sender", "gmail123.com", HeaderMatchMode.FIND, "isMatchOneOfThRulesExpectedFalsePositive", false);
AndRuleOperation andRule = new AndRuleOperation();
andRule.addRule(firstRule);
andRule.addRule(secondRule);
assertTrue(andRule.isMatch(metaData));
}
use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.
the class Test_SnapshotExecutor method matchAfterMultipleUpdatePositive.
/**
* UnitTest
* @throws RbvException
*/
@Test
public void matchAfterMultipleUpdatePositive() throws RbvException {
MetaData meta = new DbMetaData();
meta.putProperty(META_KEY_1, MOD_META_VALUE_1 + 2);
meta.putProperty(META_KEY_2, MOD_META_VALUE_2 + 2);
meta.putProperty(META_KEY_3, META_VALUE_3 + 2);
meta.putProperty(META_KEY_4, META_VALUE_4 + 2);
this.newData.add(meta);
DbStringFieldRule keyRule = new DbStringFieldRule(TABLE_NAME, COLUMN_NAME_2, MOD_META_VALUE_2 + 2, DbStringFieldRule.MatchRelation.EQUALS, "key_rule_1", true);
DbStringFieldRule matchingRule1 = new DbStringFieldRule(TABLE_NAME, COLUMN_NAME_1, MOD_META_VALUE_1 + 2, DbStringFieldRule.MatchRelation.EQUALS, "match_metakey_1", true);
DbStringFieldRule matchingRule2 = new DbStringFieldRule(TABLE_NAME, COLUMN_NAME_2, MOD_META_VALUE_2 + 2, DbStringFieldRule.MatchRelation.EQUALS, "match_metakey_2", true);
AndRuleOperation rule = new AndRuleOperation();
rule.addRule(matchingRule1);
rule.addRule(matchingRule2);
SnapshotExecutor executor = new SnapshotExecutor(this.snapshot);
executor.addRule(keyRule, rule);
List<MetaData> result = executor.evaluate(this.newData);
assertTrue(result != null && !result.isEmpty());
}
Aggregations