Executing a JUnit Test Suite

When JUnit Import Tool ( Project > Import Unit Test > JUnit Test Class ) script code is used to invoke a method that has a return value, the code used to retrieve the return value is scripted, but commented out.

If a Java method returns a junit.framework.Test method, additional commented-out code is scripted, which allows the FRunTestSuite function from junit.bdh to execute the test suite. junit.bdh is automatically added to the include section of the BDL script.

Uncomment the code for retrieving the return value. For example:
transaction TMain
begin
  // junit.framework.Test suite() 
  JavaCallMethod(JAVA_STATIC_METHOD, "JU4ImporterTestSimple.suite", "suite");
  // hObj := JavaGetObject(JAVA_STATIC_METHOD); 
  // use the following function to execute JUnit test suites 
  // FRunTestSuite(hObj);
  // JavaFreeObject(hObj); 
end TMain;