Exemplo n.º 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;
 }
Exemplo n.º 2
0
 @Override
 public Collection<MachineException> getFailures() {
   return failures.values();
 }
Exemplo n.º 3
0
 @Override
 public MachineException getFailure(Context context) {
   return failures.get(context);
 }
Exemplo n.º 4
0
 @Override
 public boolean isFailure(Context context) {
   return failures.containsKey(context);
 }