@Override public Result execute(boolean ignoreErrors) { result = new Result(machine.getContexts().size()); executeAnnotation(BeforeExecution.class, machine); try { Context context = null; while (machine.hasNextStep()) { if (null != context) { executeAnnotation(BeforeElement.class, context); } context = machine.getNextStep(); executeAnnotation(AfterElement.class, context); } } catch (MachineException e) { failures.put(e.getContext(), e); } executeAnnotation(AfterExecution.class, machine); updateResult(result, machine); if (!ignoreErrors && !failures.isEmpty()) { throw new TestExecutionException("Test execution contains failures"); } return result; }
@Override public Collection<MachineException> getFailures() { return failures.values(); }
@Override public MachineException getFailure(Context context) { return failures.get(context); }
@Override public boolean isFailure(Context context) { return failures.containsKey(context); }