Package org.dbunit

Class MultiDataSourceAssertionError

All Implemented Interfaces:
Serializable

public class MultiDataSourceAssertionError extends AssertionError
Aggregates the PrepAndExpectedTestCase.postTest(boolean) failures a MultiDataSourcePrepAndExpectedTestCase collects across every involved data source, instead of stopping at the first one.

Extends AssertionError - not a checked exception, and not org.opentest4j.MultipleFailuresError - so a caller that already assertThrows(AssertionError.class, ...) around a single data source's DbComparisonFailure keeps working whether one data source fails or several, and this class stays usable from a non-JUnit PrepAndExpectedTestCase delegate.

The first failure - in the wired data sources' declared order, not necessarily the reverse order they were torn down in - becomes this instance's cause, so it still surfaces one Caused by: hop below this instance, exactly as thrown by its delegate. Every other failure is added as suppressed, labelled with its data source name and lifecycle phase so it reads without unwrapping.

Since:
3.6.0
Author:
Jeff Jensen
See Also: