use of com.axway.ats.rbv.db.rules.DbStringFieldRule in project ats-framework by Axway.
the class Test_SimpleMonitorListener method verifyNoMatch_ButHasAMatch.
@Test
public void verifyNoMatch_ButHasAMatch() throws RbvException {
DbFieldsRule dbRule = new DbStringFieldRule("", "key1", "value00", MatchRelation.EQUALS, "verifyNoMatch_ButHasAMatch", true);
Monitor monitor = new Monitor("monitor1", matchable, dbRule, pollingParams, false, true, false);
List<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor);
SimpleMonitorListener listener = new SimpleMonitorListener(monitors);
long before = System.currentTimeMillis();
assertFalse(listener.evaluateMonitors(TIME_END_POLL));
long after = System.currentTimeMillis();
assertTrue(after - before >= TIME_BEFORE_END_POLL);
}
use of com.axway.ats.rbv.db.rules.DbStringFieldRule in project ats-framework by Axway.
the class Test_SimpleMonitorListener method evaluateMonitorsOneMonitorPositiveRunTwice.
@Test
public void evaluateMonitorsOneMonitorPositiveRunTwice() throws RbvException {
DbFieldsRule dbRule = new DbStringFieldRule("", "key1", "value10", MatchRelation.EQUALS, "evaluateMonitorsOneMonitorPositiveRunTwice", true);
Monitor monitor = new Monitor("monitor1", matchable, dbRule, pollingParams, true, false, false);
List<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor);
SimpleMonitorListener listener = new SimpleMonitorListener(monitors);
assertTrue(listener.evaluateMonitors(TIME_END_POLL));
assertTrue(listener.evaluateMonitors(TIME_END_POLL));
}
use of com.axway.ats.rbv.db.rules.DbStringFieldRule in project ats-framework by Axway.
the class DbVerification method checkFieldValueDoesNotContain.
/**
* Add rule to check that the value of the given field does not contain the given string
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param value the string that should be contained in the field
*/
@PublicAtsApi
public void checkFieldValueDoesNotContain(String tableName, String fieldName, String value) {
DbStringFieldRule matchingRule = new DbStringFieldRule(tableName, fieldName, value, DbStringFieldRule.MatchRelation.CONTAINS, "checkFieldValueDoesNotContain", false);
matchingRule.setDbEncryptor(dbEncryptor);
checkFieldValue(matchingRule);
}
use of com.axway.ats.rbv.db.rules.DbStringFieldRule in project ats-framework by Axway.
the class DbSnapshot method checkFieldValueHasChanged.
/**
* Check that the value of the given field is the same as the given one
*
* @param tableName the name of the table which the field is part of
* @param fieldName the field to check
* @param value the value expected
*/
@PublicAtsApi
public void checkFieldValueHasChanged(String keyTableName, String keyFieldName, String keyValue, String tableName, String fieldName, String value) throws RbvException {
DbStringFieldRule keyRule = new DbStringFieldRule(keyTableName, keyFieldName, keyValue, DbStringFieldRule.MatchRelation.EQUALS, "checkKeyValueEquals", true);
DbStringFieldRule matchingRule = new DbStringFieldRule(tableName, fieldName, value, DbStringFieldRule.MatchRelation.EQUALS, "checkFieldValueEquals", true);
matchingRule.setDbEncryptor(dbEncryptor);
checkFieldValueChanged(keyRule, matchingRule);
}
use of com.axway.ats.rbv.db.rules.DbStringFieldRule in project ats-framework by Axway.
the class Test_DbStringFieldRule method isMatchNullExpectedValueNegative.
@Test
public void isMatchNullExpectedValueNegative() throws RbvException {
testMetaData.putProperty("test", "asdfas");
DbStringFieldRule rule = new DbStringFieldRule("test", null, MatchRelation.CONTAINS, "isMatchNullActualValue", true);
assertFalse(rule.isMatch(testMetaData));
}
Aggregations