use of org.whole.lang.tests.model.TestCases in project whole by wholeplatform.
the class TestsInterpreterVisitor method visit.
@Override
public void visit(TestSuite entity) {
Results results = TestsEntityFactory.instance.createResults();
printWriter().printf("=== %s test suite ===\n\n", entity.getName().getValue());
getBindings().wDefValue("filterRulesMap", TestsHelpers.createFilterRulesMap(entity));
TestCases testCases = entity.getTestCases();
for (int i = 0; i < testCases.wSize(); i++) {
TestCase testCase = testCases.get(i);
if (getBindings().wIsSet("runSingleTest") && getBindings().wGet("runSingleTest").wGetParent().wGetParent() != testCase)
continue;
testCase.accept(this);
Results testCaseResults = (Results) getResult();
results.getErrors().setValue(results.getErrors().getValue() + testCaseResults.getErrors().getValue());
results.getFailures().setValue(results.getFailures().getValue() + testCaseResults.getFailures().getValue());
results.getSuccesses().setValue(results.getSuccesses().getValue() + testCaseResults.getSuccesses().getValue());
}
if (EntityUtils.isResolver(entity.getExpectedResults()))
entity.setExpectedResults(EntityUtils.clone(results));
if (!Matcher.match(results, entity.getActualResults()))
entity.setActualResults(results);
setResult(results);
}
Aggregations