...
Each virtual asset’s configuration panel contains a Transports> Transports > Custom tab, which can be customized to display a message listener implementation to meet your group’s specific needs.
Once the custom message listener implementation has been plugged in to into Virtualize, the virtualization framework can correlate and generate response messages. The actual delivery and reception of messages over the necessary protocol is handled by the message listener implementation.
Note that Parasoft Marketplace (accessible at marketplace.parasoft.com the customer portal or your organization’s CTP) provides examples for TCP/IP, FTP, and other fixed-length message types such as Equifax.
...
- A configuration (never null) that provides the transport implementation class with the values coming from the responder deployment configuration GUI.
- A handler, an implementation of
ImessageHandler
(never null) that can accept a request message and returns a response message.
...
The field ids under the section elements are used to retrieve values from the ICustomMessageListenerConfiguration
instance that is passed in to into the various API methods, and that allows for the values provided by the user to be passed in to into your implementation. They are also used to persist the user-provided values to the responder deployment descriptor file when it is saved. The field labels appear in the GUI that is constructed based on this XML. The section layout does not have a programmatic impact; it merely helps organize the various GUI fields into sections or categories for easy access and usability by the end user.
...
After building the project as described in General Procedure of Adding an Extension, restart Virtualize and verify that the custom listener name (as specified in parasoft-extension.xml) appears in the Transports> Transports > Custom tab of the Virtual Asset configuration panel (opened by double-clicking a virtual asset’s Virtualize Server node).
...
If multiple custom listeners are available, you can select the one you want to use from the Select Implementation box menu:
Examples
An example of a custom message listener implementation is available on GitHub. To use the listener, add the jar to the system preferences classpath list, then create a new pva file and configure a port for the listener on the Virtual Asset Deployment.
...
- The values provided to the extension GUI are saved as a name-value String map. As a result, rearranging the fields in the form element in parasoft-extension.xml will not affect how the user values are saved; however, changing the ids IDs will affect this. The ids IDs are used to save/load the values so they need to be unique. If you change them, then previously - saved configurations will configurations will not load the previous values and will become empty. However, you can use a version updater to migrate old settings saved with old ids IDs to a new set of idsIDs.
- Only GUI fields with string values are supported in the custom form GUI. If your extension requires integers or other types, then you may convert the string content to the desired type in the extension implementation.
If you want a GUI field to serve as a password field (with inputs masked and the specified password saved securely), give that field element a password attribute that is set to true. For example, the following sets the pwd field to password mode:
Code Block <form xmlns="urn:com/parasoft/extensibility-framework/gui"> <section label="Main Settings"> <field id="usr" label="Username"/> <field id="pwd" label="Password" password="true"/> </section> </form>
- Tables or lists can be implemented as comma-separated values in the string fields.
- To provide visibility into events and errors related to this custom listener, you can call logging from ApplicationContext (in the Extensibility API). Events can be categorized as INFO, ERROR, WARN, and DEBUG—categories DEBUG, categories which can be used as filter criteria in the SOAtest Event Monitor. We recommend that you invoke the method reportEvent(String message, String type) directly on the context that is passed in because that will automatically populate the source of the event (i.ethat is, which responder and PVA it is coming from).