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 fromTestRunnerCallback
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 givenValueOrEnumValueOrOperationCollection
contains at least one nested object (or an equivalent map with key-value pairs).protected boolean
containsNestedObject(java.lang.Object aValue)
Determines whether a givenValueOrEnumValueOrOperation
contains at least one nested object (or an equivalent map with key-value pairs).protected FormattedString
convertResultValueToFormattedStringGuarded(java.lang.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 java.lang.String
convertResultValueToStringGuarded(java.lang.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 java.lang.String
valueToString(java.lang.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
-
-
-
-
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.
-
-
Method Detail
-
convertResultValueToFormattedStringGuarded
protected FormattedString convertResultValueToFormattedStringGuarded(java.lang.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 convertaResult
- the execution result which provides access to the fixture instance and methodaForceIntermediateMapFlag
- 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 java.lang.String convertResultValueToStringGuarded(java.lang.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 convertaResult
- the execution result which provides access to the fixture instance and methodaForceIntermediateMapFlag
- 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 givenValueOrEnumValueOrOperationCollection
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(java.lang.Object aValue)
Determines whether a givenValueOrEnumValueOrOperation
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 java.lang.String valueToString(java.lang.Object aValue)
Convert a value to a string intended to be included in the textual output. This most importantly convertsUnresolvableVariable
instances to a "null" string.- Parameters:
aValue
- the value to stringify- Returns:
- the string
-
-