This easy-to-use tool allows you to dynamically manipulate data within a data repository following the standard CRUD model (Create, Read, Update, Delete).
In this section:
Ensure you have a Data Repository data source which points to the data set you want to perform CRUD operations on.
- Choose Parasoft> Preferences.
- Open the Parasoft> System Properties page.
- Click Add JARS and choose and select the com.parasoft.soavirt.tool.datarepositorycrud-1.2.0.jar JAR file.
Attach an XML Transformer to the output you wish to use to update the data repository. The following example XML may be expected by the responder:
- Click each element in the tree on the left-hand side of the XML Transformer you just added that should be used to update the data repository and click Add XPath
- Expand the Options section in the bottom left-hand corner of the XML Transformer and enable the Allow alteration option.
- Click the Alter tab in the XML Transformer and perform the following actions for each element you added:
- Click the element in the tree and click the Add XPath.
- Click the XPath you just added in the Selected XPaths list on the right-hand side and click the Modify button.
- In the alteration section, make sure the Prepend option is enabled and enter the name of the column that the element maps to in the data source followed by a colon. For example, if you want the
<identifier>element in the sample XML above to map to the "id" column and the
<fname>element to map to the "fname" column, you would prepend
- Save the XML Transformer.
- Right-click the XML Transformer and chose Add output...
- Choose Data Repository CRUD Tool from the list and click Finish.
- Enter the name of the operation you wish to perform on the repository in the Mode ('Create-Update' or 'Delete') field.
- Enter the name of the repository data source that points to the data set you'd like to perform CRUD operations on in the Repository Data Source Name.
Now when the SOAtest tool is run or the Virtualize Message responder is hit, the Data Repository CRUD Tool will perform the correct operation.
Running the Examples
- Prepare the data repository:
- Click Add in the Data Repositories view.
- Change the repository name to "datarepositorysample"
- Click Validate and confirm that you want to create the repository when prompted.
- Right-click the "datarepositorysample" Data Repository and click Import Repository.
- Browse to sampleDataRepository.json and click Open.
- Copy updateRepository.pva into your VirtualAssets folder and deploy it to a remote server if necessary.
- Copy testDataRepositoryCRUDTool.tst into your workspace.
- Update the "VIRTUALIZE" environment in testDataRepositoryCRUDTool.tst to point to the Virtualize server you deployed updateRepository.pva.
- Run Test Suite: Update in Virtualize.