Package de.gebit.integrity.runner.callbacks

## Class AbstractTestRunnerCallback

- java.lang.Object
- - de.gebit.integrity.runner.callbacks.TestRunnerCallback
  - - de.gebit.integrity.runner.callbacks.AbstractTestRunnerCallback

- Direct Known Subclasses:
    `ConsoleTestCallback`, `SetListCallback`, `XmlWriterTestCallback`

      public abstract class AbstractTestRunnerCallback
      extends TestRunnerCallback

  Abstract base class for test runner callback implementation. Provides some generic functionality required by most callbacks. Using this class is optional; a callback can directly inherit from `TestRunnerCallback` as well.
  Author:
    Rene Schneider - initial API and implementation

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected ParameterResolver` | `parameterResolver` | The parameter resolver to use.
    `protected ValueConverter` | `valueConverter` | The value converter to use.
    `protected VariableManager` | `variableManager` | The variable manager to use.

    - ### Fields inherited from class de.gebit.integrity.runner.callbacks.TestRunnerCallback

      `dryRun, forkInExecution, server`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractTestRunnerCallback()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `containsNestedObject​(ValueOrEnumValueOrOperationCollection aCollection)` | Determines whether a given `ValueOrEnumValueOrOperationCollection` contains at least one nested object (or an equivalent map with key-value pairs).
    `protected boolean` | `containsNestedObject​(Object aValue)` | Determines whether a given `ValueOrEnumValueOrOperation` contains at least one nested object (or an equivalent map with key-value pairs).
    `protected FormattedString` | `convertResultValueToFormattedStringGuarded​(Object aResultValue, FixtureExecutionResult aResult, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)` | Converts a result value (that is, a value returned by a fixture during a test or call) to a formatted string.
    `protected String` | `convertResultValueToStringGuarded​(Object aResultValue, FixtureExecutionResult aResult, boolean aForceIntermediateMapFlag, ConversionContext aConversionContext)` | Converts a result value (that is, a value returned by a fixture during a test or call) to a string.
    `protected String` | `valueToString​(Object aValue)` | Convert a value to a string intended to be included in the textual output.

    - ### Methods inherited from class de.gebit.integrity.runner.callbacks.TestRunnerCallback

      `getForkInExecution, isDryRun, isFork, onAbortExecution, onCallbackProcessingEnd, onCallbackProcessingStart, onCallFinish, onCallStart, onConstantDefinition, onExecutionFinish, onExecutionStart, onMessageFromFork, onReturnVariableAssignment, onSetupFinish, onSetupSkipped, onSetupStart, onSuiteFinish, onSuiteSkipped, onSuiteStart, onTableTestFinish, onTableTestRowFinish, onTableTestRowStart, onTableTestStart, onTearDownFinish, onTearDownSkipped, onTearDownStart, onTestFinish, onTestStart, onTimeSetFinish, onTimeSetStart, onVariableAssignment, onVariableDefinition, onVisibleComment, onVisibleDivider, receiveFromFork, sendToMaster, setDryRun, setForkInExecution, setRemotingServer`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### valueConverter

          @Inject
          protected ValueConverter valueConverter

      The value converter to use.

    - #### parameterResolver

          @Inject
          protected ParameterResolver parameterResolver

      The parameter resolver to use.

    - #### variableManager

          @Inject
          protected VariableManager variableManager

      The variable manager to use.

  - ### Constructor Detail

    - #### AbstractTestRunnerCallback

          public AbstractTestRunnerCallback()

  - ### Method Detail

    - #### convertResultValueToFormattedStringGuarded

          protected FormattedString convertResultValueToFormattedStringGuarded​(Object aResultValue,
                                                                               FixtureExecutionResult aResult,
                                                                               boolean aForceIntermediateMapFlag,
                                                                               ConversionContext aConversionContext)

      Converts a result value (that is, a value returned by a fixture during a test or call) to a formatted string. This method uses the fixture instance, if available, to perform the conversion.
      Parameters:
        `aResultValue` - the result value to convert
        `aResult` - the execution result which provides access to the fixture instance and method
        `aForceIntermediateMapFlag` - whether the conversion should force the usage of an intermediate map (useful for bean types)
        `aConversionContext` - the conversion context to use (null = default)
      Returns:
        the converted string

    - #### convertResultValueToStringGuarded

          protected String convertResultValueToStringGuarded​(Object aResultValue,
                                                             FixtureExecutionResult aResult,
                                                             boolean aForceIntermediateMapFlag,
                                                             ConversionContext aConversionContext)

      Converts a result value (that is, a value returned by a fixture during a test or call) to a string. This method uses the fixture instance, if available, to perform the conversion.
      Parameters:
        `aResultValue` - the result value to convert
        `aResult` - the execution result which provides access to the fixture instance and method
        `aForceIntermediateMapFlag` - whether the conversion should force the usage of an intermediate map (useful for bean types)
        `aConversionContext` - the conversion context to use
      Returns:
        the converted string

    - #### containsNestedObject

          protected boolean containsNestedObject​(ValueOrEnumValueOrOperationCollection aCollection)

      Determines whether a given `ValueOrEnumValueOrOperationCollection` contains at least one nested object (or an equivalent map with key-value pairs).
      Parameters:
        `aCollection` - the collection to check
      Returns:
        true or false

    - #### containsNestedObject

          protected boolean containsNestedObject​(Object aValue)

      Determines whether a given `ValueOrEnumValueOrOperation` contains at least one nested object (or an equivalent map with key-value pairs).
      Parameters:
        `aValue` - the value to check
      Returns:
        true or false

    - #### valueToString

          protected String valueToString​(Object aValue)

      Convert a value to a string intended to be included in the textual output. This most importantly converts `UnresolvableVariable` instances to a "null" string.
      Parameters:
        `aValue` - the value to stringify
      Returns:
        the string