What is the SilkPerformer Java Framework and how does it work?
As a powerful extension to SilkPerformer"s Benchmark Description Language, the Java Framework enables you to implement Virtual User behaviour in Java. When testing an existing Java application you don"t 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 load test with the help of the Java framework, two source files are normally required:
- A Java class that implements the behaviour of a virtual user
- A SilkPerformer test script that invokes Java method calls
To create a Java Framework script choose
FILE | NEW | JAVA FRAMEWORK SCRIPT (.BDF/.JAVA).
Note that both source files need to have the same name, with an extension that indicates the file types, .BDF for the SilkPerformer script and .JAVA for the Java source file.
SilkPerformer can call Java functions on any Java object from a BDL script. 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.
Java based load tests are driven by BDL scripts. SilkPerformer"s Benchmark Description Language (BDL) implements a set of functions that enable you to:
- Set JVM options
- Load a JVM
- Load any Java classes
- Invoke methods on Java classes
The silk.performer package provides the SilkPerformer class, which enables the Java implementation to communicate with the runtime system. It implements a set of load testing methods that are also available in BDL. There is a Java Framework Developers Guide that ships with SilkPerformer. For detailed information on all Java Framework classes and methods, please refer to the Java Documentation.