Пример #1
0
 @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;
 }
Пример #2
0
 @Override
 public Collection<MachineException> getFailures() {
   return failures.values();
 }
Пример #3
0
 @Override
 public MachineException getFailure(Context context) {
   return failures.get(context);
 }
Пример #4
0
 @Override
 public boolean isFailure(Context context) {
   return failures.containsKey(context);
 }