This section describes the background information necessary to create custom Java filters. For task details, see How to Create a Custom Java Filter.
When recording a Java Record Replay script, the recorder selects which methods are recorded in the Vuser script and which are left out. VuGen uses hooking to filter the methods to include in the script. VuGen comes with built-in support for the RMI, CORBA, JMS and Jacada protocols. The built-in filters for RMI, CORBA, JMS, and JACADA protocols are designed to record only the server related traffic relevant to your testing goals. If your protocol is not supported, you can define your own custom hook file. Custom Java protocols, proprietary enhancements and extensions to the default protocols, and data abstraction all require a custom filter definition.
Note: If you are recording a script that does not use one of the supported protocols (RMI, CORBA, JMS, Jacada), you must define your own hook file. Otherwise, your Vuser script will be empty.
Creating a custom hook file demands planning and a good understanding of the protocols your application uses. When hooking is implemented correctly, the Vuser script should be well correlated and ready for compilation. For more details on how to select which methods and classes to hook, see Java Custom Filters - Determining which Elements to Include.
When you record a method, the methods which are called from the recorded method either directly or indirectly, are not recorded.
In order to record a method, VuGen must recognize the object upon which the method is invoked, along with the method's arguments. VuGen recognizes an object if it is returned by another recorded method provided that:
The construction method of that object is hooked.
It is a primitive or a built-in object.
It supports a serializable interface.
You can create a custom filter to exclude unwanted methods. When recording a Java application, your script may include calls to methods that do not affect the server, such as calls to a local utility or the GUI interface. These calls are usually not relevant to your testing goals, and it would be correct to filter them out.
Before creating a test, we recommend that you become familiar with your application and determine its primary classes and methods, so that you will know which ones to include in your recording.
If you are not familiar with your application's classes, VuGen allows you to record with a stack trace that logs all of the methods that were called by your application. In order to record with stack trace set the log level to Detailed.