Package org.verifyica.api
Class Runner
java.lang.Object
org.verifyica.api.Runner
Class to implement Runner
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAsserts no Throwables have been collected.clear()Removes any collected Throwablesstatic Runner.TaskCreates a Task to close a Closeable object if not nullGet the first ThrowablebooleanisEmpty()Check if any Task threw a ThrowablebooleanCheck if any Task threw a Throwableperform(Collection<Runner.Task> tasks) Perform a Collection of Tasks.perform(Runner.Task task) Perform a Task.perform(Runner.Task... tasks) Perform an array of Tasks.Get the List of Throwables
-
Constructor Details
-
Runner
public Runner()Constructor
-
-
Method Details
-
perform
Perform a Task. If a Throwable occurs, collect it- Parameters:
task- task- Returns:
- this
-
perform
Perform an array of Tasks. For each task, if a Throwable occurs, collect it- Parameters:
tasks- tasks- Returns:
- this
-
perform
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
Get the List of Throwables- Returns:
- a List of Throwables
-
firstThrowable
Get the first Throwable- Returns:
- if a Throwable was thrown, an Optional that contains the first Throwable, else Optional.empty()
-
assertSuccessful
Asserts no Throwables have been collected. If any Throwables have been collected, throw the first Throwable- Returns:
- this
- Throws:
Throwable- Throwable
-
clear
Removes any collected Throwables- Returns:
- this
-
closeTask
Creates a Task to close a Closeable object if not null- Parameters:
closeable- closeable- Returns:
- a Task
-