use of com.axway.ats.rbv.SimpleMonitorListener in project ats-framework by Axway.
the class VerificationSkeleton method verify.
/**
* Verify that all rules match using the given expected result
*
* @param expectedResult the expected result
* @param endOnFirstMatch end on first match or keep testing until all polling attempts are exhausted
* @param endOnFirstFailure end or first failure or keep testing until all polling attempts are exhausted
*
* @return the matched meta data
* @throws RbvException on error doing the verifications
*/
protected List<MetaData> verify(boolean expectedResult, boolean endOnFirstMatch, boolean endOnFirstFailure) throws RbvException {
try {
this.executor.setRootRule(this.rootRule);
applyConfigurationSettings();
Monitor monitor = new Monitor(getMonitorName(), this.folder, this.executor, new PollingParameters(pollingInitialDelay, pollingInterval, pollingAttempts), expectedResult, endOnFirstMatch, endOnFirstFailure);
ArrayList<Monitor> monitors = new ArrayList<Monitor>();
monitors.add(monitor);
// run the actual evaluation
String evaluationProblem = new SimpleMonitorListener(monitors).evaluateMonitors(pollingTimeout);
if (!StringUtils.isNullOrEmpty(evaluationProblem)) {
throw new RbvVerificationException("Verification failed - " + monitor.getLastError());
}
return monitor.getAllMatchedMetaData();
} catch (ConfigurationException ce) {
throw new RbvException("RBV configuration error", ce);
}
}
Aggregations