* Finally, renamed ReferenceMark is inserted to a major text of text
* document as a text content.
*/
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) {
XInterface oObj = null;
XText oText = null;
String Name = "SwXReferenceMark";
log.println( "creating a test environment" );
oText = xTextDoc.getText();
XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, xTextDoc);
Object instance = null;
try {
oObj = (XInterface) oDocMSF.createInstance
("com.sun.star.text.ReferenceMark");
instance = (XInterface) oDocMSF.createInstance
("com.sun.star.text.ReferenceMark");
} catch ( com.sun.star.uno.Exception e ) {
e.printStackTrace( log );
throw new StatusException( "Couldn't get ReferenceMark", e);
}
XNamed oObjN = (XNamed) UnoRuntime.queryInterface(XNamed.class, oObj);
oObjN.setName(Name);
XTextContent oObjTC = (XTextContent)
UnoRuntime.queryInterface(XTextContent.class, oObj);
XTextCursor oCursor = oText.createTextCursor();
try {
oText.insertTextContent(oCursor, oObjTC, false);
} catch ( com.sun.star.lang.IllegalArgumentException e ){
e.printStackTrace( log );
throw new StatusException(" Couldn't insert ReferenceMark", e);
}