}
public synchronized TestEnvironment createTestEnvironment(
TestParameters tParam, PrintWriter log ) throws StatusException {
XInterface oObj = null;
XFunctionProvider provider = null;
log.println("creating test environment");
try {
XMultiServiceFactory xMSF = tParam.getMSF();
SOfficeFactory SOF = null;
SOF = SOfficeFactory.getFactory( xMSF );
String docPath = util.utils.getFullTestURL(doc);
XComponent doc = SOF.loadDocument( docPath );
XModel model = ( XModel ) UnoRuntime.queryInterface( XModel.class,
doc );
oObj =
(XInterface)xMSF.createInstanceWithArguments( "drafts.com.sun.star.script.framework.provider.FunctionProvider", new Object[]{ model } );
provider = ( XFunctionProvider )UnoRuntime.queryInterface( XFunctionProvider.class, oObj );
oObj = provider.getFunction( script );
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace();
throw new StatusException("Can't create object environment", e) ;
}