FailImmediatelyRegistry.java

  1. package fr.sii.ogham.testing.assertion.util;

  2. /**
  3.  * The aim of this registry is to fail fast (do not try all assertions if the
  4.  * first one is KO).
  5.  *
  6.  * It doesn't register the functions but immediately execute them.
  7.  *
  8.  * @author AurĂ©lien Baudet
  9.  *
  10.  */
  11. public class FailImmediatelyRegistry implements AssertionRegistry {
  12.     public <E extends Exception> void register(Executable<E> executable) throws E {
  13.         executable.run();
  14.     }

  15.     public void execute() {
  16.         // nothing to do
  17.     }
  18. }