public class FailAtEndRegistry extends Object implements AssertionRegistry
execute()
method is called, then all functions are executed.
All failures/failed assertions are collected and reported using a
MultipleAssertionError
.
A ComparisonFailure
exception is thrown. Therefore Eclipse can handle
this exception and provide a comparison view with all differences.
Constructor and Description |
---|
FailAtEndRegistry()
Initializes an empty registry.
|
FailAtEndRegistry(boolean convertToComparisonFailure)
Initializes an empty registry.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Execute all registered functions
|
<E extends Exception> |
register(Executable<E> executable)
Register a function that contains assertions.
|
public FailAtEndRegistry()
"ogham.testing.assertions.fail-at-end.throw-comparison-failure"
is set to true (or not set at all), a ComparisonFailure
exception
is thrown. Using a ComparisonFailure
lets Eclipse handle it
specifically and provides a comparison view (Eclipse doesn't handle
sub-classes of ComparisonFailure
).
To throw MultipleAssertionError
instead of
ComparisonFailure
, you can set the
"ogham.testing.assertions.fail-at-end.throw-comparison-failure"
system property to "false"
. This can be useful if you need to
manually handle every failure/failed assertions.public FailAtEndRegistry(boolean convertToComparisonFailure)
convertToComparisonFailure
parameter is set to true, a
ComparisonFailure
exception is thrown. Using a
ComparisonFailure
lets Eclipse handle it specifically and
provides a comparison view (Eclipse doesn't handle sub-classes of
ComparisonFailure
).convertToComparisonFailure
- true to generate a ComparisonFailure
to let Eclipse
display a comparison view.public <E extends Exception> void register(Executable<E> executable) throws E extends Exception
AssertionRegistry
IOException
).register
in interface AssertionRegistry
E
- the type of the thrown exception if anyexecutable
- the function to registerE
- the thrown exceptionE extends Exception
public void execute()
AssertionRegistry
execute
in interface AssertionRegistry
Copyright © 2021. All rights reserved.