use of com.axway.ats.rbv.db.DbSearchTerm in project ats-framework by Axway.
the class Test_DbVerification method checkFieldValueEqualsEncryptedStringPositive.
@Test
public void checkFieldValueEqualsEncryptedStringPositive() throws RbvException {
DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
// the mock encryptor changes all letters to capital case
fsVerification.setDbEncryptor(new MockDbEncryptor());
fsVerification.checkFieldValueEquals("", "key1", "VALUE00");
fsVerification.verifyDbDataExists();
}
use of com.axway.ats.rbv.db.DbSearchTerm in project ats-framework by Axway.
the class Test_DbVerification method checkFieldValueDoesNotContainNegative.
@Test
public void checkFieldValueDoesNotContainNegative() throws RbvException {
DbVerification fsVerification = new DbVerification(new DbSearchTerm(""), provider);
fsVerification.checkFieldValueDoesNotContain("", "key1", "val1");
fsVerification.verifyDbDataExists();
}
use of com.axway.ats.rbv.db.DbSearchTerm in project ats-framework by Axway.
the class Test_SimpleMonitorListener method evaluateMonitorsMultipleMonitorsEndOnFirstMatchPositive.
@Test
public void evaluateMonitorsMultipleMonitorsEndOnFirstMatchPositive() throws RbvException {
DbStorage storage = new DbStorage(new MockDbProvider());
Matchable matchable1 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable2 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable3 = storage.getFolder(new DbSearchTerm(""));
DbFieldsRule dbRule = new DbStringFieldRule("", "key1", "value10", MatchRelation.EQUALS, "evaluateMonitorsMultipleMonitorsEndOnFirstMatchPositive", true);
Monitor monitor1 = new Monitor("monitor1", matchable1, dbRule, pollingParams, true, true, false);
Monitor monitor2 = new Monitor("monitor2", matchable2, dbRule, pollingParams, true, true, false);
Monitor monitor3 = new Monitor("monitor3", matchable3, dbRule, pollingParams, true, true, false);
List<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor1);
monitors.add(monitor2);
monitors.add(monitor3);
SimpleMonitorListener listener = new SimpleMonitorListener(monitors);
assertTrue(listener.evaluateMonitors(TIME_END_POLL));
}
use of com.axway.ats.rbv.db.DbSearchTerm in project ats-framework by Axway.
the class Test_SimpleMonitorListener method evaluateMonitorsMultipleMonitorsEndOnFirstMatchExpectedFalsePositive.
@Test
public void evaluateMonitorsMultipleMonitorsEndOnFirstMatchExpectedFalsePositive() throws RbvException {
PollingParameters longPollingParams = new PollingParameters(0, 5000, 10);
DbStorage storage = new DbStorage(new MockDbProvider());
Matchable matchable1 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable2 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable3 = storage.getFolder(new DbSearchTerm(""));
DbFieldsRule dbRule = new DbStringFieldRule("", "key1", "value2345", MatchRelation.EQUALS, "evaluateMonitorsMultipleMonitorsEndOnFirstMatchPositive", true);
Monitor monitor1 = new Monitor("monitor1", matchable1, dbRule, longPollingParams, false, true, false);
Monitor monitor2 = new Monitor("monitor2", matchable2, dbRule, longPollingParams, false, true, false);
Monitor monitor3 = new Monitor("monitor3", matchable3, dbRule, longPollingParams, false, true, false);
List<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor1);
monitors.add(monitor2);
monitors.add(monitor3);
long timeBefore = Calendar.getInstance().getTimeInMillis();
SimpleMonitorListener listener = new SimpleMonitorListener(monitors);
listener.evaluateMonitors(TIME_END_POLL);
long timeAfter = Calendar.getInstance().getTimeInMillis();
//make sure less than (3 * poling interval) seconds have passed
//this means that only one iteration was made
assertTrue(timeAfter - timeBefore < 3 * POLLING_INTERVAL - 500);
}
use of com.axway.ats.rbv.db.DbSearchTerm in project ats-framework by Axway.
the class Test_SimpleMonitorListener method evaluateMonitorsMultipleMonitorsStressPositive.
@Test
public void evaluateMonitorsMultipleMonitorsStressPositive() throws RbvException {
DbStorage storage = new DbStorage(new MockDbProvider());
Matchable matchable1 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable2 = storage.getFolder(new DbSearchTerm(""));
Matchable matchable3 = storage.getFolder(new DbSearchTerm(""));
DbFieldsRule dbRule = new DbStringFieldRule("", "key1", "value10", MatchRelation.EQUALS, "evaluateMonitorsMultipleMonitorsStressPositive", true);
Monitor monitor1 = new Monitor("monitor1", matchable1, dbRule, pollingParams, true, false, false);
Monitor monitor2 = new Monitor("monitor2", matchable2, dbRule, pollingParams, true, false, false);
Monitor monitor3 = new Monitor("monitor3", matchable3, dbRule, pollingParams, true, false, false);
List<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor1);
monitors.add(monitor2);
monitors.add(monitor3);
SimpleMonitorListener listener = new SimpleMonitorListener(monitors);
for (int i = 0; i < 5; i++) {
assertTrue(listener.evaluateMonitors(TIME_END_POLL));
}
}
Aggregations