Class Runner

java.lang.Object
org.verifyica.api.Runner

public class Runner extends Object
Class to implement Runner
  • Constructor Details

    • Runner

      public Runner()
      Constructor
  • Method Details

    • perform

      public Runner perform(Runner.Task task)
      Perform a Task. If a Throwable occurs, collect it
      Parameters:
      task - task
      Returns:
      this
    • perform

      public Runner perform(Runner.Task... tasks)
      Perform an array of Tasks. For each task, if a Throwable occurs, collect it
      Parameters:
      tasks - tasks
      Returns:
      this
    • perform

      public Runner perform(Collection<Runner.Task> tasks)
      Perform a Collection of Tasks. For each task, if a Throwable occurs, collect it
      Parameters:
      tasks - tasks
      Returns:
      this
    • isEmpty

      public boolean isEmpty()
      Check if any Task threw a Throwable
      Returns:
      true if no Throwables have been collected, else false
    • isNotEmpty

      public boolean isNotEmpty()
      Check if any Task threw a Throwable
      Returns:
      true if no Throwables have been collected, else false
    • throwables

      public List<Throwable> throwables()
      Get the List of Throwables
      Returns:
      a List of Throwables
    • firstThrowable

      public Optional<Throwable> firstThrowable()
      Get the first Throwable
      Returns:
      if a Throwable was thrown, an Optional that contains the first Throwable, else Optional.empty()
    • assertSuccessful

      public Runner assertSuccessful() throws Throwable
      Asserts no Throwables have been collected. If any Throwables have been collected, throw the first Throwable
      Returns:
      this
      Throws:
      Throwable - Throwable
    • clear

      public Runner clear()
      Removes any collected Throwables
      Returns:
      this
    • closeTask

      public static Runner.Task closeTask(Closeable closeable)
      Creates a Task to close a Closeable object if not null
      Parameters:
      closeable - closeable
      Returns:
      a Task