Silk Performer provides the following functions for invoking the methods of a Java class from within a test script:
- JavaSetOption: Sets options for the Java Virtual Machine.
- JavaCreateJavaVM:
Initializes and starts the Java Virtual Machine (JVM).
- JavaLoadObject: Instantiates a Java object and returns a handle on it.
- JavaLoadString: Instantiates a Java string object and returns a handle on it.
- JavaCallMethod: Invokes either a dynamic or a static Java method.
- JavaFreeObject: Frees a Java object.
- JavaCastObject: Casts an object to a type of your choice.
- JavaGetBoolean: Retrieves the Boolean return value.
- JavaGetFloat: Retrieves the float return value.
- JavaGetNumber: Retrieves the int return value.
- JavaGetObject: Retrieves a handle on the object returned by the last call of
JavaCallMethod on the specified object or class.
- JavaGetString:
Retrieves the string return value
- JavaGetUserObject: Returns the handle on the
JavaUser object loaded by
JavaUserInit command.
- JavaSetChar: Sets a char parameter for the next function or constructor call.
- JavaGetChar: Retrieves the ordinal number of the char return value.
- JavaSetBoolean: Sets a Boolean parameter for the next function or constructor call.
- JavaSetFloat: Sets a float parameter for the next function or constructor call.
- JavaSetNumber:
Sets a numeric parameter for the next function or constructor call.
- JavaSetObject:
Sets an object parameter for the next function or constructor call.
- JavaSetString: Sets a string parameter for the next function or constructor call.
- JavaSetByteArray: Convenience function derived from
JavaSetString function.
- JavaSetCharArray:
Convenience function derived from
JavaSetString function.
- JavaRegisterException: Registers a Java exception string under a custom error number.
- JavaUnregisterErrorNumber: Unregisters an exception message.
- JavaGetLastException: Retrieves the last exception message.
Convenience function to call JUnit test methods:
- JUnitCallMethod: Invokes a JUnit conform method of a class derived from
junit.framework.TestCase. Prepares the method execution by invoking the
setUp() method and finishes the test by invoking the
tearDown() method.
Deprecated Java Framework functions:
- JavaUserInit: Calls the
JavaUserInit method of the Java class that implements the behavior of the virtual user.
- JavaUserRun: Calls the
JavaUserRun method of the Java class that implements the behavior of the virtual user.
- JavaUserMethod:
Calls an additional method of the Java class that implements the behavior of the virtual user.
- JavaUserShutdown: Calls the
JavaUserShutdown method of the Java class that implements the behavior of the virtual user.