 
Modifying a Generated Test Script
Scenario Tests
11
To modify the template for performance testing, uncomment the line in the template 
that calls the constructor for the 
TSSMeasure
 class, as shown in the following EJB 
example:
public void testMain(String[] args) {
boolean fRetval = false;
TSSMeasure tss = new TSSMeasure(); // used for measuring performance 
TSSDataPool dp = new TSSDataPool();
int iDPCount = 0;
Be sure to use this modified template whenever you want to create a test script for 
capturing performance data.
For more information about the 
TSSMeasure
 class, see the documentation for the 
TSSMeasure
 class in the Rational Test Script Services for Java manual and the Rational 
Test Script Services for Visual Basic manual.
Modifying a Generated Test Script
Each generated test script must be edited to capture performance data. Typically, you 
need to insert measurement calls around each remote method call that you want to 
measure. To do this:
1
Insert a 
TSSMeasure.commandStart()
 call before and a 
TSSMeasure.commandEnd()
 call after the invocation of each 
method-under-test.
By placing 
commandStart()
 and 
commandEnd()
 calls around each remote 
method call, you can measure the time required to complete these calls under load. 
The following code example shows some typical parameters to the 
commandStart()
 and 
commandEnd()
 methods. 
tss.commandStart("deposit", "deposit", MST_WAITRESP);
retdeposit_double = Accountremote.deposit(amt);
tss.commandEnd(TSS_LOG_RESULT_PASS);
2
Optionally, you can use the 
TSSMeasure.think()
 method to insert a think-time 
delay before any method call that would typically follow a user interaction or 
other pause. 
For further information about these methods, see the Rational Test Script Services for 
Java manual. For information about the corresponding Visual Basic operations, see 
the Rational Test Script Services for Visual Basic manual.