doc / ch.tutteli.atrium.reporting / ReporterBuilder

ReporterBuilder

class ReporterBuilder

A builder to create an IReporter consisting of an ITranslator which is used by an IObjectFormatter which then is used by an IAssertionFormatter which in turn is used by the created IReporter.

Types

AssertionFormatterBuilder

class AssertionFormatterBuilder

Provides options to create an IAssertionFormatter.

ObjectFormatterBuilder

class ObjectFormatterBuilder

Provides options to create an IObjectFormatter.

Constructors

<init>

ReporterBuilder(assertionFormatter: IAssertionFormatter)

A builder to create an IReporter consisting of an ITranslator which is used by an IObjectFormatter which then is used by an IAssertionFormatter which in turn is used by the created IReporter.

Functions

buildCustomReporter

fun buildCustomReporter(factory: (IAssertionFormatter) -> IReporter): IReporter

Uses the given factory to build a custom IReporter.

buildOnlyFailureReporter

fun buildOnlyFailureReporter(): IReporter

Uses AtriumFactory.newOnlyFailureReporter as IReporter.

Companion Object Functions

withDetailedObjectFormatter

fun withDetailedObjectFormatter(): AssertionFormatterBuilder

Shortcut for withoutTranslations.withDetailedObjectFormatter -- uses UsingDefaultTranslator as ITranslator and AtriumFactory.newDetailedObjectFormatter as IObjectFormatter.

withTranslations

fun withTranslations(translationSupplier: ITranslationSupplier, locale: Locale, vararg fallbackLocales: Locale): ObjectFormatterBuilder

Uses AtriumFactory.newTranslator with the given translationSupplier as ITranslator, uses locale as primary Locale and the optional fallbackLocales as fallback Locales.

withTranslator

fun withTranslator(translator: ITranslator): ObjectFormatterBuilder

Uses the given translator as ITranslator.

withoutTranslations

fun withoutTranslations(primaryLocale: Locale = Locale.getDefault()): ObjectFormatterBuilder

Uses UsingDefaultTranslator as ITranslator (which does not translate but uses the ITranslatable's getDefault) and the given primaryLocale which falls back to Locale.getDefault if not given.