IBM Rational Performance Tester SDK

com.ibm.rational.test.lt.testgen.core.testgen
Interface ITestGenerator

All Known Implementing Classes:
BaseTestGenerator

public interface ITestGenerator

A Test Generator receives recorder packets and produces test model elements that it adds to the test model. It receives packets through the ITestGenerator.process(IRecorderPacket) or ITestGenerator.inspect(IRecorderPacket) methods, and add models elements to the test model using methods from the test stack available through its context getter.


Method Summary
 void complete(IProgressMonitor monitor)
          Completes the generation.
 void dispose()
          Allows the test generator to release any resources it has allocated.
 int getCompleteOperationWeight()
          Returns the relative cost of the complete operation, in percent of the total processing performed by this test generator.
 void initialize(ITestGeneratorContext context)
          Initializes the test generator.
 void inspect(IRecorderPacket packet)
          Inspects a recorder packet that was processed by another test generator.
 boolean process(IRecorderPacket packet)
          Processes a recorder packet.
 

Method Detail

initialize

void initialize(ITestGeneratorContext context)
                throws CoreException
Initializes the test generator.

Parameters:
context - The context in which the test generator will operate.
Throws:
CoreException

process

boolean process(IRecorderPacket packet)
                throws CoreException
Processes a recorder packet. The test generator determines if the packet is supported, and if so, processes it in order to make additions to the test suite being generated.

Parameters:
packet - A recorder packet whose type has been declared to be supported by this test generator.
Returns:
Whether the packet was consumed, i.e. actions have been generated in order to play back the recorded packet when the test is executed. Only one test generator can consume a packet. Other interested test generators can only inspect the recorder packet.
Throws:
CoreException

inspect

void inspect(IRecorderPacket packet)
             throws CoreException
Inspects a recorder packet that was processed by another test generator. Since the data carried by the packet has already been consumed to generate actions that can play it back, this test generator should not add any action that would play it back again.

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

complete

void complete(IProgressMonitor monitor)
              throws CoreException
Completes the generation. This method is invoked after all packets have been passed to the generator. There is no guaranty that this method is invoked, even if some packets have been passed to the generator (for example, if the test generation process has been canceled). For clean-up and resource disposal, implement ITestGenerator.dispose() instead.

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

void dispose()
Allows the test generator to release any resources it has allocated. This method is guaranteed to be invoked if ITestGenerator.initialize(ITestGeneratorContext) has been invoked.


getCompleteOperationWeight

int getCompleteOperationWeight()
Returns the relative cost of the complete operation, in percent of the total processing performed by this test generator.

Returns:

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.