When configuring a component instance with a virtual asset, you can either select an existing virtual asset or create a new one.

Selecting an Existing Virtual Asset

To configure a component instance with an existing virtual asset:

  1. In the Components wizard area (or the Virtual Asset area of the Instance editor), click Select a virtual asset, then select the virtual asset (.pva) file that you want to use via the virtual asset selector.



    You can use the search bar to filter the list contents. The search functionality covers .pva names as well as associated metadata.
  2. If there are multiple deployments of that virtual asset, select which one you want to configure here. 

    A single virtual asset (.pva) file might be simultaneously deployed at multiple endpoints—each with a different data source / performance profile configuration. Virtual asset file specifies which .pva to use. Deployment refers to a specific virtual asset deployed at a unique endpoint.

  3. If that virtual asset file has performance and data group settings associated with it, configure them as follows:
    1. Specify which of the available performance profiles you want to apply to each of the virtual asset’s performance groups.
    2. Specify which of the available data sets you want to be active in each of the virtual asset’s data groups.
       

Creating a New Virtual Asset: Options

There are several ways to create virtual assets. You can create:

  • A virtual asset for behavior recorded in a traffic file
  • A virtual asset that represents a RAML, Swagger, or WSDL definition
  • An empty virtual asset that you can later extend

Creating a New Virtual Asset from Traffic

Prerequisites

In order to create a new virtual asset from traffic, you need the following:

  • A running Parasoft Virtualize Server connected to CTP
  • A running Parasoft Data Repository connected to CTP (through TDA)
  • At least one traffic file (e.g., created by proxy recording or event message export)

This functionality is designed for rapid generation of virtual assets. For additional control over the generation process, follow the procedure in Creating Virtual Assets from Traffic or use the Virtualize desktop. 

To create and add a new virtual asset for behavior recorded in a traffic file:

  1. In the Components wizard area (or the Virtual Assets area of the Instance editor), click Select a virtual asset.
  2. In the selection box that opens, click the Create new virtual asset link to the right of the Virtualize server on which you want the new virtual asset deployed.

    Note that servers which do not support this functionality will be grayed out. 
  3. (Optional) Modify the default virtual asset name.
  4. Leave Create set to From Traffic.

  5. Select the traffic file you want to use for virtual asset creation. If CTP detects a traffic file that was recorded from this component, that file will be selected automatically. To repopulate the list of traffic files, click Refresh.

    Shortcut

    If you’re starting and stopping traffic recording via CTP, and click Now in the following dialog, you’ll automatically be taken to this point in the process.

    Before you proceed, you might want to rename the component instance.

  6. (Optional) If you want to create virtual assets using "create from traffic" configurations that were saved in a template, specify which template you want to use (you can select from any templates available within the traffic_templates folder on the given Virtualize server). Once a template is specified, the related fields will be automatically set and become uneditable. 

  7. Specify connection settings for the data repository that will be used to parameterize the virtual asset.

    • Under Repository server, select an existing data repository server (connected through TDA). 

    • Under Repository name, enter a name that will be used to label the created repository. Autocomplete will suggest the names of existing repositories. If you use the name of an existing repository, that data could be overwritten. You cannot use a repository that is locked to another user (locks are indicated with lock icons).

  8. If you want to modify the endpoint at which the created virtual asset will be deployed (e.g., where virtual asset will listen for incoming messages), make the desired modifications in the Virtual endpoints fields. Note that if a proxy is associated with the current component instance, the proxy target will be updated automatically.


After you submit the request (upon clicking Finish in the wizard or saving changes to the Manage Instance page), the following items will be created and configured:

  • A .pva file will be created on the designated Virtualize server.
  • A Message Responder with parameterized elements as well as preconfigured responder correlation and data source correlation.
  • A Data Repository with applicable data sets and record types. One data set will be added per message "group" identified by analyzing the traffic. 
  • A repository data source will be added for each added data set and the Message Responder will be configured to use this data source.

Creating a New Virtual Asset from a Swagger, RAML, or WSDL Definition

To create and add a new virtual asset for the behavior specified in a Swagger, RAML, or WSDL definition:

  1. In the Components wizard area (or the Virtual Assets area of the Instance editor), click Select a virtual asset.
  2. In the selection box that opens, click the Create new virtual asset link to the right of the Virtualize server on which you want the new virtual asset deployed. Note that servers which do not support this functionality will be grayed out. 
  3. (Optional) Modify the default virtual asset name.
  4. Change Create to From RAML, From Swagger, or From WSDL.

  5. Specify the location of the API/service definition.

After you submit the request (upon clicking Finish in the wizard or saving changes to the Manage Instance page), the following items will be created and configured:

  • For all: A .pva file will be created on the designated Virtualize server. 
  • For WSDL: Message Responders for the operations and fault messages defined in the WSDL.
  • For RAML/Swagger: One Message Responder configured for each resource/method/status code in the definition. The responder's correlation, status code, and response are configured accordingly. A sample message (if available) is included in the response. If the service definition includes a JSON schema, a sample response is constructed from that JSON schema.

Creating a New Empty Virtual Asset

To create a new empty virtual asset:

  1. In the Components wizard area (or the Virtual Assets area of the Instance editor), click Select a virtual asset.
  2. In the selection box that opens, click the Create new virtual asset link to the right of the Virtualize server on which you want the new virtual asset deployed. Note that servers which do not support this functionality will be grayed out. 
  3. (Optional) Modify the default virtual asset name.
  4. Change Create to Empty.

After you submit the request (upon clicking Finish in the wizard or saving changes to the Manage Instance page), an empty .pva file will be created on the designated Virtualize server. You can add Message Responders to it when you are ready. 

  • No labels