Search in sources :

Example 11 with AndRuleOperation

use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.

the class Test_DbNumericFieldRule method isMatchExpectedFalseMultipleRulesPositiveDontMatch.

@Test
public void isMatchExpectedFalseMultipleRulesPositiveDontMatch() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("table.column", 2);
    metaData.putProperty("table.column2", 18);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(ruleTest1ExpectFalse);
    andRule.addRule(ruleTest2ExpectFalse);
    assertFalse(andRule.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 12 with AndRuleOperation

use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.

the class Test_DbNumericFieldRule method isMatchExpectedFalseMultipleRulesPositiveNoMetaData.

@Test(expected = NoSuchMetaDataKeyException.class)
public void isMatchExpectedFalseMultipleRulesPositiveNoMetaData() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("table.column", 3);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(ruleTest1ExpectFalse);
    andRule.addRule(ruleTest2ExpectFalse);
    assertTrue(andRule.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 13 with AndRuleOperation

use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.

the class Test_DbNumericFieldRule method isMatchExpectedTrueMultipleRulesNegativeDontMatch.

@Test
public void isMatchExpectedTrueMultipleRulesNegativeDontMatch() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("table.column", 2);
    metaData.putProperty("table.column2", 6);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(ruleTest1ExpectTrue);
    andRule.addRule(ruleTest2ExpectTrue);
    assertFalse(andRule.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 14 with AndRuleOperation

use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.

the class Test_DbNumericFieldRule method isMatchExpectedTrueMultipleRulesPositive.

@Test
public void isMatchExpectedTrueMultipleRulesPositive() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("table.column", 2);
    metaData.putProperty("table.column2", 5);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(ruleTest1ExpectTrue);
    andRule.addRule(ruleTest2ExpectTrue);
    assertTrue(andRule.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 15 with AndRuleOperation

use of com.axway.ats.rbv.rules.AndRuleOperation in project ats-framework by Axway.

the class Test_DbNumericFieldRule method isMatchExpectedTrueMultipleRulesNegativeNoMetaData.

@Test(expected = NoSuchMetaDataKeyException.class)
public void isMatchExpectedTrueMultipleRulesNegativeNoMetaData() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", 3);
    AndRuleOperation andRule = new AndRuleOperation();
    andRule.addRule(ruleTest1ExpectTrue);
    andRule.addRule(ruleTest2ExpectTrue);
    assertFalse(andRule.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) AndRuleOperation(com.axway.ats.rbv.rules.AndRuleOperation) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

BaseTest (com.axway.ats.rbv.BaseTest)25 AndRuleOperation (com.axway.ats.rbv.rules.AndRuleOperation)25 Test (org.junit.Test)25 DbMetaData (com.axway.ats.rbv.db.DbMetaData)20 HeaderRule (com.axway.ats.rbv.imap.rules.HeaderRule)4 MetaData (com.axway.ats.rbv.MetaData)2 DbStringFieldRule (com.axway.ats.rbv.db.rules.DbStringFieldRule)2 SnapshotExecutor (com.axway.ats.rbv.executors.SnapshotExecutor)2 FilePackage (com.axway.ats.action.objects.FilePackage)1 FileSystemMetaData (com.axway.ats.rbv.filesystem.FileSystemMetaData)1 FileFolderRule (com.axway.ats.rbv.filesystem.rules.FileFolderRule)1 FilePathRule (com.axway.ats.rbv.filesystem.rules.FilePathRule)1