As a powerful extension to Silk Performer’s Benchmark Description Language, the Java Framework enables you to implement user behavior in Java. When testing an existing Java application you do not need to spend much time creating test scripts. The only effort required is embedding existing Java source code into the framework.
To generate a benchmark executable and run a test with the help of the Java framework, two source files are normally required:
A Java class that implements the behavior of a virtual user
A Silk Performer test script that invokes Java method calls
Note: Both source files need to have the same name, with extensions indicating the file types (.bdf for the Silk Performer test script and .java for the Java source file).
With Silk Performer it is possible to call Java functions on any Java object from a BDL context with any number and type of parameter and return parameter. When a Java function returns a complex object, a handle for the Java object is returned in its place. The handle can be passed to other function calls as an input parameter, or public methods may be invoked on the object. There is also support for static methods, cast operations, and exception handling.
Silk Performer provides the following functions for invoking the methods of a Java class from within a test script: