JTR 5.0 API Documentation

jtr.test
Class TestRunManager

java.lang.Object
  extended by jtr.test.TestRunManager
All Implemented Interfaces:
IPoolManager
Direct Known Subclasses:
RemoteTestRunManager

public class TestRunManager
extends java.lang.Object
implements IPoolManager

This class is the manager of a JTR test.
Its responsabilites are:
1. creating a thread group within which all the IRunners will execute
2. initializing the pool of IRunners accoding to the content of the jtr.xml file
3. starting all the IRunners
4. managing the pooling of the IRunners after each epoch

Since:
1.0
Version:
5.0
Author:
Francesco Russo (frusso@dev.java.net)
See Also:
IRunnerPooled, RunnerPool, RunnerPoolFiller

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
TestRunManager(TestConfig testConfig)
          Costructor.
 
Method Summary
 void backIntoPool(IRunnerParameterized pRunner)
          Once an IRunner has consumed its runs for a given epoch it has to be put back into the pool waiting for the next epoch to come.
protected  void disposeResources()
          Invoked when the epochs are over.
protected  int getCompletedRunners()
           
protected  int getCurrentEpoch()
           
protected  int getEpochs()
           
protected  int getInitialPoolSize()
           
protected  RunnerPool getPool()
           
protected  java.lang.ThreadGroup getRunnersThreadGroup()
           
protected  TestConfig getTestConfig()
           
protected  TestOutcomeTable getTestOutcomeTable()
           
protected  IRunnerParameterized handleReinitialization(IRunnerParameterized pRunner)
          The reinitialization of an IRunnerParameterized is delegated to its associated IParamsAssigner.
protected  RunnerPool initializePool(TestConfig testConfig, ITestCompletionListener testCmplLsnr)
          Initialize the pool of IRunners.
protected  void setCompletedRunners(int val)
           
protected  void setCurrentEpoch(int val)
           
protected  void setEpochs(int val)
           
protected  void setInitialPoolSize(int val)
           
protected  void setPool(RunnerPool val)
           
protected  void setRunnersThreadGroup(java.lang.ThreadGroup tg)
           
protected  void setTestConfig(TestConfig val)
           
protected  void setTestOutcomeTable(TestOutcomeTable val)
           
 void startTest()
          Launches the test.
protected  void startThreads()
          Starts all the IRunners for the current epoch of the current test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger
Constructor Detail

TestRunManager

public TestRunManager(TestConfig testConfig)
Costructor.

Parameters:
testConfig - The test configuration obtained from the jtr.xml file
Method Detail

startTest

public void startTest()
               throws TestFailedException
Launches the test.

Throws:
TestFailedException

initializePool

protected RunnerPool initializePool(TestConfig testConfig,
                                    ITestCompletionListener testCmplLsnr)
                             throws IRunnerCreationException,
                                    UnknownAssignmentPolicyException
Initialize the pool of IRunners.

Parameters:
testConfig - The test configuration
Returns:
RunnerPool The pool of IRunnerPooled
Throws:
IRunnerCreationException
UnknownAssignmentPolicyException

startThreads

protected void startThreads()
Starts all the IRunners for the current epoch of the current test


backIntoPool

public void backIntoPool(IRunnerParameterized pRunner)
Once an IRunner has consumed its runs for a given epoch it has to be put back into the pool waiting for the next epoch to come.
Before being added to the pool it has to be reinitialized according to what has been specified inside the jtr.xml configuration file.
Once all the IRunners are back into the pool, the test will start againg until the last epoch is reached.

Specified by:
backIntoPool in interface IPoolManager
Parameters:
pRunner - The IRunner to be put back into the pool

handleReinitialization

protected IRunnerParameterized handleReinitialization(IRunnerParameterized pRunner)
The reinitialization of an IRunnerParameterized is delegated to its associated IParamsAssigner.

Parameters:
pRunner - IRunnerParameterized
Returns:
IRunnerParameterized

disposeResources

protected void disposeResources()
Invoked when the epochs are over.


setCurrentEpoch

protected void setCurrentEpoch(int val)

getCurrentEpoch

protected int getCurrentEpoch()

setEpochs

protected void setEpochs(int val)

getEpochs

protected int getEpochs()

setTestOutcomeTable

protected void setTestOutcomeTable(TestOutcomeTable val)

getTestOutcomeTable

protected TestOutcomeTable getTestOutcomeTable()

setPool

protected void setPool(RunnerPool val)

getPool

protected RunnerPool getPool()

setTestConfig

protected void setTestConfig(TestConfig val)

getTestConfig

protected TestConfig getTestConfig()

setInitialPoolSize

protected void setInitialPoolSize(int val)

getInitialPoolSize

protected int getInitialPoolSize()

setRunnersThreadGroup

protected void setRunnersThreadGroup(java.lang.ThreadGroup tg)

getRunnersThreadGroup

protected java.lang.ThreadGroup getRunnersThreadGroup()

setCompletedRunners

protected void setCompletedRunners(int val)

getCompletedRunners

protected int getCompletedRunners()

The JTR Project is licensed under GPL version 2