/** Disposes Spreadsheet document. */ @Override protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xSheetDoc "); XComponent oComp = UnoRuntime.queryInterface(XComponent.class, xSheetDoc); util.DesktopTools.closeDoc(oComp); }
/** Close document */ @Override protected void cleanup(TestParameters tParam, PrintWriter log) { if (xChartDoc != null) { log.println(" closing xChartDoc"); util.DesktopTools.closeDoc(xChartDoc); xChartDoc = null; } }
/** Removes added element from AutoTextGroup */ protected void cleanup(TestParameters Param, PrintWriter log) { try { if (oGroup.hasByName("NewEntryName")) { log.println("Removing 'NewEntryName' element"); oGroup.removeByName("NewEntryName"); } } catch (com.sun.star.container.NoSuchElementException e) { log.println("Cannot remove TextEntry from group..."); e.printStackTrace(log); } log.println("disposing xTextDoc "); util.DesktopTools.closeDoc(xTextDoc); }
public void testDoc(String fileName) throws Exception { XComponent xDoc = null; EventListener xListener = new EventListener(); try { m_xGEB.addDocumentEventListener(xListener); System.out.println("Loading document: " + fileName + " ..."); PropertyValue[] loadProps = new PropertyValue[1]; loadProps[0] = new PropertyValue(); loadProps[0].Name = "ReadOnly"; loadProps[0].Value = new Boolean(true); String sourceFile = m_fileURL + m_SourceDir + fileName; xDoc = util.DesktopTools.loadDoc(m_xMSF, sourceFile, loadProps); System.out.println("... done"); { // apparently OnLayoutFinished is not sent for every doc??? // 10 seconds is evidently not enough for large documents int time = 0; while (!xListener.IsLayoutFinished() && (time < 30000)) { Thread.sleep(100); time += 100; } if (time >= 30000) { System.out.println("timeout: no OnLayoutFinished received"); } } System.out.println("Storing document: " + fileName + " ..."); XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xDoc); String targetFile = m_fileURL + m_TargetDir + fileName; xStor.storeToURL(targetFile, new PropertyValue[0]); System.out.println("... done"); } finally { if (xDoc != null) { util.DesktopTools.closeDoc(xDoc); } if (xListener != null) { m_xGEB.removeDocumentEventListener(xListener); } } }
/** Spreadsheet document destroyed. */ protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing document "); util.DesktopTools.closeDoc(comp); }
@After public void tearDownDocuments() { util.DesktopTools.closeDoc(m_xDoc); util.DesktopTools.closeDoc(m_xOdfReloadedDoc); // util.DesktopTools.closeDoc(m_xMsWordReloadedDoc); }
/** Disposes text document. */ @Override protected void cleanup(TestParameters tParam, PrintWriter log) { log.println(" disposing xTextDoc "); util.DesktopTools.closeDoc(xTextDoc); }
/** * Called while disposing a <code>TestEnvironment</code>. Disposes text document. * * @param Param test parameters * @param log writer to log information while testing */ protected void cleanup(TestParameters Param, PrintWriter log) { log.println("dispose text document"); util.DesktopTools.closeDoc(xTextDoc); }