Package de.gebit.integrity.runner
Class DefaultTestRunner
- java.lang.Object
- 
- de.gebit.integrity.runner.DefaultTestRunner
 
- 
- All Implemented Interfaces:
- TestRunner
 
 public class DefaultTestRunner extends Object implements TestRunner The test runner executes tests. This class is the core of the Integrity runtime system.- Author:
- Rene Schneider - initial API and implementation
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected static classDefaultTestRunner.PhaseTest execution is splitted in phases.protected classDefaultTestRunner.RemotingListenerThe listener used to respond on actions triggered by remoting clients.
 - 
Field SummaryFields Modifier and Type Field Description protected ExceptionWrapperabortExecutionCauseIn case of anAbortExecutionExceptionaborting the test execution, this exception is stored here (actually, only the message and stack trace string are stored - this is because the data could just as well come from a fork, in which case an exception can not be transported over the remoting connection).protected Set<Integer>breakpointsAll enabled breakpoints.protected TestRunnerCallbackcallbackThe callback provided by the creator of theTestRunner.protected static intCHILD_PROCESS_KILL_TIMEOUT_DEFAULTThe default time to wait for child processes to be killed.protected static StringCHILD_PROCESS_KILL_TIMEOUT_PROPERTYThe system property that allows to override the single connect timeout used when connecting to forks.protected IntegrityClassLoaderclassLoaderThe classloader.protected String[]commandLineArgumentsThe original command line arguments, as given to the test runner by the test runner creator.protected Queue<org.eclipse.xtext.util.Pair<String,Runnable>>constantAndVariableDefinitionDelayedCallbackInvocationsThis list is used to collect invocations to callbacks during a parallel constant/variable definition phase.protected com.google.inject.Provider<ConversionContext>conversionContextProviderThe conversion context provider.protected TestRunnerCallbackcurrentCallbackThe currently used callback, that is, the callback that gets directly called during execution.protected DefaultTestRunner.PhasecurrentPhaseThe current execution phase.protected Set<ForkDefinition>diedForksCollects all forks that have died.protected SemaphoreexecutionWaiterA semaphore used for single-stepping tests.protected static intFORK_CONNECT_DELAYThe delay until connection attempts are made to a newly started fork.protected static intFORK_CONNECTION_TIMEOUT_DEFAULTThe default fork connection timeout, in seconds.protected static StringFORK_CONNECTION_TIMEOUT_PROPERTYThe system property that allows to override the timeout used when connecting to forks.protected static intFORK_PAUSE_WAIT_INTERVALThe interval in which the forks' execution state is checked on first connect.protected static intFORK_SINGLE_CONNECT_TIMEOUT_DEFAULTThe timeout in milliseconds used for a single connection attempt to a fork.protected static StringFORK_SINGLE_CONNECT_TIMEOUT_PROPERTYThe system property that allows to override the single connect timeout used when connecting to forks.protected static intFORK_STARTUP_RETRYCOUNT_DEFAULTThe default number of retries when starting forks.protected static StringFORK_STARTUP_RETRYCOUNT_PROPERTYThe system property that allows to override the number of retries to attempt when starting forked processes.protected static intFORK_WAIT_UNTIL_READY_TIMEOUT_DEFAULTThe default time to wait for a fork to become ready for execution.protected static StringFORK_WAIT_UNTIL_READY_TIMEOUT_PROPERTYThe system property that allows to override the time to wait for a fork to become ready for execution.protected ForkDefinitionforkInExecutionThe fork that is currently being executed.protected Map<ForkDefinition,Fork>forkMapMaps fork definitions to actual fork instances.protected Map<ForkDefinition,TimeSyncState>forkTimeSyncStatesMaps forks to their (intended) timesync states.protected com.google.inject.InjectorinjectorThe Guice injector.protected booleanisTimesetTracingEnabledWhether timeset tracing is enabled.protected ClassLoaderjavaClassLoaderThe classloader used to load model-related classes.protected Map<ForkDefinition,Integer>lastSuiteForForkMaps eachForkDefinitionto the suite call and a number that counts any suite invocations.protected TestModelmodelThe test model being executed.protected ModelCheckermodelCheckerThe model checker is used to validate the test model prior to execution.protected ModelSourceExplorermodelSourceExplorerThe model source explorer.protected static StringMY_FORK_NAMEIf this JVM instance is executing a fork, the name is stored here.protected intnumberOfSuiteInvocationsLeftOnThisForkThis counts the number of suite invocations ttill to be done on this fork.protected Map<String,String>parameterizedConstantValuesThis maps fully qualified constant names to parameter values.protected ParameterResolverparameterResolverThe parameter resolver.protected TestRunnerPerformanceLoggerperformanceLoggerThe performance logger.protected ProcessTerminatorprocessTerminatorThe process watchdog, used to govern other processes started by the test runner.protected DefaultTestRunner.RemotingListenerremotingListenerThe remoting listener, which allows the remoting server to influence test execution.protected IntegrityRemotingServerremotingServerThe remoting server.protected ResultComparatorresultComparatorThe result comparator to use.protected SetListsetListThe current setlist.protected SetListCallbacksetListCallbackThe setlist callback (used to create/update the setlist).protected ObjectsetListWaiterA waiter object used by remoting while waiting for the setlist to be created.protected Map<ForkDefinition,Set<SuiteDefinition>>setupSuitesExecutedThe setup suites that have been executed.protected booleanshallWaitBeforeNextStepWhether the test runner shall pause before executing the next step.protected Set<SuiteDefinition>singleRunSuitesExecutedThe single-run suites that have already been executed.protected TestFormattertestFormatterThe test formatter.protected TestTimeAdaptertestTimeAdapterThe test time adapter.protected static StringTIMESET_TRACE_OUTPUTSystem property to enable writing timeset trace output.protected TimeSyncResultMessagetimeSyncResultThe result of a time sync request from this fork sent to a master is stored here.protected ObjecttimeSyncResultSyncObjectA sync object used to synchronize accesses totimeSyncResult.protected Set<ForkDefinition>touchedForksCollects forks that are being used in the current test run.protected ValueConvertervalueConverterThe value converter.protected VariableManagervariableManagerThe variable manager, which keeps track of the variable values (local and global).protected VariantDefinitionvariantInExecutionThe currently executed test variant.protected WrapperFactorywrapperFactoryThe wrapper factory.
 - 
Constructor SummaryConstructors Constructor Description DefaultTestRunner()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalculateMasterTimeSyncTimeout(int aNumberOfForks)Returns the timeout in seconds for timesync requests originating from this fork, sent to the master and distributed to a variable number of forks for execution.protected List<SuiteSummaryResult>callSuite(Suite aSuiteCall)Performs a specified suite call.protected SuiteSummaryResultcallSuiteSingle(Suite aSuiteCall)Performs a specified suite call (doesn't honor the multiplier!).protected booleancheckForAbortion()Checks whether a situation demanding for a quick test run abortion has occurred.protected voidcheckForValidationError(org.eclipse.emf.ecore.EObject anObject)Checks and ensures that the specified object has no validation errors.protected voidcreateBreakpoint(int anEntryReference)Creates a new breapoint.protected ForkcreateFork(Suite aSuiteCall)Creates a new fork instance.protected voiddefineConstant(ConstantDefinition aDefinition, SuiteDefinition aSuite)Defines a constant.protected voiddefineConstant(ConstantDefinition aDefinition, Object aValue, SuiteDefinition aSuite)Defines a constant.protected voiddefineVariable(VariableDefinition aDefinition, SuiteDefinition aSuite)Defines a variable.protected voiddefineVariable(VariableOrConstantEntity anEntity, Object anInitialValue, SuiteDefinition aSuite)Defines a variable.protected TimeSyncResultMessagedistributeTimeSyncRequest(Date aStartTime, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks)This will be called when a master process either receives a time sync message from one of its forks and has to redistribute it to all the forks that this time sync is intended for, or when a master process encounters a time sync command by itself.protected voiddistributeTimeSyncRequestAsync(Date aStartTime, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks, Fork aResultTarget)Like#distributeTimeSyncRequest(Date, BigDecimal, String[]), but performs the work in an asynchronous thread, so it returns instantly.protected List<CallResult>executeCall(Call aCall)Executes a call.protected CallResultexecuteCallSingle(Call aCall)Executes a call (a single time, doesn't honor the multiplier).protected List<SuiteDefinition>executeSetupSuites(SuiteDefinition aSuite, Map<SuiteDefinition,Result> aSetupResultMap)Executes the provided suite as a setup suite.protected Map<SuiteStatementWithResult,List<? extends Result>>executeSuite(SuiteDefinition aSuite)Executes a suite.protected TestResultexecuteTableTest(TableTest aTest)Executes a table test.protected voidexecuteTearDownSuites(List<SuiteDefinition> aSetupSuitesList, Map<SuiteDefinition,Result> aTearDownResultMap)Executes the teardown suites required by the provided setup suites.protected TestResultexecuteTest(Test aTest)Executes a test (doesn't pay attention to the multiplier).protected ResultexecuteTimeSet(TimeSet aTimeSet)Executes a time setting operation.protected voidexecuteVariableAssignment(VariableAssignment anAssignment, SuiteDefinition aSuite)Executes variable assignments.protected intgetChildProcessKillTimeout()protected intgetChildProcessKillTimeoutDefault()protected Class<?>getClassForJvmType(org.eclipse.xtext.common.types.JvmType aType)Loads a class by resolving a givenJvmType.protected intgetForkConnectDelay()The delay until connection attempts are made to a newly started fork.protected intgetForkConnectionTimeout()The fork connection timeout, in seconds.protected intgetForkConnectionTimeoutDefault()The default fork connection timeout, in seconds.protected intgetForkPauseWaitInterval()The interval in which the forks' execution state is checked on first connect.protected intgetForkSingleConnectTimeout()The timeout in milliseconds used for a single connection attempt to a fork.protected intgetForkSingleConnectTimeoutDefault()Default for the timeout in milliseconds used for a single connection attempt to a fork.protected intgetForkStartupRetryCount()The number of retries when starting forks.protected intgetForkStartupRetryCountDefault()The default number of retries when starting forks.protected intgetForkWaitUntilReadyTimeout()Returns the time to wait for a fork to become ready for execution.protected intgetForkWaitUntilReadyTimeoutDefault()Returns the default time to wait for a fork to become ready for execution.protected voidhandlePossibleAbortException(Throwable anException)If the exception provided is anAbortExecutionException, this method performs the necessary steps to enter "abort" mode locally.voidinitialize(TestModel aModel, Map<String,String> someParameterizedConstants, TestRunnerCallback aCallback, String aResultLocale, Integer aRemotingPort, String aRemotingBindHost, Long aRandomSeed, String[] someCommandLineArguments)Initializes a fresh test runner instance.protected voidinitializeParameterizedConstants()Initializes the parameterized constants from theparameterizedConstantValuesmap.static booleanisFork()Determines whether this JVM is a forked JVM from a master Integrity process.protected voidpauseIfRequiredByRemoteClient(boolean aForkSyncFlag)Pauses execution (blocks the method call) if the remoting client requested to do so via execution control or breakpoints.protected voidperformRemotingBinding(Integer aRemotingPort, String aRemotingBindHost)Performs the remoting port binding.protected voidremoveBreakpoint(int anEntryReference)Removes a specific breakpoint.protected voidreset()Resets the internal variable state.protected voidresetWaitBeforeNextStep()Resets a scheduled interruption (seescheduleWaitBeforeNextStep()).protected ObjectresolveConstantValue(ConstantValue aConstantValue)Resolves a constant value (either it's a static value anyway, or it's a constant which needs to be resolved).SuiteSummaryResultrun(SuiteDefinition aRootSuite, VariantDefinition aVariant, boolean aBlockForRemotingFlag)Executes a specified suite.protected SuiteSummaryResultrun(Suite aRootSuiteCall, VariantDefinition aVariant, boolean aBlockForRemotingFlag)Executes a specific suite call.protected SuiteSummaryResultrunInternal(Suite aRootSuiteCall)Actually executes a root suite call.protected voidscheduleWaitBeforeNextStep()Schedules a "wait for the master" before the next execution step.protected TimeSyncResultMessagesetTestTimeGuarded(long aRealtimeOffset, long aRealtimeDecouplingTime, double aProgressionFactor)Performs a guarded call to theTestTimeAdapter.protected voidsetVariableValue(VariableOrConstantEntity anEntity, Object aValue, boolean aDoSendUpdateFlag)Sets the value of a variable.protected voidsetVariableValue(String aQualifiedVariableName, Object aValue, boolean aDoSendUpdateFlag)Updates a variables' value.protected voidsetVariableValueConverted(VariableOrConstantEntity anEntity, ValueOrEnumValueOrOperationCollection aValue, boolean aDoSendUpdateFlag)Sets the value of a variable.protected booleanshouldExecuteFixtures()Determines whether we should actually execute fixture method calls at the moment.voidshutdown(boolean anEmptyRemotingOutputQueueFlag)Shuts down this test runner instance.protected voidtimesetTraceLog(String anAction, String aLogMessage)Outputs a timeset trace log.protected voidtimesetTraceLog(String anAction, String aLogMessage, Date aStartDate, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks)Outputs a timeset trace log.protected voidundefineVariable(VariableOrConstantEntity anEntity)Undefines a variable (= clears its value, which is NOT exactly the same as setting it to null).protected voidunsetVariableValue(VariableOrConstantEntity anEntity, boolean aDoSendUpdateFlag)Unsets the value of a variable.protected voidunsetVariableValue(String aQualifiedVariableName, boolean aDoSendUpdateFlag)Unsets a variables' value.protected voidwaitForContinue(boolean aForkSyncFlag)Pause execution (blocks method call) until continuation is triggered by remoting.protected voidwaitForSetListInjection()If this is a fork, we now need to wait for the setlist and test scripts to be injected by the master! Otherwise this method returns immediately.
 
- 
- 
- 
Field Detail- 
modelprotected TestModel model The test model being executed.
 - 
setListprotected SetList setList The current setlist.
 - 
setListWaiterprotected Object setListWaiter A waiter object used by remoting while waiting for the setlist to be created.
 - 
executionWaiterprotected Semaphore executionWaiter A semaphore used for single-stepping tests.
 - 
shallWaitBeforeNextStepprotected boolean shallWaitBeforeNextStep Whether the test runner shall pause before executing the next step.
 - 
callbackprotected TestRunnerCallback callback The callback provided by the creator of theTestRunner.
 - 
setListCallbackprotected SetListCallback setListCallback The setlist callback (used to create/update the setlist).
 - 
currentCallbackprotected TestRunnerCallback currentCallback The currently used callback, that is, the callback that gets directly called during execution.
 - 
currentPhaseprotected DefaultTestRunner.Phase currentPhase The current execution phase.
 - 
variableManager@Inject protected VariableManager variableManager The variable manager, which keeps track of the variable values (local and global).
 - 
valueConverter@Inject protected ValueConverter valueConverter The value converter.
 - 
parameterResolver@Inject protected ParameterResolver parameterResolver The parameter resolver.
 - 
wrapperFactory@Inject protected WrapperFactory wrapperFactory The wrapper factory.
 - 
resultComparator@Inject protected ResultComparator resultComparator The result comparator to use.
 - 
processTerminator@Inject protected ProcessTerminator processTerminator The process watchdog, used to govern other processes started by the test runner.
 - 
injector@Inject protected com.google.inject.Injector injector The Guice injector.
 - 
modelSourceExplorer@Inject protected ModelSourceExplorer modelSourceExplorer The model source explorer.
 - 
conversionContextProvider@Inject protected com.google.inject.Provider<ConversionContext> conversionContextProvider The conversion context provider.
 - 
testFormatter@Inject protected TestFormatter testFormatter The test formatter.
 - 
performanceLogger@Inject protected TestRunnerPerformanceLogger performanceLogger The performance logger.
 - 
testTimeAdapter@Inject protected TestTimeAdapter testTimeAdapter The test time adapter.
 - 
remotingServerprotected IntegrityRemotingServer remotingServer The remoting server.
 - 
remotingListenerprotected DefaultTestRunner.RemotingListener remotingListener The remoting listener, which allows the remoting server to influence test execution.
 - 
forkMapprotected Map<ForkDefinition,Fork> forkMap Maps fork definitions to actual fork instances.
 - 
diedForksprotected Set<ForkDefinition> diedForks Collects all forks that have died. If forks die after they have executed their last statement, this is perfectly fine, but if forks die earlier, this set is used to detect that erroneous situation.
 - 
touchedForksprotected Set<ForkDefinition> touchedForks Collects forks that are being used in the current test run. This is filled during dry run execution and is ONLY USABLE ON MASTER.
 - 
forkTimeSyncStatesprotected Map<ForkDefinition,TimeSyncState> forkTimeSyncStates Maps forks to their (intended) timesync states.
 - 
commandLineArgumentsprotected String[] commandLineArguments The original command line arguments, as given to the test runner by the test runner creator.
 - 
parameterizedConstantValuesprotected Map<String,String> parameterizedConstantValues This maps fully qualified constant names to parameter values. Defined during initialization. This allows to define the values for "parameterized" constants.
 - 
modelChecker@Inject protected ModelChecker modelChecker The model checker is used to validate the test model prior to execution.
 - 
classLoader@Inject protected IntegrityClassLoader classLoader The classloader.
 - 
javaClassLoader@Inject protected ClassLoader javaClassLoader The classloader used to load model-related classes.
 - 
constantAndVariableDefinitionDelayedCallbackInvocationsprotected Queue<org.eclipse.xtext.util.Pair<String,Runnable>> constantAndVariableDefinitionDelayedCallbackInvocations This list is used to collect invocations to callbacks during a parallel constant/variable definition phase. Callbacks are not expected to be thread-safe, so we need to synchronize those calls anyway, and we want to have them in deterministic order, so we have to sort them by the variable/constant name.
 
 The existence of this queue defines that all callback invocations should be delayed. If it does not exist, immediate invocation is necessary.
 - 
MY_FORK_NAMEprotected static final String MY_FORK_NAME If this JVM instance is executing a fork, the name is stored here.
 - 
FORK_STARTUP_RETRYCOUNT_PROPERTYprotected static final String FORK_STARTUP_RETRYCOUNT_PROPERTY The system property that allows to override the number of retries to attempt when starting forked processes.- See Also:
- Constant Field Values
 
 - 
FORK_STARTUP_RETRYCOUNT_DEFAULTprotected static final int FORK_STARTUP_RETRYCOUNT_DEFAULT The default number of retries when starting forks. By default, use "fail fast" and abort test runs immediately.- See Also:
- Constant Field Values
 
 - 
FORK_CONNECTION_TIMEOUT_PROPERTYprotected static final String FORK_CONNECTION_TIMEOUT_PROPERTY The system property that allows to override the timeout used when connecting to forks.- See Also:
- Constant Field Values
 
 - 
FORK_CONNECTION_TIMEOUT_DEFAULTprotected static final int FORK_CONNECTION_TIMEOUT_DEFAULT The default fork connection timeout, in seconds.- See Also:
- Constant Field Values
 
 - 
FORK_SINGLE_CONNECT_TIMEOUT_PROPERTYprotected static final String FORK_SINGLE_CONNECT_TIMEOUT_PROPERTY The system property that allows to override the single connect timeout used when connecting to forks.- See Also:
- Constant Field Values
 
 - 
FORK_SINGLE_CONNECT_TIMEOUT_DEFAULTprotected static final int FORK_SINGLE_CONNECT_TIMEOUT_DEFAULT The timeout in milliseconds used for a single connection attempt to a fork. If this timeout is hit, but the total timeout for connecting is not yet over, another attempt is being started.- See Also:
- Constant Field Values
 
 - 
FORK_CONNECT_DELAYprotected static final int FORK_CONNECT_DELAY The delay until connection attempts are made to a newly started fork.- See Also:
- Constant Field Values
 
 - 
FORK_PAUSE_WAIT_INTERVALprotected static final int FORK_PAUSE_WAIT_INTERVAL The interval in which the forks' execution state is checked on first connect.- See Also:
- Constant Field Values
 
 - 
FORK_WAIT_UNTIL_READY_TIMEOUT_PROPERTYprotected static final String FORK_WAIT_UNTIL_READY_TIMEOUT_PROPERTY The system property that allows to override the time to wait for a fork to become ready for execution.- See Also:
- Constant Field Values
 
 - 
FORK_WAIT_UNTIL_READY_TIMEOUT_DEFAULTprotected static final int FORK_WAIT_UNTIL_READY_TIMEOUT_DEFAULT The default time to wait for a fork to become ready for execution.
 - 
CHILD_PROCESS_KILL_TIMEOUT_PROPERTYprotected static final String CHILD_PROCESS_KILL_TIMEOUT_PROPERTY The system property that allows to override the single connect timeout used when connecting to forks.- See Also:
- Constant Field Values
 
 - 
CHILD_PROCESS_KILL_TIMEOUT_DEFAULTprotected static final int CHILD_PROCESS_KILL_TIMEOUT_DEFAULT The default time to wait for child processes to be killed.- See Also:
- Constant Field Values
 
 - 
forkInExecutionprotected ForkDefinition forkInExecution The fork that is currently being executed. This is set regardless of whether we are a fork ourselves and are currently executing our own stuff, or whether we are a master or different fork and skipping over a bunch of invocations due to them being executed by another fork.
 - 
variantInExecutionprotected VariantDefinition variantInExecution The currently executed test variant.
 - 
setupSuitesExecutedprotected Map<ForkDefinition,Set<SuiteDefinition>> setupSuitesExecuted The setup suites that have been executed.
 - 
singleRunSuitesExecutedprotected Set<SuiteDefinition> singleRunSuitesExecuted The single-run suites that have already been executed.
 - 
abortExecutionCauseprotected ExceptionWrapper abortExecutionCause In case of anAbortExecutionExceptionaborting the test execution, this exception is stored here (actually, only the message and stack trace string are stored - this is because the data could just as well come from a fork, in which case an exception can not be transported over the remoting connection).
 - 
lastSuiteForForkprotected Map<ForkDefinition,Integer> lastSuiteForFork Maps eachForkDefinitionto the suite call and a number that counts any suite invocations. The fork should die after this number of suites has executed. Since suite invocation numbers are predeterminable in the dry run and deterministic, this can be used to find out whether a suite during the test run has been the last one to run on a particular fork. During this real test run, the counter is decremented on each suite invocation on a fork, so in the end, we know when the fork has finished execution (= counter reaches zero).
 
 This map is only used by the master to keep track of when the forks should die. It will then wait until they do. The forks still carry the responsibility to terminate their execution in a clean way!
 - 
numberOfSuiteInvocationsLeftOnThisForkprotected int numberOfSuiteInvocationsLeftOnThisFork This counts the number of suite invocations ttill to be done on this fork. Is only used if this test runner is indeed a fork (otherwise this value has no meaning). Is somewhat related tolastSuiteForForkin that this is the individual number of invocations on a fork that is left; it is initially seeded with the correspondinglastSuiteForForkvalue from the master process and then counted down to know when a fork can take the quick path to termination. Basically this is an optimization to allow for quicker termination on forks that would otherwise have a huge bunch of test scripts to run through in dry mode when they're finished.
 - 
timeSyncResultprotected TimeSyncResultMessage timeSyncResult The result of a time sync request from this fork sent to a master is stored here.
 - 
timeSyncResultSyncObjectprotected final Object timeSyncResultSyncObject A sync object used to synchronize accesses totimeSyncResult.
 - 
TIMESET_TRACE_OUTPUTprotected static final String TIMESET_TRACE_OUTPUT System property to enable writing timeset trace output.- See Also:
- Constant Field Values
 
 - 
isTimesetTracingEnabledprotected boolean isTimesetTracingEnabled Whether timeset tracing is enabled.
 
- 
 - 
Method Detail- 
getForkStartupRetryCountprotected int getForkStartupRetryCount() The number of retries when starting forks.
 - 
getForkStartupRetryCountDefaultprotected int getForkStartupRetryCountDefault() The default number of retries when starting forks.
 - 
getForkConnectionTimeoutprotected int getForkConnectionTimeout() The fork connection timeout, in seconds.
 - 
getForkConnectionTimeoutDefaultprotected int getForkConnectionTimeoutDefault() The default fork connection timeout, in seconds.
 - 
getForkSingleConnectTimeoutprotected int getForkSingleConnectTimeout() The timeout in milliseconds used for a single connection attempt to a fork. If this timeout is hit, but the total timeout for connecting is not yet over, another attempt is being started.
 - 
getForkSingleConnectTimeoutDefaultprotected int getForkSingleConnectTimeoutDefault() Default for the timeout in milliseconds used for a single connection attempt to a fork. If this timeout is hit, but the total timeout for connecting is not yet over, another attempt is being started.
 - 
getForkConnectDelayprotected int getForkConnectDelay() The delay until connection attempts are made to a newly started fork.
 - 
getForkPauseWaitIntervalprotected int getForkPauseWaitInterval() The interval in which the forks' execution state is checked on first connect.
 - 
getForkWaitUntilReadyTimeoutprotected int getForkWaitUntilReadyTimeout() Returns the time to wait for a fork to become ready for execution.
 - 
getForkWaitUntilReadyTimeoutDefaultprotected int getForkWaitUntilReadyTimeoutDefault() Returns the default time to wait for a fork to become ready for execution.
 - 
getChildProcessKillTimeoutprotected int getChildProcessKillTimeout() 
 - 
getChildProcessKillTimeoutDefaultprotected int getChildProcessKillTimeoutDefault() 
 - 
calculateMasterTimeSyncTimeoutprotected int calculateMasterTimeSyncTimeout(int aNumberOfForks) Returns the timeout in seconds for timesync requests originating from this fork, sent to the master and distributed to a variable number of forks for execution.- Parameters:
- aNumberOfForks- the number of forks involved in this timesync
- Returns:
- a timeout in seconds
 
 - 
initializepublic void initialize(TestModel aModel, Map<String,String> someParameterizedConstants, TestRunnerCallback aCallback, String aResultLocale, Integer aRemotingPort, String aRemotingBindHost, Long aRandomSeed, String[] someCommandLineArguments) throws IOException Description copied from interface:TestRunnerInitializes a fresh test runner instance. In case of forks, this method guarantees that when it exits without an exception, the master has successfully connected and injected the test scripts and a setlist into it.- Specified by:
- initializein interface- TestRunner
- Parameters:
- aModel- the model to execute (may not contain any test script data yet in case of forks!)
- someParameterizedConstants- Maps fully qualified constant names (must be those with the "parameterized" keyword) to their desired value. This way, test execution can be parameterized from outside.
- aCallback- the callback to use to report test results
- aResultLocale- the locale to be used for the test result generation (if not provided, use the non-localized default strings, which usually are in English)
- aRemotingPort- the port on which the remoting server should listen, or null if remoting should be disabled
- aRemotingBindHost- the host name (or IP) to which the remoting server should bind
- aRandomSeed- the seed for the- RandomNumberOperation(optional; randomly determined if not given).
- someCommandLineArguments- all command line arguments as given to the original Java programs' main routine (required for forking!)
- Throws:
- IOException- if the remoting server startup fails, or if the connection from the master process does not complete in time (for forks only)
 
 - 
performRemotingBindingprotected void performRemotingBinding(Integer aRemotingPort, String aRemotingBindHost) throws IOException Performs the remoting port binding.- Parameters:
- aRemotingPort- the port to bind to, or null if no remoting is desired
- aRemotingBindHost- the host/IP to bind to
- Throws:
- IOException
 
 - 
waitForSetListInjectionprotected void waitForSetListInjection() throws IOExceptionIf this is a fork, we now need to wait for the setlist and test scripts to be injected by the master! Otherwise this method returns immediately.- Throws:
- IOException
 
 - 
shutdownpublic void shutdown(boolean anEmptyRemotingOutputQueueFlag) Shuts down this test runner instance.- Specified by:
- shutdownin interface- TestRunner
- Parameters:
- anEmptyRemotingOutputQueueFlag- true if the remoting server shall be given time to send all remaining messages to clients while closing connections
 
 - 
runpublic SuiteSummaryResult run(SuiteDefinition aRootSuite, VariantDefinition aVariant, boolean aBlockForRemotingFlag) Description copied from interface:TestRunnerExecutes a specified suite. Designated starting point for test execution.- Specified by:
- runin interface- TestRunner
- Parameters:
- aRootSuite- the suite to execute
- aBlockForRemotingFlag- whether execution should pause before actually starting until execution is resumed via remoting
- Returns:
- the suite execution result (this may also be null in case there is no tangible "result", like when the test runner is actually just running the part of a single fork within a bigger test suite - the partial result in this case is not relevant, but is automatically integrated in the result of the master process)
 
 - 
runprotected SuiteSummaryResult run(Suite aRootSuiteCall, VariantDefinition aVariant, boolean aBlockForRemotingFlag) Executes a specific suite call. Internal starting point for test execution.- Parameters:
- aRootSuiteCall- the suite call to execute
- aBlockForRemotingFlag- whether execution should pause before actually starting until execution is resumed via remoting
- Returns:
- the suite execution result
 
 - 
handlePossibleAbortExceptionprotected void handlePossibleAbortException(Throwable anException) If the exception provided is anAbortExecutionException, this method performs the necessary steps to enter "abort" mode locally.- Parameters:
- anException-
 
 - 
checkForAbortionprotected boolean checkForAbortion() Checks whether a situation demanding for a quick test run abortion has occurred. This is true if either anAbortExecutionExceptionhas been thrown (locally or by a fork) or if we are a fork and our last suite has executed. This method does NOT only check something, but also ensures that thesetListCallbackis also removed from the current callback hierarchy - a very important step, since after this method has returned true for the first time, a different execution path than normally is expected, which would cause the set list callback to throw an inconsistency exception.- Returns:
- true if the test execution shall take the quick path to an end
 
 - 
initializeParameterizedConstantsprotected void initializeParameterizedConstants() Initializes the parameterized constants from theparameterizedConstantValuesmap.
 - 
resetprotected void reset() Resets the internal variable state.
 - 
runInternalprotected SuiteSummaryResult runInternal(Suite aRootSuiteCall) Actually executes a root suite call.- Parameters:
- aRootSuiteCall- the suite call to execute
- Returns:
- the result
 
 - 
callSuiteprotected List<SuiteSummaryResult> callSuite(Suite aSuiteCall) Performs a specified suite call.- Parameters:
- aSuiteCall- the suite call to execute
- Returns:
- the suite results (multiple if the suite has an execution multiplier)
 
 - 
callSuiteSingleprotected SuiteSummaryResult callSuiteSingle(Suite aSuiteCall) Performs a specified suite call (doesn't honor the multiplier!).- Parameters:
- aSuiteCall- the suite call to execute
- Returns:
- the suite result
 
 - 
executeSetupSuitesprotected List<SuiteDefinition> executeSetupSuites(SuiteDefinition aSuite, Map<SuiteDefinition,Result> aSetupResultMap) Executes the provided suite as a setup suite. This includes executing further nested setup suites (but not teardown suites, as those will intentionally be executed when the original suite which caused this setup suite to be executed has finished).- Parameters:
- aSuite- the suite to be executed as setup suite
- aSetupResultMap- the map of setup results to add the result to
- Returns:
- a list of executed setup suites
 
 - 
executeTearDownSuitesprotected void executeTearDownSuites(List<SuiteDefinition> aSetupSuitesList, Map<SuiteDefinition,Result> aTearDownResultMap) Executes the teardown suites required by the provided setup suites.- Parameters:
- aSetupSuitesList- the list of setup suites
- aTearDownResultMap- a map into which teardown suite execution results will be stored
 
 - 
executeSuiteprotected Map<SuiteStatementWithResult,List<? extends Result>> executeSuite(SuiteDefinition aSuite) Executes a suite.- Parameters:
- aSuite- the suite to execute
- Returns:
- a map that maps statements to results
 
 - 
defineVariableprotected void defineVariable(VariableDefinition aDefinition, SuiteDefinition aSuite) Defines a variable.- Parameters:
- aDefinition- the variable definition
- aSuite- the suite in which the variable is defined
 
 - 
defineConstantprotected void defineConstant(ConstantDefinition aDefinition, SuiteDefinition aSuite) throws ClassNotFoundException, InstantiationException, UnexecutableException Defines a constant.- Parameters:
- aDefinition- the constant definition
- aSuite- the suite in which the constant is defined
- Throws:
- InstantiationException
- ClassNotFoundException
- UnexecutableException
 
 - 
defineConstantprotected void defineConstant(ConstantDefinition aDefinition, Object aValue, SuiteDefinition aSuite) throws ClassNotFoundException, InstantiationException, UnexecutableException Defines a constant.- Parameters:
- aDefinition- the constant definition
- aValue- the value to define (if null, the value in the constant definition is used; this should only be set in case of parameterizable constants!)
- aSuite- the suite in which the constant is defined
- Throws:
- InstantiationException
- ClassNotFoundException
- UnexecutableException
 
 - 
defineVariableprotected void defineVariable(VariableOrConstantEntity anEntity, Object anInitialValue, SuiteDefinition aSuite) Defines a variable.- Parameters:
- anEntity- the variable entity
- anInitialValue- the initial variable value, or null if the variable is not initialized
- aSuite- the suite in which the variable is defined
 
 - 
undefineVariableprotected void undefineVariable(VariableOrConstantEntity anEntity) Undefines a variable (= clears its value, which is NOT exactly the same as setting it to null).- Parameters:
- anEntity- the variable entity
 
 - 
setVariableValueConvertedprotected void setVariableValueConverted(VariableOrConstantEntity anEntity, ValueOrEnumValueOrOperationCollection aValue, boolean aDoSendUpdateFlag) throws InstantiationException, ClassNotFoundException, UnexecutableException Sets the value of a variable.- Parameters:
- anEntity- the variable entity to update
- aValue- the new value (which will be converted to its default type before assigning it!)
- aDoSendUpdateFlag- whether this update should be sent to connected master/slaves
- Throws:
- InstantiationException
- ClassNotFoundException
- UnexecutableException
 
 - 
setVariableValueprotected void setVariableValue(VariableOrConstantEntity anEntity, Object aValue, boolean aDoSendUpdateFlag) Sets the value of a variable.- Parameters:
- anEntity- the variable entity to update
- aValue- the new value
- aDoSendUpdateFlag- whether this update should be sent to connected master/slaves
 
 - 
setVariableValueprotected void setVariableValue(String aQualifiedVariableName, Object aValue, boolean aDoSendUpdateFlag) Updates a variables' value.- Parameters:
- aQualifiedVariableName- the name of the variable to update
- aValue- the new value
- aDoSendUpdateFlag- whether this update should be sent to connected master/slaves
 
 - 
unsetVariableValueprotected void unsetVariableValue(VariableOrConstantEntity anEntity, boolean aDoSendUpdateFlag) Unsets the value of a variable.- Parameters:
- anEntity- the variable entity to unset
- aDoSendUpdateFlag- whether this update should be sent to connected master/slaves
 
 - 
unsetVariableValueprotected void unsetVariableValue(String aQualifiedVariableName, boolean aDoSendUpdateFlag) Unsets a variables' value.- Parameters:
- aQualifiedVariableName- the name of the variable to unset
- aDoSendUpdateFlag- whether this update should be sent to connected master/slaves
 
 - 
resolveConstantValueprotected Object resolveConstantValue(ConstantValue aConstantValue) Resolves a constant value (either it's a static value anyway, or it's a constant which needs to be resolved).- Parameters:
- aConstantValue- the constant value
- Returns:
- the value
 
 - 
executeVariableAssignmentprotected void executeVariableAssignment(VariableAssignment anAssignment, SuiteDefinition aSuite) Executes variable assignments.- Parameters:
- anAssignment- the assignment to execute
- aSuite- the suite that the assignment is in
 
 - 
executeTestprotected TestResult executeTest(Test aTest) Executes a test (doesn't pay attention to the multiplier).- Parameters:
- aTest- the test to execute
- Returns:
- the result
 
 - 
executeTableTestprotected TestResult executeTableTest(TableTest aTest) Executes a table test.- Parameters:
- aTest- the test to execute
- Returns:
- the result
 
 - 
getClassForJvmTypeprotected Class<?> getClassForJvmType(org.eclipse.xtext.common.types.JvmType aType) throws ClassNotFoundException Loads a class by resolving a givenJvmType.- Parameters:
- aType- the type to load
- Returns:
- the class
- Throws:
- ClassNotFoundException
 
 - 
executeCallprotected List<CallResult> executeCall(Call aCall) Executes a call.- Parameters:
- aCall- the call to execute
- Returns:
- the results (multiple if the call has an execution multiplier)
 
 - 
executeCallSingleprotected CallResult executeCallSingle(Call aCall) Executes a call (a single time, doesn't honor the multiplier).- Parameters:
- aCall- the call to execute
- Returns:
- the result
 
 - 
executeTimeSetprotected Result executeTimeSet(TimeSet aTimeSet) Executes a time setting operation.- Parameters:
- aTimeSet- the timeset command
 
 - 
shouldExecuteFixturesprotected boolean shouldExecuteFixtures() Determines whether we should actually execute fixture method calls at the moment.- Returns:
- true if calls should be executed, false otherwise
 
 - 
pauseIfRequiredByRemoteClientprotected void pauseIfRequiredByRemoteClient(boolean aForkSyncFlag) Pauses execution (blocks the method call) if the remoting client requested to do so via execution control or breakpoints.- Parameters:
- aForkSyncFlag- true if we are pausing for fork synchronization reasons
 
 - 
waitForContinueprotected void waitForContinue(boolean aForkSyncFlag) throws InterruptedExceptionPause execution (blocks method call) until continuation is triggered by remoting.- Parameters:
- aForkSyncFlag- true if we are pausing for fork synchronization reasons
- Throws:
- InterruptedException
 
 - 
removeBreakpointprotected void removeBreakpoint(int anEntryReference) Removes a specific breakpoint.- Parameters:
- anEntryReference- the setlist entry reference at which the breakpoint is set
 
 - 
createBreakpointprotected void createBreakpoint(int anEntryReference) Creates a new breapoint.- Parameters:
- anEntryReference- the setlist entry reference at which the breakpoint will be created
 
 - 
distributeTimeSyncRequestprotected TimeSyncResultMessage distributeTimeSyncRequest(Date aStartTime, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks) This will be called when a master process either receives a time sync message from one of its forks and has to redistribute it to all the forks that this time sync is intended for, or when a master process encounters a time sync command by itself. In both cases it may have to execute it for itself. This method ONLY runs on the master! It calculates the actual internal state variables necessary for the test time proxies running in the individual fork processes and forwards those to the forks (and to the master itself), where these state variable values are then being used to call theTestTimeAdapter.
 
 The method is also responsible for collecting the responses about successful or failed timesyncs and for aggregating them into a result object. It blocks until this has finished (or a timeout has hit).- Parameters:
- aStartTime- the time to set to (if null, use current system time)
- aDiffTime- the time difference in case of relative timesetting (if used, start time is ignored, because relative time setting always works with the previously-set fake test time as basis)
- aProgressionFactor-
- someTargetedForks-
- Returns:
- null if nothing went wrong, an exception wrapper containing all messages and all exceptions (textually merged) in case of (non-critical) errors
 
 - 
distributeTimeSyncRequestAsyncprotected void distributeTimeSyncRequestAsync(Date aStartTime, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks, Fork aResultTarget) Like#distributeTimeSyncRequest(Date, BigDecimal, String[]), but performs the work in an asynchronous thread, so it returns instantly. The result of the operation is sent to the provided fork that shall receive it.- Parameters:
- aStartTime-
- aDiffTime-
- aProgressionFactor-
- someTargetedForks-
 
 - 
setTestTimeGuardedprotected TimeSyncResultMessage setTestTimeGuarded(long aRealtimeOffset, long aRealtimeDecouplingTime, double aProgressionFactor) Performs a guarded call to theTestTimeAdapter. If the call runs into any exception, it will be caught and returned.- Parameters:
- aStartTime-
- aProgressionFactor-
- Returns:
- null in case of success or an exception wrapper with errors in case of errors
 
 - 
isForkpublic static boolean isFork() Determines whether this JVM is a forked JVM from a master Integrity process.- Returns:
 
 - 
createForkprotected Fork createFork(Suite aSuiteCall) throws ForkException Creates a new fork instance. This starts up the forked JVM and connects to it for remote control.- Parameters:
- aSuiteCall- the suite call that shall be run on the fork
- Returns:
- the new fork
- Throws:
- ForkException- if any problem arises during forking
 
 - 
scheduleWaitBeforeNextStepprotected void scheduleWaitBeforeNextStep() Schedules a "wait for the master" before the next execution step.
 - 
resetWaitBeforeNextStepprotected void resetWaitBeforeNextStep() Resets a scheduled interruption (seescheduleWaitBeforeNextStep()).
 - 
checkForValidationErrorprotected void checkForValidationError(org.eclipse.emf.ecore.EObject anObject) Checks and ensures that the specified object has no validation errors.- Parameters:
- anObject- Object to be validated.
 
 - 
timesetTraceLogprotected void timesetTraceLog(String anAction, String aLogMessage, Date aStartDate, List<org.eclipse.xtext.util.Pair<Long,TemporalUnit>> aDiffTime, BigDecimal aProgressionFactor, String[] someTargetedForks) Outputs a timeset trace log. Although this checks forisTimesetTracingEnabled, the caller may also check to save some cycles when generating expensive parameters.- Parameters:
- anAction- the action
- aLogMessage- the message to log
 
 - 
timesetTraceLogprotected void timesetTraceLog(String anAction, String aLogMessage) Outputs a timeset trace log. Although this checks forisTimesetTracingEnabled, the caller may also check to save some cycles when generating expensive parameters.- Parameters:
- anAction- the action
- aLogMessage- the message to log
 
 
- 
 
-