*/
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
XInterface oTS = null;
XTextSection xTS = null;
XText oText = null;
XTextColumns TC = null;
Object instance = null;
log.println( "creating a test environment" );
oText = xTextDoc.getText();
XTextCursor oCursor = oText.createTextCursor();
XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
try {
XTextSectionsSupplier oTSSupp = (XTextSectionsSupplier)
UnoRuntime.queryInterface
( XTextSectionsSupplier.class, xTextDoc );
XNameAccess oTSSuppName = oTSSupp.getTextSections();
//cleanup if necessary
if (oTSSuppName.hasByName("SwXTextSection")) {
XTextSection old = (XTextSection) AnyConverter.toObject(
new Type(XTextSection.class),
oTSSuppName.getByName("SwXTextSection"));
XComponent oldC = (XComponent)
UnoRuntime.queryInterface(XComponent.class,old);
oldC.dispose();