JUnitLoadClass Function

Action

Instantiates a Java object and returns a handle of the runtime class. The Java runtime class can be released by using the JavaFreeObject function.

Include file

Java.bdh

Syntax

JUnitLoadClass( in sClassSpecifier : string ): number;

Return value

  • Handle of the Java object class.
Parameter Description
sClassSpecifier Fully qualified name of the class to instantiate. The class must be available through the classpath. Use the / character as package separator.

For example: java/lang/String

Example

var
  hTestClass : number;

dcltrans
  transaction TInit
  begin
      // Load and start the JVM.
      JavaCreateJavaVM();

      // instantiate the java class
      hTestClass := JUnitLoadClass("com/microfocus/Test");
  end TInit;

  transaction THello
  begin
    JUnitExecuteTest(hTestClass, "doHello", "doHello_timer");
  end THello;

  transaction TEnd
  begin
    JavaFreeObject(hTestClass);
  end TEnd;