use of com.axway.ats.log.report.exceptions.ReportExtractorException in project ats-framework by Axway.
the class ReportExtactor method extractRunEntities.
/**
* extract the runs
*
* @param runIds
* @return
*/
private List<RunWrapper> extractRunEntities(int[] runIds) {
StringBuilder whereClause = new StringBuilder();
whereClause.append(" WHERE runId IN (");
for (int runId : runIds) {
whereClause.append(runId).append(", ");
}
whereClause.setLength(whereClause.lastIndexOf(","));
whereClause.append(")");
List<Run> dbRuns;
try {
dbRuns = dbReadAccess.getRuns(0, 10000, whereClause.toString(), "runId", true);
} catch (DatabaseAccessException e) {
throw new ReportExtractorException("Error loading runs " + whereClause, e);
}
List<RunWrapper> runs = new ArrayList<RunWrapper>();
for (Run dbRun : dbRuns) {
// load this run's suites
List<Suite> suites;
try {
suites = dbReadAccess.getSuites(0, 10000, "WHERE runId=" + dbRun.runId, "suiteId", true, false);
} catch (DatabaseAccessException e) {
throw new ReportExtractorException("Error loading suites for run with id " + dbRun.runId, e);
}
RunWrapper run = new RunWrapper(dbRun, suites);
runs.add(run);
}
return runs;
}
Aggregations