Generating the Copybook JARRun the com.parasoft.soavirt.messages.copybook-<version>.jar file using the following command to build read the copybook files and generate the JAR file that you will integrate into the UI: Code Block |
---|
| java -jar <path to executable copybook.jar> -copybookinput <path to copybook directory> -filenames <filename1, filename2, etc.> -name <name> -apijar <path to com.parasoft.api.jar> |
The command uses the following arguments: -jar | Specify the Copybook extension from the Parasoft Marketplace |
---|
-copybookinput | Specify a copybook directory or a comma-separated list of copybook directories. If not a specified, the current directory will be used. The builder does not recurse sub-directories. Specify subdirectories as a separate entries and use quotation marks if the directories contain spaces or special characters. |
---|
-filenames | Specify a comma separated list of copybook files (wildcards allowed). |
---|
-name | Specifies the name of the copybook jar extension that the builder creates. This name will also be used as a UI label in Virtualize/SOAtest. If –name is not specified, the jar file will be named copybook.jar. |
---|
-apijar | Specify the absolute or relative path to the com.parasoft.api.jar file. This is required if you use the -name argument. For version 2020.1 and older, you can access this jar file at <INSTALL>/eclipse/plugins/com.parasoft.xtest.libs.web_<VERSION>/root/com.parasoft.api.jar. For version 2020.2 and newer, you can access this jar file at <INSTALL>/plugins/com.parasoft.ptest.libs.web_<VERSION>/root/com.parasoft.api.jar. |
---|
-log | Sets the log level for console messages. You can use DEBUG , INFO , WARN , or ERROR . |
---|
-preprocess | Tells the builder to stop execution after preprocessing is completed. |
---|
-help | Prints documentation. |
---|
Example Code Block |
---|
| java -jar parasoft_copybook_builder.jar -copybookinput "C:\My Projects\proj_a\cobol_src","C:\My Projects\proj_a\cobol_src\copy books" -filenames *.cbl,*.cpy -name Ps01CommArea -apijar com.parasoft.api.jar |
The example searches the following folders: - C:\My Projects\prog_a\cobol_src
- C:\My Projects\proj_a\cobol_src\copy books.
Any file that matches the wildcards *.cbl or *.cpy wil be processed as a copybook. When the Copybook tool finishes, there will be two files created in the directory: copybook.jar and velocity.log. Assuming there are no errors, velocity.log can be deleted. Integrate the copybook.jar file as described in Integrating the Copybook Extension. Integrating the Copybook ExtensionThe Copybook tool is implemented in the SOAtest and Virtualize UI as a system JAR file, which is output by executing the JAR in Generating the Copybook JAR. - Choose Parasoft> Preferences.
- Choose System Properties and remove any existing copybook.jar entries.
- Click Add JARs and browse to the copybook.jar file created after executing the JAR file in Generating the Copybook JAR.
- Click Open and apply the changes
- Restart SOAtest/Virtualize.
You can also install extensions from the command line by adding the copybook.jar file to the system.properties.classpath property in your localsettings settings properties file. For example: system.properties.classpath=<path to jar>/copybook1.jar
You also add the copybook.jar file to the VirtualAssets/system_jars folder (if this does not already exist, create it now). Make the following API call to reload the jar: Code Block |
---|
| http://<virtualize_server_host>:<virtualize_server_port>/soavirt/api/<version>/preferences/systemProperties/reload |
Using a Copybook in a ResponderYou can generate Copybook Responders and Copybook Clients from traffic, or you can add them manually. If you are adding them manually, be sure to select the desired copybook from the Message Type drop-down. Once a copybook is selected, the tree will be populated based on that copybook. This example demonstrates how to create a Virtualize responder from a copybook. - In the Virtualize perspective, choose Parasoft> Show View> Virtual Asset Explorer
- Right-click the VirtualAssets folder and choose Add New> Virtual Asset (.pva) File…
- Enter a file name and click Next.
- Choose Empty and click Finish. A new .pva file is created in the VirtualAssets folder.
- Right-click the Responder Suite under the new .pva and choose Add New> Responder.
- Choose CopyBook Message Responder and click Finish.
- Open the Copybook Message Responder you just created.
- All available copybooks are presented in the Message Type drop-down menu. Choose a copybook and the fields for the copybook will be displayed as responder fields.
|