Search in sources :

Example 1 with DbMetaData

use of com.axway.ats.rbv.db.DbMetaData in project ats-framework by Axway.

the class Test_DbStringFieldRule method isMatchExpectedFalseMultipleRulesNegative.

@Test
public void isMatchExpectedFalseMultipleRulesNegative() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", "test");
    metaData.putProperty("test2", "test");
    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 2 with DbMetaData

use of com.axway.ats.rbv.db.DbMetaData in project ats-framework by Axway.

the class Test_DbStringFieldRule method isMatchExpectedFalseMultipleRulesPositiveNoMetaData.

@Test
public void isMatchExpectedFalseMultipleRulesPositiveNoMetaData() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", "test123");
    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 3 with DbMetaData

use of com.axway.ats.rbv.db.DbMetaData in project ats-framework by Axway.

the class Test_DbStringFieldRule method isMatchExpectedTrueMultipleRulesPositive.

@Test
public void isMatchExpectedTrueMultipleRulesPositive() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", "test");
    metaData.putProperty("test2", "test");
    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 4 with DbMetaData

use of com.axway.ats.rbv.db.DbMetaData in project ats-framework by Axway.

the class Test_DbStringFieldRule method isMatchExpectedFalsePositive.

@Test
public void isMatchExpectedFalsePositive() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", "test123");
    assertTrue(ruleTest1ExpectFalse.isMatch(metaData));
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Example 5 with DbMetaData

use of com.axway.ats.rbv.db.DbMetaData in project ats-framework by Axway.

the class Test_DbStringFieldRule method isMatchIncorrectMetaData.

@Test(expected = MetaDataIncorrectException.class)
public void isMatchIncorrectMetaData() throws RbvException {
    DbMetaData metaData = new DbMetaData();
    metaData.putProperty("test1", new Object());
    ruleTest1ExpectFalse.isMatch(metaData);
}
Also used : DbMetaData(com.axway.ats.rbv.db.DbMetaData) BaseTest(com.axway.ats.rbv.BaseTest) Test(org.junit.Test)

Aggregations

DbMetaData (com.axway.ats.rbv.db.DbMetaData)57 BaseTest (com.axway.ats.rbv.BaseTest)50 Test (org.junit.Test)50 AndRuleOperation (com.axway.ats.rbv.rules.AndRuleOperation)20 MetaData (com.axway.ats.rbv.MetaData)16 DbStringFieldRule (com.axway.ats.rbv.db.rules.DbStringFieldRule)15 SnapshotExecutor (com.axway.ats.rbv.executors.SnapshotExecutor)15 MetaDataIncorrectException (com.axway.ats.rbv.model.MetaDataIncorrectException)4 ArrayList (java.util.ArrayList)2 DbMetaDataKey (com.axway.ats.rbv.db.DbMetaDataKey)1 DbDateFieldRule (com.axway.ats.rbv.db.rules.DbDateFieldRule)1 NoSuchMetaDataKeyException (com.axway.ats.rbv.model.NoSuchMetaDataKeyException)1 RbvException (com.axway.ats.rbv.model.RbvException)1 Rule (com.axway.ats.rbv.rules.Rule)1 Calendar (java.util.Calendar)1 Pattern (java.util.regex.Pattern)1 Before (org.junit.Before)1 BeforeClass (org.junit.BeforeClass)1