IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testgen.core.testgen
Class BaseTestGenerator

java.lang.Object
  extended by com.ibm.rational.test.lt.testgen.core.testgen.BaseTestGenerator
All Implemented Interfaces:
ITestGenerator

public abstract class BaseTestGenerator
extends Object
implements ITestGenerator

A base implementation of ITestGenerator. Although this is not mandatory, it is advised to extend this class rather than implementing the interface. Sub-classes must implement ITestGenerator.process(IRecorderPacket), and may redefine all other protected and public methods.


Constructor Summary
BaseTestGenerator()
           
 
Method Summary
 void complete(IProgressMonitor monitor)
          This implementation does nothing.
 void dispose()
          This implementation does nothing.
 int getCompleteOperationWeight()
          This implementation returns 0.
protected  ITestGeneratorContext getContext()
           
 void initialize(ITestGeneratorContext context)
          This implementation stores the context so it can be retrieved later using BaseTestGenerator.getContext().
 void inspect(IRecorderPacket packet)
          This implementation does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.rational.test.lt.testgen.core.testgen.ITestGenerator
process
 

Constructor Detail

BaseTestGenerator

public BaseTestGenerator()
Method Detail

initialize

public void initialize(ITestGeneratorContext context)
                throws CoreException
This implementation stores the context so it can be retrieved later using BaseTestGenerator.getContext(). Sub-classes may extend this method but should not forget to invoke the super implementation.

Specified by:
initialize in interface ITestGenerator
Parameters:
context - The context in which the test generator will operate.
Throws:
CoreException

inspect

public void inspect(IRecorderPacket packet)
             throws CoreException
This implementation does nothing. Sub-classes may override as necessary.

Specified by:
inspect in interface ITestGenerator
Parameters:
packet - A recorder packet whose type has been declared to be supported by this test generator.
Throws:
CoreException

complete

public void complete(IProgressMonitor monitor)
              throws CoreException
This implementation does nothing. Sub-classes may override as necessary. If the implementation intends to use the progress monitor (which is not required by the interface), it should also override BaseTestGenerator.getCompleteOperationWeight().

Specified by:
complete in interface ITestGenerator
Parameters:
monitor - A progress monitor. This progress monitor can be safely ignored if ITestGenerator.getCompleteOperationWeight() returns 0. Otherwise, the implementation is expected to update this monitor to reflect the operation progress.
Throws:
CoreException

dispose

public void dispose()
This implementation does nothing. Sub-classes may override as necessary.

Specified by:
dispose in interface ITestGenerator

getContext

protected final ITestGeneratorContext getContext()

getCompleteOperationWeight

public int getCompleteOperationWeight()
This implementation returns 0. Sub-classes may override if the complete operation is long-running and needs to report progress.

Specified by:
getCompleteOperationWeight in interface ITestGenerator
Returns:

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.