Repository data—like data from Excel, CSV, and other data sources—is consumed by Parasoft messaging tools via a data source. You define a data source that specifies where to access the appropriate data and (optionally) what subset of the available data you want to use. Then, you populate tools by parameterizing values against this data source.
In SOAtest, repository data can be consumed in messaging client tools, such as the SOAP Client, REST client, Messaging Client, and other client-oriented tools.
In Virtualize, repository data can be consumed in Message Responders, SQL Responders, and client-oriented validation tools. For details on how repository data is used in SQL Responders, see SQL Responder. All other cases are discussed below.
To use form views (e.g., Form Input or Form JSON) to parameterize tool values with data from a repository:
Notes:
Tip: Accessing Data Values from Custom ToolsWhen working with custom tools (i.e., tools added via the Extension Framework), you access values from a data repository column by manally entering the column name in the applicable tool text fields. For example, if you want to access the values in a key column called "loanAmount" in a Data Repository, you would enter |
To use Literal view to parameterize tool values with data from a repository:
Note that "ParasoftColumn" is applicable only for complex elements; simple elements are parameterized by accessing data source values using the {$} syntax.
For example, assume you have the following data repository data:
body: info: "some info about stuff" excludedSimple: "[parasoft_exclude]" optionalSimple: "[parasoft_null]" excluded: [] optional: null items: [ { item: [ { name: "bill", last: "mclaren", id: "12345"} { name: "steve", last: "smith", id: "45678" } ] } ] codes: [ { code: [ "abc", "efg", "hij" ] } ] |
Here is a JSON message that is parameterized to use that data:
{ "body" : { "ParasoftColumn" : "body", "info" : "${info}", "excludedSimple" : "${excludedSimple}", "optionalSimple" : "${optionalSimple}", "excluded" : { "ParasoftColumn" : "excluded", "excludedChild" : "${excludedChild}" }, "optional" : { "ParasoftColumn" : "optional", "optionalChild" : "${optionalChild}" }, "items" : [ "ParasoftColumn: items", { "ParasoftColumn" : "item", "name" : "${name}", "last" : "${last}", "id" : ${number:id} } ], "codes" : [ "ParasoftColumn: codes", "${code}" ] } } |
Once the parameterization is completed, the expected JSON message would look like this:
{ "body" : { "info" : "some info about stuff", "optionalSimple" : null, "optional" : null, "items" : [ { "name" : "bill", "last" : "mclaren", "id" : 12345 }, { "name" : "steve", "last" : "smith", "id" : 45678 } ], "codes" : [ "abc", "efg", "hij" ] } } |
Here is an XML message that is parameterized to use that data:
<root> <body ParasoftColumn="body"> <info>${info}</info> <excludedSimple>${excludedSimple}</excludedSimple> <optionalSimple>${optionalSimple}</optionalSimple> <excluded ParasoftColumn="excluded"> <excludedChild>${excludedChild}</excludedChild> </excluded> <optional ParasoftColumn="optional"> <optionalChild>${optionalChild}</optionalChild> </optional> <optional>${optional}</optional> <items customerAttr="val" ParasoftColumn="items"> <item ParasoftColumn="item"> <name>${name}</name> <last>${last}</last> <id>${id}</id> </item> </items> <codes ParasoftColumn="codes"> <code>${code}</code> </codes> </body> </root> |
Once the parameterization is completed, the expected XML message would look like this:
<root> <body> <info>some info about stuff</info> <optionalSimple xsi:nil="true"/> <optional xsi:nil="true"/> <items customerAttr="val"> <item> <name>bill</name> <last>mclaren</last> <id>12345</id> </item> <item> <name>steve</name> <last>smith</last> <id>45678</id> </item> </items> <codes> <code>abc</code> <code>efg</code> <code>hij</code> </codes> </body> </root> |