Class CompoundTestRunnerCallback
- java.lang.Object
-
- de.gebit.integrity.runner.callbacks.TestRunnerCallback
-
- de.gebit.integrity.runner.callbacks.CompoundTestRunnerCallback
-
public class CompoundTestRunnerCallback extends TestRunnerCallback
This specialTestRunnerCallback
is intended to be used for combining multiple callbacks. It will simply distribute all calls to all contained callbacks.- Author:
- Rene Schneider - initial API and implementation
-
-
Field Summary
-
Fields inherited from class de.gebit.integrity.runner.callbacks.TestRunnerCallback
dryRun, forkInExecution, server
-
-
Constructor Summary
Constructors Constructor Description CompoundTestRunnerCallback(TestRunnerCallback... someCallbacks)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCallback(TestRunnerCallback aCallback)
Adds another callback.void
injectDependencies(com.google.inject.Injector anInjector)
Injects Guice dependencies into all contained callbacks.void
onAbortExecution(java.lang.String anAbortExecutionMessage, java.lang.String anAbortExecutionStackTrace)
Called when test execution is aborted prematurely due to anAbortExecutionException
- either thrown locally or by a fork.void
onCallbackProcessingEnd()
Called after a call has been performed on all callbacks.void
onCallbackProcessingStart()
Called when a call to all callbacks is imminent.void
onCallFinish(Call aCall, CallResult aResult)
Called right after a call was executed.void
onCallStart(Call aCall)
Called before a call is being executed.void
onConstantDefinition(ConstantEntity aDefinition, SuiteDefinition aSuite, java.lang.Object aValue, boolean aParameterizedFlag)
Called when a constant is being defined.void
onExecutionFinish(TestModel aModel, SuiteSummaryResult aResult)
Called after all execution has been finished.void
onExecutionStart(TestModel aModel, VariantDefinition aVariant)
Called when the execution starts, that is, before the first (root) suite is entered.void
onMessageFromFork(TestRunnerCallbackMethods aMethod, java.io.Serializable... someObjects)
Called when a fork has sent a message to the masters' callback.void
onReturnVariableAssignment(SuiteReturn aReturn, VariableEntity aSource, VariableEntity aTarget, Suite aSuite, java.lang.Object aValue)
Called when a return variable value from a suite is assigned to the respective local variable in the calling suite.void
onSetupFinish(SuiteDefinition aSetupSuite, SuiteResult aResult)
Called when a setup suite has been executed.void
onSetupSkipped(SuiteDefinition aSetupSuite, SuiteSkipReason aReason)
Called when a setup suite is being skipped.void
onSetupStart(SuiteDefinition aSetupSuite)
Called when a setup suite is being called.void
onSuiteFinish(Suite aSuite, SuiteSummaryResult aResult)
Called after a suite has finished execution.void
onSuiteSkipped(Suite aSuite, SuiteSkipReason aReason)
Called when a suite call is being skipped.void
onSuiteStart(Suite aSuite)
Called when a suite call is being followed.void
onTableTestFinish(TableTest aTableTest, TestResult someResults)
Called after a tabletest was fully executed (all rows have been executed).void
onTableTestRowFinish(TableTest aTableTest, TableTestRow aRow, TestSubResult aSubResult)
Called after a table test row has been executed.void
onTableTestRowStart(TableTest aTableTest, TableTestRow aRow)
Called when a single row of a table test is about to be executed.void
onTableTestStart(TableTest aTableTest)
Called when a table test is about to be executed.void
onTearDownFinish(SuiteDefinition aTearDownSuite, SuiteResult aResult)
Called after a teardown suite was executed.void
onTearDownSkipped(SuiteDefinition aTearDownSuite, SuiteSkipReason aReason)
Called when a teardown suite is being skipped.void
onTearDownStart(SuiteDefinition aTearDownSuite)
Called before a teardown suite is being executed.void
onTestFinish(Test aTest, TestResult aResult)
Called after a test was executed.void
onTestStart(Test aTest)
Called right before a test is being executed.void
onTimeSetFinish(TimeSet aTimeSet, TimeSetResult aResult)
Called when the test time was set.void
onTimeSetStart(TimeSet aTimeSet, SuiteDefinition aSuite, java.util.List<ForkDefinition> someForks)
Called when the test time will be set.void
onVariableAssignment(VariableAssignment anAssignment, VariableEntity aDefinition, SuiteDefinition aSuite, java.lang.Object aValue)
Called when a variable is being assigned.void
onVariableDefinition(VariableEntity aDefinition, SuiteDefinition aSuite, java.lang.Object anInitialValue)
Called when a variable is being defined.void
onVisibleComment(java.lang.String aCommentText, boolean anIsTitle, VisibleComment aCommentElement)
Called when a visible comment is encountered during execution.void
onVisibleDivider(java.lang.String aDividerText, VisibleDivider aDividerElement)
Called when a visible divider is encountered during execution.void
receiveFromFork(java.lang.String aCallbackClassName, TestRunnerCallbackMethods aMethod, java.io.Serializable[] someData)
This method is used by the test runner to forward messages received from the forks to the callback.void
removeCallback(TestRunnerCallback aCallback)
Removes a callback from the compound.void
setDryRun(boolean aDryRun)
void
setForkInExecution(ForkDefinition aFork)
void
setRemotingServer(IntegrityRemotingServer aRemotingServer)
-
Methods inherited from class de.gebit.integrity.runner.callbacks.TestRunnerCallback
getForkInExecution, isDryRun, isFork, sendToMaster
-
-
-
-
Constructor Detail
-
CompoundTestRunnerCallback
public CompoundTestRunnerCallback(TestRunnerCallback... someCallbacks)
Creates a new instance.- Parameters:
someCallbacks
- the callbacks to be wrapped
-
-
Method Detail
-
addCallback
public void addCallback(TestRunnerCallback aCallback)
Adds another callback.- Parameters:
aCallback
- the callback to be added
-
removeCallback
public void removeCallback(TestRunnerCallback aCallback)
Removes a callback from the compound. Will cascade down to nestedCompoundTestRunnerCallback
s.- Parameters:
aCallback
- the callback to be removed
-
injectDependencies
public void injectDependencies(com.google.inject.Injector anInjector)
Injects Guice dependencies into all contained callbacks.- Parameters:
anInjector
- the guice injector
-
onCallbackProcessingStart
public void onCallbackProcessingStart()
Description copied from class:TestRunnerCallback
Called when a call to all callbacks is imminent.- Overrides:
onCallbackProcessingStart
in classTestRunnerCallback
-
onCallbackProcessingEnd
public void onCallbackProcessingEnd()
Description copied from class:TestRunnerCallback
Called after a call has been performed on all callbacks.- Overrides:
onCallbackProcessingEnd
in classTestRunnerCallback
-
onExecutionStart
public void onExecutionStart(TestModel aModel, VariantDefinition aVariant)
Description copied from class:TestRunnerCallback
Called when the execution starts, that is, before the first (root) suite is entered. This is always the first call of an execution phase.- Specified by:
onExecutionStart
in classTestRunnerCallback
- Parameters:
aModel
- the test model that will be executed
-
onSuiteStart
public void onSuiteStart(Suite aSuite)
Description copied from class:TestRunnerCallback
Called when a suite call is being followed.- Specified by:
onSuiteStart
in classTestRunnerCallback
- Parameters:
aSuite
- the suite call that will be entered
-
onSuiteSkipped
public void onSuiteSkipped(Suite aSuite, SuiteSkipReason aReason)
Description copied from class:TestRunnerCallback
Called when a suite call is being skipped.- Specified by:
onSuiteSkipped
in classTestRunnerCallback
- Parameters:
aSuite
- the suite being skippedaReason
- the reason for the skipping
-
onSetupStart
public void onSetupStart(SuiteDefinition aSetupSuite)
Description copied from class:TestRunnerCallback
Called when a setup suite is being called.- Specified by:
onSetupStart
in classTestRunnerCallback
- Parameters:
aSetupSuite
- the setup suite being entered
-
onSetupSkipped
public void onSetupSkipped(SuiteDefinition aSetupSuite, SuiteSkipReason aReason)
Description copied from class:TestRunnerCallback
Called when a setup suite is being skipped.- Specified by:
onSetupSkipped
in classTestRunnerCallback
- Parameters:
aSetupSuite
- the suite being skippedaReason
- the reason for the skipping
-
onSetupFinish
public void onSetupFinish(SuiteDefinition aSetupSuite, SuiteResult aResult)
Description copied from class:TestRunnerCallback
Called when a setup suite has been executed.- Specified by:
onSetupFinish
in classTestRunnerCallback
- Parameters:
aSetupSuite
- the setup suite that was executedaResult
- the result of the execution
-
onTestStart
public void onTestStart(Test aTest)
Description copied from class:TestRunnerCallback
Called right before a test is being executed.- Specified by:
onTestStart
in classTestRunnerCallback
- Parameters:
aTest
- the test
-
onTestFinish
public void onTestFinish(Test aTest, TestResult aResult)
Description copied from class:TestRunnerCallback
Called after a test was executed.- Specified by:
onTestFinish
in classTestRunnerCallback
- Parameters:
aTest
- the test that was executedaResult
- the result of the execution
-
onCallStart
public void onCallStart(Call aCall)
Description copied from class:TestRunnerCallback
Called before a call is being executed.- Specified by:
onCallStart
in classTestRunnerCallback
- Parameters:
aCall
- the call
-
onCallFinish
public void onCallFinish(Call aCall, CallResult aResult)
Description copied from class:TestRunnerCallback
Called right after a call was executed.- Specified by:
onCallFinish
in classTestRunnerCallback
- Parameters:
aCall
- the callaResult
- the result of the execution
-
onTearDownStart
public void onTearDownStart(SuiteDefinition aTearDownSuite)
Description copied from class:TestRunnerCallback
Called before a teardown suite is being executed.- Specified by:
onTearDownStart
in classTestRunnerCallback
- Parameters:
aTearDownSuite
- the suite to be executed
-
onTearDownSkipped
public void onTearDownSkipped(SuiteDefinition aTearDownSuite, SuiteSkipReason aReason)
Description copied from class:TestRunnerCallback
Called when a teardown suite is being skipped.- Specified by:
onTearDownSkipped
in classTestRunnerCallback
- Parameters:
aTearDownSuite
- the suite being skippedaReason
- the reason for the skipping
-
onTearDownFinish
public void onTearDownFinish(SuiteDefinition aTearDownSuite, SuiteResult aResult)
Description copied from class:TestRunnerCallback
Called after a teardown suite was executed.- Specified by:
onTearDownFinish
in classTestRunnerCallback
- Parameters:
aTearDownSuite
- the suite that was executedaResult
- the result of the execution
-
onSuiteFinish
public void onSuiteFinish(Suite aSuite, SuiteSummaryResult aResult)
Description copied from class:TestRunnerCallback
Called after a suite has finished execution. This might return aSuiteResult
instance if the suite was executed locally, or aSuiteSummaryResult
with just the summary count information if the suite ran on a fork, in which case the detailed information is not available.- Specified by:
onSuiteFinish
in classTestRunnerCallback
- Parameters:
aSuite
- the suite that was executedaResult
- the result of the execution
-
onExecutionFinish
public void onExecutionFinish(TestModel aModel, SuiteSummaryResult aResult)
Description copied from class:TestRunnerCallback
Called after all execution has been finished. This is always the last call of an execution phase.- Specified by:
onExecutionFinish
in classTestRunnerCallback
-
onVariableDefinition
public void onVariableDefinition(VariableEntity aDefinition, SuiteDefinition aSuite, java.lang.Object anInitialValue)
Description copied from class:TestRunnerCallback
Called when a variable is being defined.- Specified by:
onVariableDefinition
in classTestRunnerCallback
- Parameters:
aDefinition
- the variableaSuite
- the suite in which the variable is scoped (may be null if the variable is global)anInitialValue
- the initial value (may be null if no initial value is given)
-
onConstantDefinition
public void onConstantDefinition(ConstantEntity aDefinition, SuiteDefinition aSuite, java.lang.Object aValue, boolean aParameterizedFlag)
Description copied from class:TestRunnerCallback
Called when a constant is being defined.- Specified by:
onConstantDefinition
in classTestRunnerCallback
- Parameters:
aDefinition
- the constantaSuite
- the suite in which the constant is scoped (may be null if the constant is global)aValue
- the value (may be null if no value was given)aParameterizedFlag
- true if the constant was parameterized (value defined not in script, but from outside the test runner via parameter)
-
onVariableAssignment
public void onVariableAssignment(VariableAssignment anAssignment, VariableEntity aDefinition, SuiteDefinition aSuite, java.lang.Object aValue)
Description copied from class:TestRunnerCallback
Called when a variable is being assigned.- Specified by:
onVariableAssignment
in classTestRunnerCallback
- Parameters:
anAssignment
- the assignmentaDefinition
- the variable that the value is to be assignedaSuite
- the suite in which the variable is scoped (may be null if the variable is global)aValue
- the value
-
onReturnVariableAssignment
public void onReturnVariableAssignment(SuiteReturn aReturn, VariableEntity aSource, VariableEntity aTarget, Suite aSuite, java.lang.Object aValue)
Description copied from class:TestRunnerCallback
Called when a return variable value from a suite is assigned to the respective local variable in the calling suite.- Specified by:
onReturnVariableAssignment
in classTestRunnerCallback
- Parameters:
aReturn
- the return variable objectaSource
- the source variable entityaTarget
- the target variable entityaSuite
- the suite invocation for which the assignment is doneaValue
- the value to be assigned
-
onTimeSetStart
public void onTimeSetStart(TimeSet aTimeSet, SuiteDefinition aSuite, java.util.List<ForkDefinition> someForks)
Description copied from class:TestRunnerCallback
Called when the test time will be set.- Specified by:
onTimeSetStart
in classTestRunnerCallback
- Parameters:
aTimeSet
- the time to be setaSuite
- the suite in which the time was setsomeForks
- the forks on which the time was set (the null element in the list means the master process)
-
onTimeSetFinish
public void onTimeSetFinish(TimeSet aTimeSet, TimeSetResult aResult)
Description copied from class:TestRunnerCallback
Called when the test time was set.- Specified by:
onTimeSetFinish
in classTestRunnerCallback
- Parameters:
aTimeSet
- the time to be setaResult
- the result of the operation
-
onTableTestStart
public void onTableTestStart(TableTest aTableTest)
Description copied from class:TestRunnerCallback
Called when a table test is about to be executed.- Specified by:
onTableTestStart
in classTestRunnerCallback
- Parameters:
aTableTest
- the table test
-
onTableTestFinish
public void onTableTestFinish(TableTest aTableTest, TestResult someResults)
Description copied from class:TestRunnerCallback
Called after a tabletest was fully executed (all rows have been executed).- Specified by:
onTableTestFinish
in classTestRunnerCallback
- Parameters:
aTableTest
- the table testsomeResults
- the result of the test execution
-
onTableTestRowStart
public void onTableTestRowStart(TableTest aTableTest, TableTestRow aRow)
Description copied from class:TestRunnerCallback
Called when a single row of a table test is about to be executed.- Specified by:
onTableTestRowStart
in classTestRunnerCallback
- Parameters:
aTableTest
- the table test that contains the rowaRow
- the row
-
onTableTestRowFinish
public void onTableTestRowFinish(TableTest aTableTest, TableTestRow aRow, TestSubResult aSubResult)
Description copied from class:TestRunnerCallback
Called after a table test row has been executed.- Specified by:
onTableTestRowFinish
in classTestRunnerCallback
- Parameters:
aTableTest
- the table test that contains the rowaRow
- the row that was executedaSubResult
- the result of the execution
-
onMessageFromFork
public void onMessageFromFork(TestRunnerCallbackMethods aMethod, java.io.Serializable... someObjects)
Description copied from class:TestRunnerCallback
Called when a fork has sent a message to the masters' callback. In order to merge results determined by forks seamlessly into the masters' results, callbacks do automatically have a simple messaging system at their disposal. When a fork callback usesTestRunnerCallback.sendToMaster(TestRunnerCallbackMethods, Serializable...)
, this method is called on the masters' respective callback in order to deliver the objects given.- Specified by:
onMessageFromFork
in classTestRunnerCallback
- Parameters:
aMethod
- the method that was called on the forks' callback (doesn't have to be used, evaluating this parameter is the job of the masters' callback and can thus be omitted if it ain't necessary)someObjects
- the objects sent by the forks' callback
-
setRemotingServer
public void setRemotingServer(IntegrityRemotingServer aRemotingServer)
- Overrides:
setRemotingServer
in classTestRunnerCallback
-
setDryRun
public void setDryRun(boolean aDryRun)
- Overrides:
setDryRun
in classTestRunnerCallback
-
receiveFromFork
public void receiveFromFork(java.lang.String aCallbackClassName, TestRunnerCallbackMethods aMethod, java.io.Serializable[] someData)
Description copied from class:TestRunnerCallback
This method is used by the test runner to forward messages received from the forks to the callback.- Overrides:
receiveFromFork
in classTestRunnerCallback
- Parameters:
aCallbackClassName
- the callback class nameaMethod
- the method calledsomeData
- the objects given by the fork
-
onVisibleComment
public void onVisibleComment(java.lang.String aCommentText, boolean anIsTitle, VisibleComment aCommentElement)
Description copied from class:TestRunnerCallback
Called when a visible comment is encountered during execution.- Specified by:
onVisibleComment
in classTestRunnerCallback
- Parameters:
aCommentText
- the text inside the commentaCommentElement
- the raw comment element
-
onVisibleDivider
public void onVisibleDivider(java.lang.String aDividerText, VisibleDivider aDividerElement)
Description copied from class:TestRunnerCallback
Called when a visible divider is encountered during execution.- Specified by:
onVisibleDivider
in classTestRunnerCallback
- Parameters:
aDividerText
- the divider text (basically a String of '-' chars with minimum length of 3 chars)aDividerElement
- the raw divider element
-
onAbortExecution
public void onAbortExecution(java.lang.String anAbortExecutionMessage, java.lang.String anAbortExecutionStackTrace)
Description copied from class:TestRunnerCallback
Called when test execution is aborted prematurely due to anAbortExecutionException
- either thrown locally or by a fork. The original exception can't be provided since it cannot be received from a fork by remoting. Instead, the data from the exception is provided in both cases.- Specified by:
onAbortExecution
in classTestRunnerCallback
- Parameters:
anAbortExecutionMessage
- the message from the exceptionanAbortExecutionStackTrace
- the stack trace of the exception
-
setForkInExecution
public void setForkInExecution(ForkDefinition aFork)
- Overrides:
setForkInExecution
in classTestRunnerCallback
-
-