Updating a managed stub by using an Ant task

You can update the values of the attributes of a managed stub by using the HCL DevOps Test Virtualization Control Panel (Test Virtualization Control Panel) Ant tasks.

Here is an example syntax:
<taskdef name="updateManagedStub" classname="com.ghc.ghTester.ant.UpdateManagedStub" classpathref="tasklib" />
<updateManagedStub name="<Stub name>" version="<Stub version number>" serverUrl="https://<Hostname or IP address>:5443/RTCP/"
stubId="<stub Id>" logLevel="<log level>" passthrough="<passthrough>" optimizeForPerformance="<optimize For Performance>" 
responseTime="<responseTime>" inputTags="<inputTags>" agentTags="<agentTags>" workerThreadCount="<workerThreadCount>" 
dedicatedEngineJvmOptions="<dedicatedEngineJvmOptions>" securityToken="<securityToken>" />
You can update the values of the following attributes:
  1. The log level configured in the stub definition.
  2. The Pass-through behavior for the stub.
  3. The performance optimization value.
  4. The delays for response.
  5. The input tags.
  6. The agent tags.
  7. The number of worker threads.
  8. The options for a dedicated JVM engine.
  9. The security token that is required to authenticate the connection if domain-level security is enabled.
The following table lists the attributes that you can use with the updateManagedStub Ant task for updating the attributes of a managed stub.
Table 1. List of available attributes
Attribute Description Required
agentTags No
dedicatedEngineJvmOptions

If you want to run the stub on a dedicated engine, you can also specify the JVM options by using the dedicatedEngineJvmOptions parameter. You can then specify the values for the attributes such as the maximum memory, the initial memory, and the garbage collection policy that must be applied for the dedicated engine.

The JVM options can be specified only if you set this option to "true".
Example:
<taskdef name="startStub" classname="com.ghc.ghTester.ant.StartStub" classpathref="tasklib" />

<startStub domain="default" environment="local" name="ReqRepStub" version="1.0" 
serverUrl="https://localhost:5443/RTCP/" dedicatedEngine="true" 
dedicatedEngineJvmOptions="-Xmx2g -Xms256m -Dmy.option=\"my\ value\"" />
Note:
  • Use spaces to separate the JVM parameters.
  • The quotations and the space in the value must be escaped with a backslash as specified in the example.
No
inputTags No
logLevel No
name Specify the name of the target stub. Yes
passthrough
optimizeForPerformance Specify the value true to disable performance optimization when starting the stub. No
responseTime Specify the value for the Response time attribute. You can specify the values for the delay for the following types of response times:
Response time Description
No delay Specifies the response with no delay.
Minimum delay Specifies the response to be delayed by the time specified in milliseconds (ms).
Uniform distribution Specifies a uniformly distributed response time by specifying the minimum and maximum delay in milliseconds (ms).
Gaussian distribution Specifies a Gaussian response time distribution by specifying the minimum and maximum delay in milliseconds (ms).
No
securityToken

Specify the security token generated for you to authenticate with Test Virtualization Control Panel when the domain security is enabled. In the locked environment mode, the operation can be performed by the user who locked the environment.

No, default is to send no token.
serverUrl URL of the Test Virtualization Control Panel. Yes
stubId Specify the ID of the target stub. Yes
version Version of the target stub to start. No
workerThreadCount Specify the number of worker threads used to service requests to the stub. No

Error codes

For details of any error codes, see Exit codes for Command-line client and Ant client.