Accessing the actual schedule name from the custom code

When there are any special characters in the name of the schedule, you can write the actual name of the schedule in the test log by using the appropriate interface in the custom code.

The following sample custom code shows how to write the name of the schedule in the test log:

package customcode;

import com.ibm.rational.test.lt.kernel.engine.impl.Engine;
import com.ibm.rational.test.lt.kernel.services.ITestExecutionServices;

/**

@author Custom Code Samples
*/
public class GetActualScheduleName implements com.ibm.rational.test.lt.kernel.custom.ICustomCode2 {

/**

Instances of this will be created using the no-arg constructor.
*/
    public GetActualScheduleName() {
        }
/**

For javadoc of ICustomCode2 and ITestExecutionServices interfaces, select 'Help Contents' in the
Help menu and select 'Extending HCL OneTest Performance functionality' -> 'Extending test execution with custom code'
*/
        public String exec(ITestExecutionServices tes, String[] args) { 
            String schName = Engine.getInstance().getSchedule().getScheduleName();
            tes.getTestLogManager().reportMessage("Schedule Name is "+schName);
                   return null; }
}