JUnitCallMethod Function

Action

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.

Include file

Java.bdh

Syntax

JUnitCallMethod(
  in hObject    : number,
  in sName      : string,
  in sTimerName : string optional): boolean;

Return value

  • true if the method call succeeded

  • false otherwise

Parameter Description
hObject Valid handle to a java object derived from junit.framework.TestCase.
sName Name of the method to invoke. JUnit comform methods always start with “test” prefix and do not have a return value.
sTimerName Optional. Creates a custom time measure with the specified name for this function.

Example

var
  ghTestObj : number;
 
dcltrans
  transaction TInit
  var
    hPerf : number;
  begin
    JavaCreateJavaVM();
    JavaSetString(JAVA_STATIC_METHOD, "myString");
    ghTestObj := JavaLoadObject("JUTestClass");
  end TInit;

  transaction TMain
  begin
    JUnitCallMethod(ghTestObj, "testTestCase");
  end TMain;

  transaction TEnd
  begin
    JavaFreeObject(ghTestObj);
  end TEnd;