IBM Rational Performance Tester SDK

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


public interface ITestStack

The test stack is used during test generation to track and act on the current state of the generated test(s). The stack contains one or more CBElementHost; the first is always a LTTest, which corresponds to the current test being generated. Additional CBElementHosts can be pushed, popped or peeked.


Method Summary
 void add(CBActionElement element, long timestamp, boolean hasThinkTime)
          Adds an element to the current element host.
 void addSplitPoint(String name, String comment, long timestamp)
          Adds a split point marker.
 long getElapsedTime(long startTimestamp)
          Returns the elapsed time between the given timestamp and the end of the last added element in the stack.
 LTTest getTest()
          Returns the generated test, i.e. the first element in the stack.
 CBElementHost peek()
          Returns the current element host in the stack.
 CBElementHost pop(long timestamp)
          Pops the current element host of the stack.
 void push(CBElementHost host, long timestamp, boolean hasThinkTime)
          Pushes a new element host to the stack.
 void push(CBElementHost host, long timestamp, boolean hasThinkTime, Set<String> allowedTestGenerators, boolean breakable)
          Pushes a new element host to the stack.
 

Method Detail

push

void push(CBElementHost host,
          long timestamp,
          boolean hasThinkTime)
Pushes a new element host to the stack. The new element host is added under the current element host, and becomes the current element host. The new element host is public, i.e. any test generator can add elements under this host.

Parameters:
host - An element host.
timestamp - The timestamp of the added element. This timestamp is expressed in the same unit as packet timestamps from the recording, and will be used as a reference to compute the think time of the next generated element. The value -1 must be used if the element does not have a time stamp.
hasThinkTime - specifies whether the host element has an effective think time when executing or not.

push

void push(CBElementHost host,
          long timestamp,
          boolean hasThinkTime,
          Set<String> allowedTestGenerators,
          boolean breakable)
Pushes a new element host to the stack. The new element host is added under the current element host, and becomes the current element host. The new element host is private, and only designated test generators can add elements under this host.

Parameters:
host - An element host.
timestamp - The timestamp of the added element. This timestamp is expressed in the same unit as packet timestamps from the recording, and will be used as a reference to compute the think time of the next generated element. The value -1 must be used if the element does not have a time stamp.
allowedTestGenerators - A list of test generator ids (qualified id) that are allowed to add elements under the element host. It is not necessary for a test generator to include itself in the list as a test generator is always allowed to add elements under a private element host it has created.
breakable - Specifies whether the container may be automatically popped off by the test stack if another test generator needs to add an element, but is not allowed to add it under the element host.
hasThinkTime - specifies whether the host element has an effective think time when executing or not.

pop

CBElementHost pop(long timestamp)
Pops the current element host of the stack.

Parameters:
timestamp - The timestamp of the added element. This timestamp is expressed in the same unit as packet timestamps from the recording, and will be used as a reference to compute the think time of the next generated element. The value -1 must be used if the element does not have a time stamp.
Returns:
The element that was removed from the stack.

peek

CBElementHost peek()
Returns the current element host in the stack.

Returns:
the current element host in the stack.

getTest

LTTest getTest()
Returns the generated test, i.e. the first element in the stack.

Returns:
the generated test.

add

void add(CBActionElement element,
         long timestamp,
         boolean hasThinkTime)
Adds an element to the current element host.

Parameters:
element - An element.
timestamp - The timestamp of the added element. This timestamp is expressed in the same unit as packet timestamps from the recording, and will be used as a reference to compute the think time of the next generated element. The value -1 must be used if the element does not have a time stamp.
hasThinkTime - specifies whether the host element has an effective think time when executing or not.

addSplitPoint

void addSplitPoint(String name,
                   String comment,
                   long timestamp)
Adds a split point marker. The generated test will be split into several tests, separated at marked split points, as the final step of test generation.

Parameters:
name - The split name.
comment - Any comment associated to the split point.

getElapsedTime

long getElapsedTime(long startTimestamp)
Returns the elapsed time between the given timestamp and the end of the last added element in the stack. This call can be used directly the compute the think time of an element.

Parameters:
startTimestamp - The start time stamp of the element
Returns:
The elapsed time since the end of the last added element in the stack. If this amount is negative, it would then return the elapsed since the last added element in the stack that has an effective think time. If this amount is still negative, it would then return 0. It is expressed in the same unit as packet timestamps from the recording.

IBM Rational Performance Tester SDK

© Copyright IBM Corp. 2012. All rights reserved.