The File Event Listener monitors a specified directory on the local system. If it detects new, modified, or deleted files in that directory, it triggers a response from the associated virtual asset. This listener is commonly used in conjunction with the Data Learning tool (also available on the Parasoft Marketplace) so that when a new or modified traffic file is detected, any new data captured in that file is automatically added to Data Repository.
This listener requires Virtualize 9.9.0 or later.
The listener can be installed from the UI or the command line.
Add the fileEventListener.jar file to the system.properties.classpath
property in your settings properties file. For example:
system.properties.classpath=<PATH_TO_JAR>/fileEventListener.jar
Once the File Event Listener is installed, it will be available in the Transports > Custom tab of the Virtual Asset configuration panel. You can open this panel 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 menu:
The following configuration options are available.
Local Directory to Monitor | Specify the directory you want to monitor for new, updated, or deleted files. You can enter an absolute path or a path relative to the |
---|---|
Poll Interval | Specify how frequently you want to check the specified directory. The default is |
Log Level | Specify how much information you want logged to the console and the Event Monitoring view. The default is |
You can use the File Event Listener and Data Learning tool in concert so that any new data captured in traffic files is automatically added to a designated Data Repository.
(Optional) By default, the Data Learning tool will execute any time that a file is added, modified, or deleted. If you want it to execute only in one of these cases, configure the responder's Request Body correlation accordingly. For example, the following responder is configured to respond only when the File Event Listener detects a new file in the specified directory.
The listener can trigger three types of events: fileCreate
, fileDelete
, fileModify
. The following example shows how these events are formatted:
<fileeventlistenerEvents> <fileCreate>path_to_new_file</fileCreate> <fileDelete>path_to_deleted_file</fileDelete> ... </fileeventlistenerEvents> |
For a detailed use case of how to use the File Listener along with the Data Learning tool, see the Data Learning Tool documentation, which explains how to set up an environment that achieves the following objective: If a virtual asset doesn't know how to respond to a given request, record that request (and its corresponding response from the live service) and add this data to the Data Repository. The next time the virtual asset receives that same request, the appropriate response will be returned. |
This extension does not include any items that have been sourced from third parties. Additional license details are available in this plugin's licenses folder.