...
The Data Learning tool is used to incrementally extend a virtual asset's reach to cover a broader range of use cases. It automatically expands the data set by observing traffic and adding net new observations to the data repository—enabling repository, enabling teams to rapidly enhance data-driven virtual assets. The update process can be fully - automated (invoked whenever new data is detected, via the File Event Listener Marketplace tool) or initiated on an as-needed basis (via provisioning actions).
...
This tool is implemented as datalearningtool.jar. You can install the tool from the UI or the command line.
UI Installation
- Choose Go to Parasoft > Preferences and click System Properties.
- Click Add JARs and browse for select the datalearningtool.jar file.
- Click Apply and restart .
- Restart Virtualize.
Command Line Installation
Add the datalearningtool.jar file to the system.properties.classpath
property in your settings properties file. For example:
system.properties.classpath=<path to jar><PATH_TO_JAR>/datalearningtool.jar
Usage
...
Add a .pvn file to the project (see Defining Provisioning Actions) and right.
Right-click the Action Suite node and choose Add New > Action.
Choose
Add New> Action and chooseData Learning Tool from the Add Action wizard that opens.
- Click Finish and configure the tool (see Configuration).
...
If you want it to run automatically whenever new or updated traffic is detected in a specific traffic file directory, chain the tool to the outgoing response of a Message Responder and ensure that the associated virtual asset is configured with the File Event Listener (visit the Parasoft Marketplace to download the File Event Listener). For File Event Listener configuration details, see the File Event Listener documentationdocumentation that comes with it.
In both cases, the tool will do the following once it is triggered:
...
Use Remote Server (Default: false) | Enter |
---|---|
Host | Specify the host of the Virtualize Server that should process the traffic files. |
Port (Default: 9080) | Specify the port of the Virtualize Server that should process the traffic files. Default is |
Username | Specify a username for authenticating with this Virtualize Server. |
Password | Specify a password for authenticating with this Virtualize Server. |
Upload Path (Relative to VirtualAsset) | (Optional) Specify where on this Virtualize Server to upload the files that are used to identify and process new traffic. This directory should be relative to the Virtualize Server's VirtualAssets project. This setting is optional. |
Data Repository Settings
...
- Copy the following files to a project within your workspace (such as
ProvisioningAssets
):- DataLearner.pvn
- DataLearner_1.txt
- DataLearner_2.txt
- DataLearningExample.traffictemplate
- Invoke the .pvn by either running it directly in the Virtualize UI or through CTP. The tool will scan the directory for the traffic template and DataLearner_*.txt traffic files, importing data from them into the Data Repository on
localhost
.
Using the Tool Chained to a Responder
- Deploy DataLearner.pva as a Virtual Asset in Virtualize at the HTTP path:
/DataLearner
. - Copy DataLearner_1.txt and DataLearner_2.txt to
VirtualAssets/traffic_files/
on the Virtualize server where the DataLearner Virtual Asset is deployed. - Copy
DataLearnerExample.traffictemplate
toVirtualAssets/traffic_templates/
on the Virtualize server where the DataLearner Virtual Asset is deployed. - (Optional) Update the Environment in DataLearner.tst to point to the correct Virtualize host.
- (Optional and but recommended) Start Monitoring the
DataLearner
Virtual Asset. - Run DataLearner.tst. This test invokes the
DataLearner
Virtual Asset over HTTP, causing the chained Data Learning Tool to run. The chained tool uses the traffic template and traffic files that were copied in steps 2 and 3. - Note that events are reported to the Virtualize Event Log and that the traffic files are deleted from trafficfrom
traffic_files
when done.
Using a Message Proxy to Record Transactions
- Create a Message Proxy and add a connection (see Creating Proxies).
- Configure the connection to use a unique traffic file pattern (i.e.,
%n
) and enable the New session file for each message pair option. - Make sure the Data Learning Tool is configured to scan the directory to which the Proxy Connection will record. Relative paths in the Data Learning Tool configuration are relative to the .pva or .pvn that contains the tool.
- Record traffic normally through the Message Proxy.
- Run the Data Learning Tool to process recorded transactions.
...
- Configure the Message Proxy's primary connection to forward to the virtual asset.
- Configure the Message Proxy's secondary connection to forwards to the live virtual service.
- Enable the Record on secondary connection only and New session file for each message pair options for the Message Proxy.
- Configure the virtual asset to use the File Event Listener as a Custom Transport and configure the listener to monitor the directory where the proxy will save traffic files.
- Add a responder with a Data Learning Tool chained to it to the .pva associated with the virtual asset.
- Configure the tool to add data to the Data Repository that originally did not have the request/response.