for (final Iterator iter = steps.iterator(); iter.hasNext();) {
final Step step = (Step) iter.next();
executeContainedStep(step);
}
final WebClientContext.StoredResponses srcResponses = context.getResponses();
final Page actualPage = context.getCurrentResponse();
final WebResponse actualResponse = actualPage.getWebResponse();
LOG.debug("Processig reference file: " + getReferenceFile());
WebClientContext.StoredResponses referenceResponses = preProcessFiles(getReferenceFile(), context);
if (isReadFiltered()) {
LOG.debug("Applying filter on reference file too");
context.restoreResponses(referenceResponses);
for (final Iterator iter = steps.iterator(); iter.hasNext();) {
final Step step = (Step) iter.next();
step.execute();
}
referenceResponses = context.getResponses();
context.restoreResponses(srcResponses);
}
LOG.debug("Source: " + actualResponse.getContentType() + " (" + actualResponse.getRequestUrl() + ")");
context.restoreResponses(referenceResponses);
final Page referencePage = context.getCurrentResponse();
final WebResponse referenceResponse = referencePage.getWebResponse();
LOG.debug("Reference: " + referenceResponse.getContentType() + " (" + referenceResponse.getRequestUrl() + ")");
return produceDiffMessage(actualPage, referencePage);
}