IBM Rational Performance Tester SDK

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


public interface ITestGeneratorContext

Provides the necessary information and operations for a ITestGenerator to operate.


Method Summary
 TestGeneratorConfiguration getConfiguration()
          Returns the test generator configuration that defines options for this test generator, if any.
 IContainer getOutputContainer()
          Returns the innermost common container (folder or project) of the generated tests.
 RecorderConfiguration getRecorderConfiguration(short recorderId)
          Returns the recorder configuration of the recorder with the specified id.
 RecordingSessionConfiguration getRecordingSessionConfiguration()
          Returns the recording session configuration that was used to perform the recording session.
 ITestStack getStack()
          Returns the test stack.
 ITimeReference getTimeReference()
          Returns the time reference that allows to convert recording timestamps, expressed in an implementation-dependent but very accurate unit, to times expressed in milliseconds.
 void logMessage(com.ibm.rational.test.lt.recorder.core.util.LogMessageSeverity severity, String message)
          Logs a message about the conversion.
 RecorderAnnotation resolveAnnotation(IRecorderAnnotationPacket packet)
          Returns the recorder annotation associated to the given annotation packet.
 

Method Detail

getStack

ITestStack getStack()
Returns the test stack. The stack is shared by all test generators and allows them to cooperate by adding model elements at the appropriate level.

Returns:
the test stack.

getOutputContainer

IContainer getOutputContainer()
Returns the innermost common container (folder or project) of the generated tests. If only one test is generated, this is parent folder of the generated test. Since it is not possible for generate tests to span over several projects, the common container will at least be a project (it cannot be the workspace root). The return value is null if test generation is run with the TestGenerationConfiguration.NO_FILE_OUTPUT_PROPERTY option set to true.

Returns:
The innermost common container (folder or project) of the generated tests. null if test generation is run with the TestGenerationConfiguration.NO_FILE_OUTPUT_PROPERTY option set to true.

getConfiguration

TestGeneratorConfiguration getConfiguration()
Returns the test generator configuration that defines options for this test generator, if any.

Returns:
A test generator configuration, or null if none was provided in the test generation configuration.

getRecordingSessionConfiguration

RecordingSessionConfiguration getRecordingSessionConfiguration()
Returns the recording session configuration that was used to perform the recording session.

Returns:
the recording session configuration that was used to perform the recording session.

getRecorderConfiguration

RecorderConfiguration getRecorderConfiguration(short recorderId)
Returns the recorder configuration of the recorder with the specified id. Each recorder packet carries the id of the recorder that issued it.

Parameters:
recorderId - A recorder id.
Returns:
The recorder configuration of the recorder with the specified id, or null if no recorder has the specified id.
See Also:
IRecorderPacket.getRecorderId()

logMessage

void logMessage(com.ibm.rational.test.lt.recorder.core.util.LogMessageSeverity severity,
                String message)
Logs a message about the conversion. This method may be invoked each time the test generator needs to log an informational message about the pending generation. The way a message will be presented to the user depends on its severity. Debug messages are usually not presented to the user and displayed only if the corresponding option has been enabled. Fatal messages, in addition to be presented to the user, will cause the conversion, and any process depending on it, to abort.

Parameters:
severity - The message severity
message - A message

getTimeReference

ITimeReference getTimeReference()
Returns the time reference that allows to convert recording timestamps, expressed in an implementation-dependent but very accurate unit, to times expressed in milliseconds.

Returns:
the time reference

resolveAnnotation

RecorderAnnotation resolveAnnotation(IRecorderAnnotationPacket packet)
Returns the recorder annotation associated to the given annotation packet. The returned annotation may be the one that was recorded, or the one that was defined to override the original (annotation overriding can be declared in the test generation configuration). Since annotation overriding allows to undefine an annotation, this method may return null. In this case, the annotation packet should be ignored.

Parameters:
packet - An annotation packet.
Returns:
The annotation associated to the packet.

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.