/** * creating a TestEnvironment for the interfaces to be tested * * @param tParam class which contains additional test parameters * @param log class to log the test state and result * @return Status class * @see TestParameters * @see PrintWriter */ @Override protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { XInterface oObj = null; // create testobject here XEnumerationAccess xEA = null; try { SOfficeFactory SOF = SOfficeFactory.getFactory(tParam.getMSF()); XShape oShape = SOF.createShape(xDrawDoc, 5000, 3500, 7500, 5000, "Text"); DrawTools.getShapes(DrawTools.getDrawPage(xDrawDoc, 0)).add(oShape); XSimpleText text = UnoRuntime.queryInterface(XSimpleText.class, oShape); XTextCursor cursor = text.createTextCursor(); text.insertString(cursor, "Paragraph 1", false); text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false); text.insertString(cursor, "Paragraph 2", false); text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false); text.insertString(cursor, "Paragraph 3", false); text.insertControlCharacter(cursor, ControlCharacter.PARAGRAPH_BREAK, false); xEA = UnoRuntime.queryInterface(XEnumerationAccess.class, text); XInterface oTextContent = (XInterface) AnyConverter.toObject( new Type(XInterface.class), xEA.createEnumeration().nextElement()); xEA = UnoRuntime.queryInterface(XEnumerationAccess.class, oTextContent); oObj = xEA.createEnumeration(); } catch (Exception e) { log.println("Can't create test object"); e.printStackTrace(log); } // create test environment here TestEnvironment tEnv = new TestEnvironment(oObj); tEnv.addObjRelation("ENUM", xEA); return tEnv; } // finish method getTestEnvironment