diff options
author | Noel Grandin <noel@peralex.com> | 2015-06-09 13:27:06 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-06-11 06:47:23 +0000 |
commit | 754ade38ddb2e96187d00f3e621203cea34961fa (patch) | |
tree | 52bd945487d1a9ce850cba1d091d4f403da0481d | |
parent | c82c94b40157c08bbbc524b2dc02714cbe82dc65 (diff) |
speed up Java unit tests by removing sleeps
and replacing them with a call to XToolkitExperimental::
processEventsToIdle
Change-Id: I9fd6cb8af43d902587186310aebe78b5a5ee6932
Reviewed-on: https://gerrit.libreoffice.org/16201
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
121 files changed, 373 insertions, 418 deletions
diff --git a/framework/qa/complex/XUserInputInterception/EventTest.java b/framework/qa/complex/XUserInputInterception/EventTest.java index 86c0051d1f7d..fc92beb9a63b 100644 --- a/framework/qa/complex/XUserInputInterception/EventTest.java +++ b/framework/qa/complex/XUserInputInterception/EventTest.java @@ -267,7 +267,7 @@ public class EventTest { et.run(); - util.utils.pause(m_threadWait); + util.utils.waitForEventIdle(getMSF()); System.out.println("key listener thread should be finished."); assertTrue("key event does not work!", m_keyPressed && m_keyReleased); @@ -300,7 +300,7 @@ public class EventTest { et.run(); - util.utils.pause(m_threadWait); + util.utils.waitForEventIdle(getMSF()); System.out.println("mouse listener thread should be finished."); assertTrue("mouse event does not work!", m_mousePressed && m_mouseReleased); diff --git a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java index 6516d27d7f4c..6b3317dc79b1 100644 --- a/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java +++ b/framework/qa/complex/contextMenuInterceptor/CheckContextMenuInterceptor.java @@ -46,7 +46,6 @@ import util.AccessibilityTools; import util.DesktopTools; import util.DrawTools; import util.SOfficeFactory; -import util.utils; import org.openoffice.test.OfficeFileUrl; // ---------- junit imports ----------------- @@ -121,7 +120,7 @@ public class CheckContextMenuInterceptor xFrame = xModel.getCurrentController().getFrame(); // ensure that the document content is optimal visible - DesktopTools.zoomToEntirePage(xDrawDoc); + DesktopTools.zoomToEntirePage(xMSF, xDrawDoc); XBitmap xBitmap = null; @@ -278,8 +277,7 @@ public class CheckContextMenuInterceptor System.out.println("couldn't press mouse button"); } - utils.pause(3000); - + util.utils.waitForEventIdle(getMSF()); } private XMultiServiceFactory getMSF() diff --git a/qadevOOo/runner/lib/MultiMethodTest.java b/qadevOOo/runner/lib/MultiMethodTest.java index e7bf886c3223..ab2dd9630940 100644 --- a/qadevOOo/runner/lib/MultiMethodTest.java +++ b/qadevOOo/runner/lib/MultiMethodTest.java @@ -64,6 +64,7 @@ import com.sun.star.uno.UnoRuntime; * * @see TestResult */ +@SuppressWarnings("unused") public class MultiMethodTest { @@ -465,4 +466,9 @@ public class MultiMethodTest { this.getClass().getField(fieldName).set(this, value); } + + protected final void waitForEventIdle() { + util.utils.waitForEventIdle(tParam.getMSF()); + } + } diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index 1f6f6cfeedbc..00b7fc5ce4f7 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -389,7 +389,7 @@ public class DesktopTools * zoom to have a view over the hole page * @param xDoc the document to zoom */ - public static void zoomToEntirePage(XInterface xDoc) + public static void zoomToEntirePage(XMultiServiceFactory xMSF, XInterface xDoc) { try { @@ -402,7 +402,7 @@ public class DesktopTools oViewProp.setPropertyValue("ZoomType", Short.valueOf(com.sun.star.view.DocumentZoomType.ENTIRE_PAGE)); - utils.pause(5000); + util.utils.waitForEventIdle(xMSF); } catch (Exception e) { diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 4a77e41e2331..a584b70d1d2c 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -22,6 +22,7 @@ import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XModel; import com.sun.star.lang.XComponent; + import java.util.StringTokenizer; import java.io.*; import java.util.ArrayList; @@ -30,6 +31,7 @@ import java.net.ServerSocket; import java.net.URI; import java.net.URISyntaxException; +import com.sun.star.awt.XToolkitExperimental; import com.sun.star.beans.XPropertySet; import com.sun.star.beans.Property; import com.sun.star.lang.XMultiServiceFactory; @@ -37,17 +39,15 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.ucb.InteractiveAugmentedIOException; import com.sun.star.ucb.XSimpleFileAccess; import com.sun.star.lang.XServiceInfo; - import com.sun.star.util.URL; import com.sun.star.util.XURLTransformer; - import com.sun.star.uno.AnyConverter; import com.sun.star.uno.Type; import com.sun.star.uno.XComponentContext; import com.sun.star.util.XMacroExpander; + import java.text.DecimalFormat; import java.util.Calendar; - import java.util.Collections; import java.util.GregorianCalendar; @@ -661,6 +661,17 @@ public class utils { } } + public static void waitForEventIdle(XMultiServiceFactory xMSF) { + try { + XToolkitExperimental xToolkit = UnoRuntime.queryInterface( + XToolkitExperimental.class, + xMSF.createInstance("com.sun.star.awt.Toolkit")); + xToolkit.processEventsToIdle(); + } catch (com.sun.star.uno.Exception ex) { + throw new RuntimeException(ex); + } + } + /** * Validate the AppExecutionCommand. Returned is an error message, starting * with "Error:", or a warning, if the command might work. @@ -832,7 +843,7 @@ public class utils { XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0); xDispatcher.dispatch(aURL, null); - utils.pause(3000); + waitForEventIdle(xMSF); } catch (Exception e) { throw new Exception("ERROR: could not dispatch URL '" + URL + "'", e); diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java index 3002dbe8ced4..a5d0740deed8 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java @@ -114,7 +114,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { log.println("fire event"); prod.fireEvent() ; - util.utils.pause(3000); + waitForEventIdle(); boolean works = true; @@ -148,7 +148,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { * <li> <code>addEventListener()</code> : to have added listeners </li> * </ul> */ - public void _removeEventListener() { + public void _removeEventListener() throws Exception { requiredMethod("addEventListener()"); list.notifiedEvent = null; @@ -159,7 +159,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { log.println("fire event"); prod.fireEvent() ; - util.utils.shortWait(); + waitForEventIdle(); if (list.notifiedEvent == null) { log.println("listener wasn't called -- OK"); diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java index fdb7d2fb8c89..d7e84b74a3b7 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java @@ -167,7 +167,7 @@ public class _XAccessibleSelection extends MultiMethodTest { * Has OK status if exception was thrown for wrong index and * if exception wasn't thrown for the correct index. */ - public void _isAccessibleChildSelected() { + public void _isAccessibleChildSelected() throws Exception { executeMethod("selectAccessibleChild()"); boolean res = true; @@ -212,7 +212,7 @@ public class _XAccessibleSelection extends MultiMethodTest { if (isSelectable(tEnv.getTestObject(), k)) { oObj.selectAccessibleChild(k); - util.utils.shortWait(); + waitForEventIdle(); isSelected = oObj.isAccessibleChildSelected(k); log.println("isAccessibleChildSelected - " + isSelected); @@ -236,7 +236,7 @@ public class _XAccessibleSelection extends MultiMethodTest { * Has OK status if the method <code>isAccessibleChildSelected()</code> * returned <code>false</code>. */ - public void _clearAccessibleSelection() { + public void _clearAccessibleSelection() throws Exception { executeMethod("isAccessibleChildSelected()"); boolean res = true; @@ -247,7 +247,7 @@ public class _XAccessibleSelection extends MultiMethodTest { // clearAccessibleSelection() call is oneway so we need // some waiting - util.utils.shortWait(); + waitForEventIdle(); if ((childCount > 0) && !OneAlwaysSelected) { try { @@ -284,7 +284,7 @@ public class _XAccessibleSelection extends MultiMethodTest { // selectAllAccessibleChildren() call is oneway so we need // some waiting - util.utils.shortWait(); + waitForEventIdle(); boolean res = true; boolean isSelected = true; @@ -394,7 +394,7 @@ public class _XAccessibleSelection extends MultiMethodTest { * if exception wasn't thrown for the correct index and * if the method have returned a not null for the correct index. */ - public void _getSelectedAccessibleChild() { + public void _getSelectedAccessibleChild() throws Exception { executeMethod("getSelectedAccessibleChildCount()"); boolean res = true; @@ -435,7 +435,7 @@ public class _XAccessibleSelection extends MultiMethodTest { if (isSelectable(tEnv.getTestObject(), k)) { oObj.selectAccessibleChild(k); - util.utils.shortWait(); + waitForEventIdle(); log.println("selected child count: " + oObj.getSelectedAccessibleChildCount()); XAccessible selChild = oObj.getSelectedAccessibleChild(0); diff --git a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java index b61bb04a3749..b18253b4082e 100644 --- a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java +++ b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java @@ -144,7 +144,7 @@ public class _XImageProducer extends MultiMethodTest { oObj.startProduction() ; - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("startProduction()", consumer.initCalled) ; } diff --git a/qadevOOo/tests/java/ifc/awt/_XItemListener.java b/qadevOOo/tests/java/ifc/awt/_XItemListener.java index 9e0527b5288e..3751e65744d3 100644 --- a/qadevOOo/tests/java/ifc/awt/_XItemListener.java +++ b/qadevOOo/tests/java/ifc/awt/_XItemListener.java @@ -95,7 +95,7 @@ public class _XItemListener extends MultiMethodTest { event.Highlighted = 2 ; oObj.itemStateChanged(event) ; - util.utils.pause(200); + waitForEventIdle(); result = itemListener.itemStateChangedCalled && itemListener.event.Selected == 1 && diff --git a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java index b1900464749a..a23f83d7dc67 100644 --- a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java +++ b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java @@ -117,7 +117,7 @@ public class _XRadioButton extends MultiMethodTest { boolean result = true ; oObj.setState(!state) ; - util.utils.pause(200); + waitForEventIdle(); result = oObj.getState() == !state ; diff --git a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java index 9c78eec7ff9b..78b4224a6021 100644 --- a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java +++ b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java @@ -36,10 +36,10 @@ public class _XScrollBar extends MultiMethodTest { public boolean adjusted = false; com.sun.star.awt.XAdjustmentListener listener = new AdjustmentListener(); - public void _addAdjustmentListener() { + public void _addAdjustmentListener() throws Exception { util.FormTools.switchDesignOf(tParam.getMSF(), (XTextDocument) tEnv.getObjRelation("Document")); - util.utils.shortWait(); + waitForEventIdle(); oObj.addAdjustmentListener(listener); adjustScrollBar(); @@ -167,7 +167,7 @@ public class _XScrollBar extends MultiMethodTest { sc.setValue(500); - util.utils.shortWait(); + waitForEventIdle(); XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); @@ -186,7 +186,7 @@ public class _XScrollBar extends MultiMethodTest { System.out.println("couldn't adjust scrollbar"); } - util.utils.shortWait(); + waitForEventIdle(); } public class AdjustmentListener diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinField.java b/qadevOOo/tests/java/ifc/awt/_XSpinField.java index d6a9b3a9b59f..e30c320719f1 100644 --- a/qadevOOo/tests/java/ifc/awt/_XSpinField.java +++ b/qadevOOo/tests/java/ifc/awt/_XSpinField.java @@ -94,7 +94,7 @@ public class _XSpinField extends MultiMethodTest { requiredMethod("addSpinListener()") ; oObj.up() ; - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("up()", listener.upFl) ; } @@ -108,11 +108,11 @@ public class _XSpinField extends MultiMethodTest { * <li> <code> addSpinListener </code> </li> * </ul> */ - public void _down() { + public void _down() throws Exception { requiredMethod("addSpinListener()") ; oObj.down() ; - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("down()", listener.downFl) ; } @@ -126,11 +126,11 @@ public class _XSpinField extends MultiMethodTest { * <li> <code> addSpinListener </code> </li> * </ul> */ - public void _first() { + public void _first() throws Exception { requiredMethod("addSpinListener()") ; - oObj.first() ; - util.utils.shortWait(); + oObj.first(); + waitForEventIdle(); tRes.tested("first()", listener.firstFl) ; } @@ -144,11 +144,11 @@ public class _XSpinField extends MultiMethodTest { * <li> <code> addSpinListener </code> </li> * </ul> */ - public void _last() { + public void _last() throws Exception { requiredMethod("addSpinListener()") ; - oObj.last() ; - util.utils.shortWait(); + oObj.last(); + waitForEventIdle(); tRes.tested("last()", listener.lastFl) ; } diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java index ebf5aa75182a..c3404c0a1637 100644 --- a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java +++ b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java @@ -35,10 +35,10 @@ public class _XSpinValue extends MultiMethodTest { public boolean adjusted = false; com.sun.star.awt.XAdjustmentListener listener = new AdjustmentListener(); - public void _addAdjustmentListener() { + public void _addAdjustmentListener() throws Exception { util.FormTools.switchDesignOf(tParam.getMSF(), (XTextDocument) tEnv.getObjRelation("Document")); - util.utils.shortWait(); + waitForEventIdle(); oObj.addAdjustmentListener(listener); adjustScrollBar(); @@ -158,7 +158,7 @@ public class _XSpinValue extends MultiMethodTest { sv.setValue(500); - util.utils.shortWait(); + waitForEventIdle(); XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); @@ -177,7 +177,7 @@ public class _XSpinValue extends MultiMethodTest { System.out.println("couldn't adjust scrollbar"); } - util.utils.shortWait(); + waitForEventIdle(); } public class AdjustmentListener diff --git a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java index c1a73b656ff3..27ea6680daaf 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java +++ b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java @@ -87,10 +87,10 @@ public class _XTextComponent extends MultiMethodTest { * to the object.<p> * Has <b> OK </b> status if listener was called. */ - public void _addTextListener(){ + public void _addTextListener() throws Exception { oObj.addTextListener(listener); oObj.setText("Listen"); - util.utils.shortWait(); + waitForEventIdle(); if (!textChanged) { log.println("Listener wasn't called after changing Text"); } diff --git a/qadevOOo/tests/java/ifc/awt/_XTextListener.java b/qadevOOo/tests/java/ifc/awt/_XTextListener.java index 3a3120802ba3..2d57e349caea 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTextListener.java +++ b/qadevOOo/tests/java/ifc/awt/_XTextListener.java @@ -98,7 +98,7 @@ public class _XTextListener extends MultiMethodTest { event.dummy1 = 2; oObj.textChanged(event); - util.utils.pause(200); + waitForEventIdle(); result = textListener.textChangedCalled && textListener.event.dummy1 == 2; diff --git a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java index 22da48aabd52..56f0a5aa2a29 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java +++ b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java @@ -140,7 +140,7 @@ public class _XTopWindow extends MultiMethodTest { requiredMethod("addTopWindowListener()"); listener.initListener(); oObj.toFront(); - util.utils.pause(1000); + waitForEventIdle(); tRes.tested("toFront()", listener.activated && !listener.deactivated); } diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java index 58ccffa3d2df..e06959d02c50 100644 --- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java +++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java @@ -39,7 +39,6 @@ import java.awt.event.InputEvent; import lib.MultiMethodTest; import util.AccessibilityTools; -import util.utils; /** * Testing <code>com.sun.star.awt.XUserInputInterception</code> @@ -151,7 +150,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2); + waitForEventIdle(); log.println("key listener thread should be finished."); @@ -214,7 +213,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2); + waitForEventIdle(); log.println("mouse listener thread should be finished."); boolean bOK = m_mousePressed1 & m_mouseReleased1 & diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java index 0b7a406badf1..8ec136ba2ced 100644 --- a/qadevOOo/tests/java/ifc/awt/_XWindow.java +++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java @@ -242,7 +242,7 @@ public class _XWindow extends MultiMethodTest { oObj.setPosSize(0, 0, 100, 100, PosSize.WIDTH); } - util.utils.pause(200); + waitForEventIdle(); boolean res = wListener.resized && wListener.moved && !wListener.hidden && !wListener.shown; result &= res; @@ -257,10 +257,10 @@ public class _XWindow extends MultiMethodTest { // testing wListener.windowHidden() wListener.init(); - util.utils.pause(200); + waitForEventIdle(); log.println("set object invisible..."); oObj.setVisible(false); - util.utils.pause(200); + waitForEventIdle(); res = wListener.hidden && !wListener.resized && !wListener.moved && !wListener.shown; result &= res; @@ -275,10 +275,10 @@ public class _XWindow extends MultiMethodTest { // testing wListener.windowShown() wListener.init() ; - util.utils.pause(200); + waitForEventIdle(); log.println("set object visible..."); oObj.setVisible(true) ; - util.utils.pause(200); + waitForEventIdle(); res = wListener.shown && !wListener.resized && !wListener.hidden && !wListener.moved; result &= res; @@ -361,9 +361,9 @@ public class _XWindow extends MultiMethodTest { // testing fListener.lost() oObj.setFocus(); - util.utils.pause(200); + waitForEventIdle(); win.setFocus(); - util.utils.pause(200); + waitForEventIdle(); result &= fListener.lost; if (!fListener.lost) { log.println("Lost focus was not notified about") ; @@ -371,7 +371,7 @@ public class _XWindow extends MultiMethodTest { // testing fListener.gained() oObj.setFocus() ; - util.utils.pause(200); + waitForEventIdle(); result &= fListener.gained; if (!fListener.gained) { log.println("Gained focus was not notified about") ; diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java index 50508ce8c9b6..24c6ab4ba065 100644 --- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java @@ -197,7 +197,7 @@ public class _XMultiPropertySet extends MultiMethodTest { e.printStackTrace(log); } // end of try-catch } - util.utils.pause(200); + waitForEventIdle(); tRes.tested("addPropertiesChangeListener()", propertiesChanged); } @@ -216,7 +216,7 @@ public class _XMultiPropertySet extends MultiMethodTest { propertiesChanged = false ; oObj.firePropertiesChangeEvent(testPropsNames, PClistener); - util.utils.pause(200); + waitForEventIdle(); tRes.tested("firePropertiesChangeEvent()", propertiesChanged); } diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java index 78b8d79140ec..d2302e679df7 100644 --- a/qadevOOo/tests/java/ifc/container/_XContainer.java +++ b/qadevOOo/tests/java/ifc/container/_XContainer.java @@ -254,10 +254,10 @@ public class _XContainer extends MultiMethodTest { protected boolean performChanges2() { int precount = CC.getControls().length; CC.addControl("NewControl",(XControl) inst); - util.utils.pause(1000); + waitForEventIdle(); int count = CC.getControls().length; CC.removeControl(CC.getControl("NewControl")); - util.utils.pause(1000); + waitForEventIdle(); return count>precount; } diff --git a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java index 99e3d609a74e..daafe8226315 100644 --- a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java +++ b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java @@ -75,7 +75,7 @@ public class _XIndexAccess extends MultiMethodTest { requiredMethod("getCount()"); // get count from holder - util.utils.pause(200); + waitForEventIdle(); boolean result = true; log.println("Testing getByIndex()"); diff --git a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java index 12e54b665a70..cc30c7ebb1a5 100644 --- a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java +++ b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java @@ -48,7 +48,7 @@ public class _XEventBroadcaster extends MultiMethodTest { XModel docModel = UnoRuntime.queryInterface( XModel.class,tEnv.getTestObject()); docModel.getCurrentController().getFrame().getContainerWindow().setFocus(); - util.utils.pause(1000); + waitForEventIdle(); XController xc = UnoRuntime.queryInterface(XController.class,tEnv.getObjRelation("CONT2")); xc.getFrame().getContainerWindow().setFocus(); } @@ -58,7 +58,7 @@ public class _XEventBroadcaster extends MultiMethodTest { listenerCalled = false; oObj.addEventListener(listener); switchFocus(); - util.utils.pause(1000); + waitForEventIdle(); tRes.tested("addEventListener()",listenerCalled); } @@ -67,7 +67,7 @@ public class _XEventBroadcaster extends MultiMethodTest { listenerCalled = false; oObj.removeEventListener(listener); switchFocus(); - util.utils.pause(1000); + waitForEventIdle(); tRes.tested("removeEventListener()",!listenerCalled); } diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java index 5f93420c1362..11c648f15a8b 100644 --- a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java +++ b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java @@ -124,13 +124,13 @@ public class _XChangeBroadcaster extends MultiMethodTest { win1.setFocus(); changeContent() ; - util.utils.pause(2000); + waitForEventIdle(); win2.setFocus(); XTextComponent TC = UnoRuntime.queryInterface (XTextComponent.class,tEnv.getObjRelation("CONTROL")); TC.setText("NOXChangeBroadcaster"); - util.utils.pause(2000); + waitForEventIdle(); tRes.tested("addChangeListener()", changed); } @@ -156,7 +156,7 @@ public class _XChangeBroadcaster extends MultiMethodTest { changeContent() ; win2.setFocus(); - util.utils.pause(2000); + waitForEventIdle(); tRes.tested("removeChangeListener()", !changed); } diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java index 7e5c11f68d70..8ae4aa4af495 100644 --- a/qadevOOo/tests/java/ifc/form/_XFormController.java +++ b/qadevOOo/tests/java/ifc/form/_XFormController.java @@ -87,10 +87,10 @@ public class _XFormController extends MultiMethodTest { XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl); wind.setFocus(); - util.utils.pause(1000); + waitForEventIdle(); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); otherWind.setFocus(); - util.utils.pause(1000); + waitForEventIdle(); log.println("activated = " + listener.activated + ", deactivated = " + listener.deactivated) ; @@ -112,10 +112,10 @@ public class _XFormController extends MultiMethodTest { XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl); wind.setFocus(); - util.utils.pause(1000); + waitForEventIdle(); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); otherWind.setFocus(); - util.utils.pause(1000); + waitForEventIdle(); log.println("activated = " + listener.activated + ", deactivated = " + listener.deactivated) ; diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java index da8f57bb140e..9ef20e4cd1ef 100644 --- a/qadevOOo/tests/java/ifc/form/_XLoadable.java +++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java @@ -117,7 +117,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.load() ; - util.utils.pause(100); + waitForEventIdle(); result = oObj.isLoaded() && loadListener.loadedCalled ; tRes.tested("load()", result) ; @@ -142,7 +142,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.unload() ; - util.utils.pause(100); + waitForEventIdle(); result = !oObj.isLoaded() && loadListener.unloadedCalled ; tRes.tested("unload()", result) ; @@ -167,7 +167,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.reload() ; - util.utils.pause(100); + waitForEventIdle(); result = oObj.isLoaded() && loadListener.reloadedCalled; tRes.tested("reload()", result) ; diff --git a/qadevOOo/tests/java/ifc/form/_XReset.java b/qadevOOo/tests/java/ifc/form/_XReset.java index 033b9a3d1b2a..e9835ed6a147 100644 --- a/qadevOOo/tests/java/ifc/form/_XReset.java +++ b/qadevOOo/tests/java/ifc/form/_XReset.java @@ -134,11 +134,11 @@ public class _XReset extends MultiMethodTest { log.println("Testing reset() ..."); approve = false; oObj.reset(); - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("reset()", (approveReset[0] && (! resetted[0]))); approve = true; oObj.reset(); - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("addResetListener()", (approveReset[1] && resetted[1])); } // finished _reset @@ -159,7 +159,7 @@ public class _XReset extends MultiMethodTest { approveReset[0] = resetted[0] = false; oObj.removeResetListener(listener1); oObj.reset(); - util.utils.shortWait(); + waitForEventIdle(); tRes.tested("removeResetListener()", !approveReset[0] && !resetted[0]); //removing the second listener here may avoid crashing the office } // finished _removeResetListener() diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java index bfe3c2ba0611..97b58ff21211 100644 --- a/qadevOOo/tests/java/ifc/form/_XSubmit.java +++ b/qadevOOo/tests/java/ifc/form/_XSubmit.java @@ -134,7 +134,7 @@ public class _XSubmit extends MultiMethodTest { } oObj.submit(cntrl, new MouseEvent()); - util.utils.pause(200); + waitForEventIdle(); log.println("Listener1 called " + listener1.called + " times"); log.println("Listener2 called " + listener2.called + " times"); diff --git a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java index 34ca21809240..c482af5ef615 100644 --- a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java +++ b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java @@ -136,12 +136,12 @@ public class _XUpdateBroadcaster extends MultiMethodTest { try { checker.update() ; - util.utils.pause(200); + waitForEventIdle(); checker.commit() ; - util.utils.pause(200); + waitForEventIdle(); boolean committed = checker.wasCommited() ; - util.utils.pause(200); + waitForEventIdle(); bResult = listener.approveCalled && ! listener.updateCalled && @@ -152,18 +152,18 @@ public class _XUpdateBroadcaster extends MultiMethodTest { (listener.updateCalled ? "":"NOT")+" called, the value was " + (committed ? "" : "NOT") + " committed.") ; - util.utils.pause(200); + waitForEventIdle(); listener.init() ; listener.approve = true ; - util.utils.pause(200); + waitForEventIdle(); checker.update() ; - util.utils.pause(200); + waitForEventIdle(); checker.commit() ; - util.utils.pause(200); + waitForEventIdle(); committed = checker.wasCommited() ; - util.utils.pause(200); + waitForEventIdle(); log.println("Calling with approving : approveUpdate() was " + (listener.approveCalled ? "":"NOT")+" called, updated() was "+ @@ -202,10 +202,10 @@ public class _XUpdateBroadcaster extends MultiMethodTest { try { checker.update() ; - util.utils.pause(200); + waitForEventIdle(); checker.commit() ; - util.utils.pause(200); + waitForEventIdle(); bResult = ! listener.approveCalled && ! listener.updateCalled ; diff --git a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java index 194319580c7f..14e8a1f1e8e3 100644 --- a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java +++ b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java @@ -110,7 +110,7 @@ public class _XSubmission extends MultiMethodTest { log.println("Sleeping 2s"); - util.utils.pause(2000); + waitForEventIdle(); log.println("... done"); diff --git a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java index fdcb31fd0940..afda3657a1a8 100644 --- a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java @@ -45,7 +45,7 @@ public class _XComponentLoader extends MultiMethodTest { * and no exceptions were thrown. <p> * @see XComponent */ - public void _loadComponentFromURL() { + public void _loadComponentFromURL() throws Exception { boolean result = true; log.println("testing loadComponentFromURL() ... "); @@ -65,7 +65,7 @@ public class _XComponentLoader extends MultiMethodTest { oDoc = oObj.loadComponentFromURL( url, frameName, 0, szArgs); - util.utils.shortWait(); + waitForEventIdle(); oDoc.dispose(); @@ -74,7 +74,7 @@ public class _XComponentLoader extends MultiMethodTest { oDoc = oObj.loadComponentFromURL( url, frameName, 0, szArgs); - util.utils.shortWait(); + waitForEventIdle(); oDoc.dispose(); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatch.java b/qadevOOo/tests/java/ifc/frame/_XDispatch.java index 59dfe64c3101..2fd127036f7b 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatch.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatch.java @@ -130,7 +130,7 @@ public class _XDispatch extends MultiMethodTest { notificationListener = new TestNotificationListener(log) ; xND.dispatchWithNotification(url, arguments, notificationListener); - util.utils.pause(200); + waitForEventIdle(); log.println(" Listener called: "+ notificationListener.finishedDispatch); @@ -171,7 +171,7 @@ public class _XDispatch extends MultiMethodTest { oObj.dispatch(url, new PropertyValue[0]) ; - util.utils.pause(200); + waitForEventIdle(); log.println("Listener called: "+ listener.statusChangedCalled); @@ -213,7 +213,7 @@ public class _XDispatch extends MultiMethodTest { oObj.dispatch(url, new PropertyValue[0]) ; - util.utils.pause(200); + waitForEventIdle(); System.out.println("Listener called: "+ listener.statusChangedCalled); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java index f9b9bbe65ae2..8a684edd901d 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java @@ -67,7 +67,7 @@ public class _XDispatchRecorder extends MultiMethodTest { tRes.tested("startRecording()", true); } - public void _getRecordedMacro() { + public void _getRecordedMacro() throws Exception { clearBuffer(); @@ -86,7 +86,7 @@ public class _XDispatchRecorder extends MultiMethodTest { XDispatch xDisp = xDispProv.queryDispatch(dispURL, "", 0); xDisp.dispatch(dispURL, dispArgs); - util.utils.shortWait(); + waitForEventIdle(); log.println("Getting macro ... :"); String macro = oObj.getRecordedMacro(); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java index 938c298296e5..fd6858c8dd78 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java @@ -157,7 +157,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { * * Has <b>OK</b> status if all cases are OK. */ - public void _dispatchAndRecord() { + public void _dispatchAndRecord() throws Exception { requiredMethod("getDispatchRecorder()"); boolean res = true; @@ -173,7 +173,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { } } - util.utils.shortWait(); + waitForEventIdle(); XModel model = UnoRuntime.queryInterface(XModel.class, xTextDoc); XFrame fr = model.getCurrentController().getFrame(); diff --git a/qadevOOo/tests/java/ifc/frame/_XFrame.java b/qadevOOo/tests/java/ifc/frame/_XFrame.java index c24c4fa2145e..6d462eb983bf 100644 --- a/qadevOOo/tests/java/ifc/frame/_XFrame.java +++ b/qadevOOo/tests/java/ifc/frame/_XFrame.java @@ -172,10 +172,10 @@ public class _XFrame extends MultiMethodTest { /** * Test calls the method. Then frame status (activated/deactivated) is * changed, and the listener is checked.<p> - * Has <b> OK </b> status if isDesktop() method returnes true, or if the + * Has <b> OK </b> status if isDesktop() method returns true, or if the * listener was called and frame was activated. */ - public void _addFrameActionListener() { + public void _addFrameActionListener() throws Exception { boolean result = true ; oObj.addFrameActionListener(listener) ; @@ -189,8 +189,7 @@ public class _XFrame extends MultiMethodTest { return; } - util.utils.shortWait(); - + waitForEventIdle(); if (!listenerCalled[0]) { log.println("listener was not called.") ; @@ -399,7 +398,7 @@ public class _XFrame extends MultiMethodTest { /** * At first new listener is added, then test calls the method and result * is checked. <p> - * Has <b> OK </b> status if isDesktop() method returnes true or if the + * Has <b> OK </b> status if isDesktop() method returns true or if the * listener was called and proper event past to listener. */ public void _contextChanged() { diff --git a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java index 0fb7b9acd225..ec7a366412bb 100644 --- a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java @@ -126,7 +126,7 @@ public class _XFrameLoader extends MultiMethodTest { /** * First <code>cancel</code> method test is called. - * If in that test loaing process was interrupted by + * If in that test loading process was interrupted by * <code>cancel</code> call then <code>load</code> test * executes. It loads a component, waits some moment to * listener have a chance to be called and then checks @@ -140,13 +140,13 @@ public class _XFrameLoader extends MultiMethodTest { * <li> <code> cancel() </code> </li> * </ul> */ - public void _load() { + public void _load() throws Exception { executeMethod("cancel()") ; if (!loaded) { oObj.load(frame, url, args, listener) ; - util.utils.shortWait(); + waitForEventIdle(); loaded = listener.finished ; } @@ -160,13 +160,13 @@ public class _XFrameLoader extends MultiMethodTest { * Has <b>OK</b> status if the process was cancelled or * finished (appropriate listener methods were called). */ - public void _cancel() { + public void _cancel() throws Exception { boolean result = true ; oObj.load(frame, url, args, listener) ; oObj.cancel() ; - util.utils.shortWait(); + waitForEventIdle(); if (listener.cancelled) { log.println("Loading was canceled.") ; diff --git a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java index eaf3b554dd55..c5e84d53c0e7 100644 --- a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java +++ b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java @@ -106,7 +106,7 @@ public class _XNotifyingDispatch extends MultiMethodTest { oObj.dispatchWithNotification(url, arguments, notificationListener); - util.utils.pause(200); + waitForEventIdle(); log.println("Listener called: "+ notificationListener.finishedDispatch); diff --git a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java index 6b3ed19d0265..a2776ce3aaaa 100644 --- a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java @@ -151,8 +151,7 @@ public class _XSynchronousFrameLoader extends MultiMethodTest { oObj.cancel() ; - util.utils.pause(1000); - + waitForEventIdle(); tRes.tested("cancel()", !result[0]) ; } diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java index ffcd3d65c147..37383b099b82 100644 --- a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java +++ b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java @@ -126,7 +126,7 @@ public class _XActiveDataControl extends MultiMethodTest { } /** - * Starts the data activity (e.g. data pump). Verifictation is performed + * Starts the data activity (e.g. data pump). Verification is performed * later, in <code>_terminate()</code> method. */ public void _start() { diff --git a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java index 1a6a583819a8..6dec94584ecd 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java +++ b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java @@ -100,7 +100,7 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest { rob.mouseRelease(InputEvent.BUTTON3_MASK); System.out.println("done"); System.out.println("warte"); - util.utils.pause(200); + waitForEventIdle(); System.out.println("Press Button"); rob.mousePress(InputEvent.BUTTON1_MASK); System.out.println("Release Button"); diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index a8767cc1a0b5..1b29d1e7000b 100644 --- a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java +++ b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java @@ -62,7 +62,7 @@ public class _XRangeSelection extends MultiMethodTest { XWindow xWindow = xModel.getCurrentController().getFrame().getContainerWindow(); XTopWindow xTopWindow = UnoRuntime.queryInterface(XTopWindow.class, xWindow); xTopWindow.toFront(); - util.utils.pause(500); + waitForEventIdle(); } @@ -114,7 +114,7 @@ public class _XRangeSelection extends MultiMethodTest { props[2].Value = Boolean.FALSE; oObj.startRangeSelection(props); // wait for listeners - util.utils.pause(1000); + waitForEventIdle(); // get closer button: move if window cobvers the sheet center Point closer = getCloser(center); @@ -123,22 +123,22 @@ public class _XRangeSelection extends MultiMethodTest { // do something to trigger the listeners clickOnSheet(center); - util.utils.pause(5000); + waitForEventIdle(); // click on closer clickOnSheet(closer); - util.utils.pause(5000); + waitForEventIdle(); // open a new range selection props[0].Value = "C4:E6"; oObj.startRangeSelection(props); - util.utils.pause(1000); + waitForEventIdle(); props[0].Value = "C2:E3"; oObj.startRangeSelection(props); - util.utils.pause(1000); + waitForEventIdle(); oObj.startRangeSelection(props); - util.utils.pause(1000); + waitForEventIdle(); oObj.abortRangeSelection(); aListener.reset(); System.out.println("Listener called: " + aListener.bAbortCalled); @@ -295,9 +295,9 @@ public class _XRangeSelection extends MultiMethodTest { Robot rob = new Robot(); rob.mouseMove(point.X, point.Y); rob.mousePress(InputEvent.BUTTON1_MASK); - util.utils.pause(1000); + waitForEventIdle(); rob.mouseRelease(InputEvent.BUTTON1_MASK); - util.utils.pause(1000); + waitForEventIdle(); } catch (java.awt.AWTException e) { log.println("couldn't press mouse button"); } diff --git a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java index 35fc2f1ac08b..d141a3c3ae0d 100644 --- a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java +++ b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java @@ -90,7 +90,7 @@ public class _XSystemShellExecute extends MultiMethodTest { } catch(com.sun.star.uno.Exception e) { log.println("Exception:" + e); } - util.utils.pause(1000); + waitForEventIdle(); i++; } diff --git a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java index d13cf0ead61b..d3910f28786d 100644 --- a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java +++ b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java @@ -57,7 +57,7 @@ public class _XJobExecutor extends MultiMethodTest { oObj.trigger("TestEvent"); - util.utils.pause(1000); + waitForEventIdle(); int after = Integer.parseInt(counter.getName()); diff --git a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java index bb843ee2d22b..dd7470967b92 100644 --- a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java +++ b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java @@ -96,7 +96,7 @@ public class _XDocumentIndex extends MultiMethodTest { oObj.update(); - util.utils.pause(1000); + waitForEventIdle(); String contentAfter = oObj.getAnchor().getString(); diff --git a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java index 003d732c5943..5ac586b43013 100644 --- a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java +++ b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java @@ -103,8 +103,6 @@ public class _XMailMergeBroadcaster extends MultiMethodTest { ("'could not fire event: " + e)) ; } - util.utils.pause(200); - tRes.tested("addMailMergeEventListener()", changed); } @@ -132,7 +130,7 @@ public class _XMailMergeBroadcaster extends MultiMethodTest { ("'could not fire event: " + e)) ; } - util.utils.pause(200); + waitForEventIdle(); tRes.tested("removeMailMergeEventListener()", !changed); } diff --git a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java index 452fe6ad9aaf..a7239f819280 100644 --- a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java +++ b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java @@ -108,7 +108,7 @@ public class _XPagePrintable extends MultiMethodTest { * Has <b>OK</b> status if the file to which printing must be performed * is exists. */ - public void _printPages() { + public void _printPages() throws Exception { boolean res = true; try { @@ -132,7 +132,7 @@ public class _XPagePrintable extends MultiMethodTest { oObj.printPages(PrintOptions); - util.utils.shortWait(); + waitForEventIdle(); if (! util.utils.fileExists(xMSF, printFile)){ log.println("ERROR: could not find '" + printFile + "'"); diff --git a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java index 3935c9044196..66065271693f 100644 --- a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java +++ b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java @@ -42,7 +42,6 @@ import lib.Status; import lib.StatusException; import util.AccessibilityTools; import util.DesktopTools; -import util.utils; public class _XContextMenuInterception extends MultiMethodTest { @@ -68,7 +67,7 @@ public class _XContextMenuInterception extends MultiMethodTest { log.println("ensure that the first model is focused"); DesktopTools.bringWindowToFront(docModel); - utils.pause(3000); + waitForEventIdle(); } @Override @@ -182,7 +181,7 @@ public class _XContextMenuInterception extends MultiMethodTest { log.println("couldn't press mouse button"); } - utils.pause(1000); + waitForEventIdle(); } diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java index bb10c5abd9cd..8665f2fb3c95 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java @@ -73,7 +73,7 @@ public class _XExecutableDialog extends MultiMethodTest { eThread.start(); XCancellable canc = UnoRuntime.queryInterface (XCancellable.class, tEnv.getTestObject()); - util.utils.pause(2000); + waitForEventIdle(); if (canc != null) { closeDialog(); short res = eThread.execRes; diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java index 603e6285af01..54858bfcf106 100644 --- a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java +++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java @@ -134,7 +134,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { e.printStackTrace(log) ; } - util.utils.pause(2000); + waitForEventIdle(); if (!listener.called) { log.println("Listener wasn't called :-("); @@ -169,7 +169,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { e.printStackTrace(log) ; } - util.utils.pause(2000); + waitForEventIdle(); closeDialog(); diff --git a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java index 221cb7cb5400..b60c6f958e3c 100644 --- a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java +++ b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java @@ -53,7 +53,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest { public void _addPrintJobListener() { oObj.addPrintJobListener(listenerImpl); listenerImpl.fireEvent(); - util.utils.pause(1000); + waitForEventIdle(); tRes.tested("addPrintJobListener()", listenerImpl.actionTriggered()); } @@ -64,7 +64,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest { requiredMethod("addPrintJobListener"); oObj.removePrintJobListener(listenerImpl); - util.utils.pause(5000); + waitForEventIdle(); listenerImpl.reset(); listenerImpl.fireEvent(); diff --git a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java index 103dca483f3f..8a2bd9917607 100644 --- a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java +++ b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java @@ -63,7 +63,7 @@ public class AccessibleShape extends TestCase { } @Override - protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { + protected TestEnvironment createTestEnvironment(final TestParameters tParam, PrintWriter log) throws Exception { XMultiServiceFactory xMSF = tParam.getMSF(); log.println( "creating a test environment" ); String aURL=utils.getFullTestURL("basDialog.odt"); @@ -90,7 +90,7 @@ public class AccessibleShape extends TestCase { aArgs[3].Value = "Dialog"; xDPH.executeDispatch(xDPP, ".uno:BasicIDEAppear", "", 0, aArgs); - utils.pause(3000); + util.utils.waitForEventIdle(tParam.getMSF()); oObj = (XInterface) tParam.getMSF().createInstance ("com.sun.star.awt.Toolkit") ; @@ -121,7 +121,7 @@ public class AccessibleShape extends TestCase { newPosSize.Y = oldPosSize.Y + 20; basicIDE.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, newPosSize.Height, PosSize.POSSIZE); - utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); basicIDE.setPosSize(oldPosSize.X, oldPosSize.Y, oldPosSize.Width, oldPosSize.Height, PosSize.POSSIZE); } diff --git a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java index 2025e9beb85b..2ec8e6f3c209 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -84,7 +84,7 @@ public class ConnectionLineAccessibility extends TestCase * creates two tables in database. * Creates a new query and adds it to DefinitionContainer. * Opens the QueryComponent.with loadComponentFromURL - * and gets the object with the role UNKNOWN and the Impplementation + * and gets the object with the role UNKNOWN and the implementation * name that contains ConnectionLine * @param Param test parameters * @param log writer to log information while testing @@ -161,30 +161,16 @@ public class ConnectionLineAccessibility extends TestCase final String col_name1 = "id1"; final String col_name2 = "id2"; - try - { - connection = isolConnection.getIsolatedConnection(user, password); - statement = connection.createStatement(); - statement.executeUpdate("drop table if exists " + tbl_name1); - statement.executeUpdate("drop table if exists " + tbl_name2); - statement.executeUpdate("create table " + tbl_name1 + " (" + - col_name1 + " int)"); - statement.executeUpdate("create table " + tbl_name2 + " (" + - col_name2 + " int)"); - } - catch (com.sun.star.sdbc.SQLException e) - { - util.utils.pause(1500); - connection = isolConnection.getIsolatedConnection(user, - password); - statement = connection.createStatement(); - statement.executeUpdate("drop table if exists " + tbl_name1); - statement.executeUpdate("drop table if exists " + tbl_name2); - statement.executeUpdate("create table " + tbl_name1 + " (" + - col_name1 + " int)"); - statement.executeUpdate("create table " + tbl_name2 + " (" + - col_name2 + " int)"); - } + util.utils.waitForEventIdle(Param.getMSF()); + + connection = isolConnection.getIsolatedConnection(user, password); + statement = connection.createStatement(); + statement.executeUpdate("drop table if exists " + tbl_name1); + statement.executeUpdate("drop table if exists " + tbl_name2); + statement.executeUpdate("create table " + tbl_name1 + " (" + + col_name1 + " int)"); + statement.executeUpdate("create table " + tbl_name2 + " (" + + col_name2 + " int)"); XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface( XQueryDefinitionsSupplier.class, @@ -224,7 +210,7 @@ public class ConnectionLineAccessibility extends TestCase QueryComponent = DesktopTools.loadDoc(Param.getMSF(),".component:DB/QueryDesign",loadProps); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent). getCurrentController().getFrame().getContainerWindow(); @@ -241,7 +227,7 @@ public class ConnectionLineAccessibility extends TestCase TestEnvironment tEnv = new TestEnvironment(oObj); - util.utils.pause(1500); + util.utils.waitForEventIdle(Param.getMSF()); final XWindow queryWin = xWindow; diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index aef85b40e771..abddd0419622 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -161,29 +161,15 @@ public class JoinViewAccessibility extends TestCase { final String col_name1 = "id1"; final String col_name2 = "id2"; - try - { - connection = isolConnection.getIsolatedConnection (user, password); - statement = connection.createStatement (); - statement.executeUpdate ("drop table if exists " + tbl_name1); - statement.executeUpdate ("drop table if exists " + tbl_name2); - statement.executeUpdate ("create table " + tbl_name1 + " (" + - col_name1 + " int)"); - statement.executeUpdate ("create table " + tbl_name2 + " (" + - col_name2 + " int)"); - } catch (com.sun.star.sdbc.SQLException e) - { - util.utils.pause(1500); - connection = isolConnection.getIsolatedConnection (user, - password); - statement = connection.createStatement (); - statement.executeUpdate ("drop table if exists " + tbl_name1); - statement.executeUpdate ("drop table if exists " + tbl_name2); - statement.executeUpdate ("create table " + tbl_name1 + " (" + - col_name1 + " int)"); - statement.executeUpdate ("create table " + tbl_name2 + " (" + - col_name2 + " int)"); - } + util.utils.waitForEventIdle(Param.getMSF()); + connection = isolConnection.getIsolatedConnection (user, password); + statement = connection.createStatement (); + statement.executeUpdate ("drop table if exists " + tbl_name1); + statement.executeUpdate ("drop table if exists " + tbl_name2); + statement.executeUpdate ("create table " + tbl_name1 + " (" + + col_name1 + " int)"); + statement.executeUpdate ("create table " + tbl_name2 + " (" + + col_name2 + " int)"); XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface ( XQueryDefinitionsSupplier.class, @@ -238,7 +224,7 @@ public class JoinViewAccessibility extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - util.utils.pause(1500); + util.utils.waitForEventIdle(Param.getMSF()); final XWindow queryWin = xWindow; diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java index d0f7d02666ad..4ccff483f817 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java @@ -197,7 +197,7 @@ public class ODatasourceBrowser extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -250,7 +250,7 @@ public class ODatasourceBrowser extends TestCase { XInitialization.class, oObj); xInit.initialize(params); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java index 9d186c3d4091..ca4fbcc5d665 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java @@ -109,7 +109,7 @@ public class OQueryDesign extends TestCase { Args[1] = param2; getting.dispatch(the_url,Args); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); Object oDBC = xMSF.createInstance( "com.sun.star.sdb.DatabaseContext" ); diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index d48bd9009042..b7bcd7712fa8 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -161,26 +161,15 @@ public class TableWindowAccessibility extends TestCase { final String col_name1 = "id1"; final String col_name2 = "id2"; - try { - connection = isolConnection.getIsolatedConnection(user, password); - statement = connection.createStatement(); - statement.executeUpdate("drop table if exists " + tbl_name1); - statement.executeUpdate("drop table if exists " + tbl_name2); - statement.executeUpdate("create table " + tbl_name1 + " (" - + col_name1 + " int)"); - statement.executeUpdate("create table " + tbl_name2 + " (" - + col_name2 + " int)"); - } catch (com.sun.star.sdbc.SQLException e) { - util.utils.pause(1500); - connection = isolConnection.getIsolatedConnection(user, password); - statement = connection.createStatement(); - statement.executeUpdate("drop table if exists " + tbl_name1); - statement.executeUpdate("drop table if exists " + tbl_name2); - statement.executeUpdate("create table " + tbl_name1 + " (" - + col_name1 + " int)"); - statement.executeUpdate("create table " + tbl_name2 + " (" - + col_name2 + " int)"); - } + util.utils.waitForEventIdle(Param.getMSF()); + connection = isolConnection.getIsolatedConnection(user, password); + statement = connection.createStatement(); + statement.executeUpdate("drop table if exists " + tbl_name1); + statement.executeUpdate("drop table if exists " + tbl_name2); + statement.executeUpdate("create table " + tbl_name1 + " (" + + col_name1 + " int)"); + statement.executeUpdate("create table " + tbl_name2 + " (" + + col_name2 + " int)"); XQueryDefinitionsSupplier querySuppl = UnoRuntime.queryInterface( XQueryDefinitionsSupplier.class, oDBSource); @@ -235,7 +224,7 @@ public class TableWindowAccessibility extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - util.utils.pause(1500); + util.utils.waitForEventIdle(Param.getMSF()); XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java index 7526f4c6f9f6..40c28b337acf 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeControl.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java @@ -225,7 +225,7 @@ public class OTimeControl extends TestCase { tEnv.addObjRelation("TestTextListener", listener); FormTools.switchDesignOf((Param.getMSF()), xTextDoc); - util.utils.pause(200); + util.utils.waitForEventIdle(Param.getMSF()); return tEnv; } // finish method getTestEnvironment diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java index b8607a1f173d..25c31fdff4f2 100644 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java @@ -74,7 +74,7 @@ public class DispatchRecorder extends TestCase { SOfficeFactory SOF = SOfficeFactory.getFactory(Param.getMSF()); oDoc = SOF.createTextDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel model = UnoRuntime.queryInterface(XModel.class, oDoc); xFrame = model.getCurrentController().getFrame(); diff --git a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java index 7cb4ed030b2f..9bd5df78008c 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -179,7 +179,7 @@ public class JobExecutor extends TestCase { XChangesBatch xCB = UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); xCB.commitChanges(); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java index 3c5cdfabd7fe..d9e8fb268ce2 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java @@ -60,12 +60,12 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); DiagThread psDiag = new DiagThread(xCalcDoc, msf); psDiag.start(); - util.utils.pause(Param.getInt("ShortWait")*5); + util.utils.waitForEventIdle(Param.getMSF()); Object atw = tk.getActiveTopWindow(); @@ -74,7 +74,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); XAccessibleContext ok_button = AccessibilityTools.getAccessibleObjectForRole(xRoot, diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java index 10acdbc2f9b7..0e2901f9132f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java @@ -58,8 +58,6 @@ public class ScAccessibleCsvCell extends TestCase { @Override protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) throws Exception { - util.utils.pause(2000); - XInterface oObj = (XInterface) tParam.getMSF().createInstance ("com.sun.star.awt.Toolkit") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java index e577bcdf443f..518ce6cb8915 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java @@ -57,8 +57,6 @@ public class ScAccessibleCsvGrid extends TestCase { @Override protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { - util.utils.pause(2000); - XInterface oObj = (XInterface) Param.getMSF().createInstance ("com.sun.star.awt.Toolkit") ; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java index 4576ff84f891..19307ebd843c 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java @@ -60,8 +60,6 @@ public class ScAccessibleCsvRuler extends TestCase { @Override protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { - util.utils.pause(2000); - XMultiServiceFactory msf = Param.getMSF(); XInterface oObj = (XInterface) msf.createInstance("com.sun.star.awt.Toolkit"); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java index ea3745995342..37411116a9f6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java @@ -139,7 +139,7 @@ public class ScAccessibleDocument extends TestCase { String url = utils.getFullTestURL("calcshapes.sxc"); log.println("loading document "+url); xSpreadsheetDoc = SOF.loadDocument(url); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException( "Couldn't create document ", e ); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java index 9530e7475133..30be8cc5de82 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java @@ -196,7 +196,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { log.println("loading document "+url); xSpreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,SOF.loadDocument(url)); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException( "Couldn't create document ", e ); diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java index 1fcc985cacd2..4102a9d2b101 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -126,7 +126,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentContainerWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java index 3a260db4d352..b1378967f148 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -98,7 +98,7 @@ public class ScTabViewObj extends TestCase { try { log.println("creating two spreadsheet documents"); xSpreadsheetDoc = SOF.createCalcDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xSpreadsheetDoc2 = SOF.createCalcDoc(null); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java index 886834a93238..320b76c1ab26 100644 --- a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java @@ -123,7 +123,7 @@ public class AccessibleOutlineView extends TestCase { try { log.println( "creating a impress document" ); xImpressDoc = SOF.createImpressDoc(null); - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -152,7 +152,7 @@ public class AccessibleOutlineView extends TestCase { } catch (com.sun.star.uno.Exception e) { log.println("Couldn't change mode"); } - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); } } diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java index ccdd916cf13c..7f219e9b459b 100644 --- a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java +++ b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java @@ -69,7 +69,7 @@ public class AccessibleSlideView extends TestCase { oDPn.insertNewByIndex(0); - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentWindow ( aModel); @@ -135,7 +135,7 @@ public class AccessibleSlideView extends TestCase { throw new StatusException("Couldn't create document", e); } - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); @@ -160,8 +160,7 @@ public class AccessibleSlideView extends TestCase { log.println("Couldn't change mode"); } - util.utils.pause(2000); - + util.utils.waitForEventIdle(Param.getMSF()); } } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index 85c65140c128..9a1fb6d702bd 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -136,9 +136,9 @@ public class DrawController_DrawView extends TestCase { log.println( "creating two impress documents" ); xDrawDoc = SOF.createDrawDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xSecondDrawDoc = SOF.createDrawDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -161,7 +161,7 @@ public class DrawController_DrawView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -192,7 +192,7 @@ public class DrawController_DrawView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); tEnv.addObjRelation("Selections", new Object[] { diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java index 7f483a11cad7..0b9fd8cda45b 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java @@ -154,9 +154,9 @@ public class DrawController_HandoutView extends TestCase { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -182,12 +182,12 @@ public class DrawController_HandoutView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); log.println("switch to HandoutView..."); utils.dispatchURL(xMSF, xDrawDoc, ".uno:HandoutMode"); - utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -220,7 +220,7 @@ public class DrawController_HandoutView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java index 6f2a77ecbb01..8f2e56cc7147 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java @@ -154,9 +154,9 @@ public class DrawController_NotesView extends TestCase { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -179,12 +179,12 @@ public class DrawController_NotesView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); log.println("switch to HandoutView..."); utils.dispatchURL(xMSF, xDrawDoc, ".uno:NotesMode"); - utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -217,7 +217,7 @@ public class DrawController_NotesView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index fc431e2e64e3..38d03e122d51 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -154,9 +154,9 @@ public class DrawController_OutlineView extends TestCase { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -179,12 +179,12 @@ public class DrawController_OutlineView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); log.println("switch to HandoutView..."); utils.dispatchURL(xMSF, xDrawDoc, ".uno:OutlineMode"); - utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -217,7 +217,7 @@ public class DrawController_OutlineView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java index de244932700d..8f1acd59904e 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java @@ -154,9 +154,9 @@ public class DrawController_PresentationView extends TestCase { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -179,12 +179,12 @@ public class DrawController_PresentationView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); log.println("switch to PresentationView..."); utils.dispatchURL(xMSF, xDrawDoc, ".uno:DiaMode"); - utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -217,7 +217,7 @@ public class DrawController_PresentationView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java index c7f7f4daf9fd..a0e108b7db54 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java @@ -151,9 +151,9 @@ public class SdUnoDrawView extends TestCase { log.println( "creating two draw documents" ); xDrawDoc = SOF.createDrawDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xSecondDrawDoc = SOF.createDrawDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); @@ -176,7 +176,7 @@ public class SdUnoDrawView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java index d51c97b6c99a..f4fbe3e13d2f 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java @@ -135,7 +135,7 @@ public class SdUnoOutlineView extends TestCase { log.println( "creating a impress document" ); xImpressDoc = SOF.createImpressDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); XDrawPagesSupplier oDPS = UnoRuntime.queryInterface(XDrawPagesSupplier.class, xImpressDoc); XDrawPages the_pages = oDPS.getDrawPages(); @@ -166,7 +166,7 @@ public class SdUnoOutlineView extends TestCase { log.println( "creating a second impress document" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java index e157cd07d409..91e9923b288a 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java @@ -150,7 +150,7 @@ public class SdUnoPresView extends TestCase { log.println( "creating two impress documents" ); xImpressDoc = SOF.createImpressDoc(null); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(Param.getMSF()); // get the drawpage of drawing here log.println( "getting Drawpage" ); diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java index ec4a5c6570c9..d4f4b138a4fc 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java @@ -108,7 +108,7 @@ public class SdUnoSlideView extends TestCase { XDrawPages xDP = null; log.println( "creating a impress document" ); xImpressDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xDP = DrawTools.getDrawPages(xImpressDoc); xDP.insertNewByIndex(0); xDP.insertNewByIndex(0); @@ -138,7 +138,7 @@ public class SdUnoSlideView extends TestCase { log.println( "creating a second impress document" ); xSecondDrawDoc = SOF.createImpressDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel2 = UnoRuntime.queryInterface(XModel.class, xSecondDrawDoc); diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java index 8132428b8095..710027706969 100644 --- a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java @@ -66,7 +66,7 @@ public class SmEditAccessible extends TestCase { * component with the role <code>AccessibleRole.PANEL</code>. */ @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + protected TestEnvironment createTestEnvironment(final TestParameters Param, PrintWriter log) throws Exception { SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() ); xMathDoc = SOF.openDoc("smath","_blank"); @@ -101,10 +101,10 @@ public class SmEditAccessible extends TestCase { try { System.out.println("Children "+con.getAccessibleChildCount()); xPS.setPropertyValue("Formula", "sum hat x \n int a \n sum b"); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); System.out.println("Children "+con.getAccessibleChildCount()); xPS.setPropertyValue("Formula", expFormula); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); } catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.IllegalArgumentException e) { } catch(com.sun.star.beans.PropertyVetoException e) { diff --git a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java index 578e13f06bb8..1d02f98bc11c 100644 --- a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java @@ -68,7 +68,7 @@ public class SmGraphicAccessible extends TestCase { * component with the role <code>AccessibleRole.PANEL</code>. */ @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { + protected TestEnvironment createTestEnvironment(final TestParameters Param, PrintWriter log) throws Exception { SOfficeFactory SOF = SOfficeFactory.getFactory( Param.getMSF() ); xMathDoc = SOF.openDoc("smath","_blank"); @@ -106,9 +106,9 @@ public class SmGraphicAccessible extends TestCase { try { xAC.grabFocus(); xPS.setPropertyValue("Formula", "sum hat x"); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); xPS.setPropertyValue("Formula", expFormula); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); } catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.IllegalArgumentException e) { } catch(com.sun.star.beans.PropertyVetoException e) { diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java index 79011ebb0066..09c4f7bb9133 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java @@ -95,7 +95,7 @@ public class AccessibleBrowseBox extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -114,7 +114,7 @@ public class AccessibleBrowseBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -141,7 +141,7 @@ public class AccessibleBrowseBox extends TestCase { final PropertyValue[] fParams = params; - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = secondController.getFrame().getContainerWindow(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java index d622fc74188a..222c8874f2b2 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java @@ -126,7 +126,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -165,7 +165,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { param3.Value = "biblio"; params[2] = param3; - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -197,14 +197,14 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); final Point point = accComp.getLocationOnScreen(); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java index 12d1071b2c9b..dee44c4aa007 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java @@ -126,7 +126,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -144,7 +144,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java index ef5867daf9e6..a828487cd5fd 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java @@ -126,7 +126,7 @@ public class AccessibleBrowseBoxTable extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -148,7 +148,7 @@ public class AccessibleBrowseBoxTable extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java index 7e3fb29c88e5..59b7ba2c59f3 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java @@ -122,7 +122,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -140,7 +140,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url,noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -171,7 +171,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { param3.Value = "biblio"; params[2] = param3; - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = secondController.getFrame().getContainerWindow(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java index cb2be82c6b43..c1e4542c37a1 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java @@ -145,7 +145,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -175,7 +175,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF() .createInstance("com.sun.star.awt.Toolkit"); @@ -183,7 +183,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java index 8499e80459d5..1c12950e8c95 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java @@ -149,7 +149,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -173,14 +173,14 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF().createInstance ("com.sun.star.awt.Toolkit") ; XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java index d3ee8b392d47..8e694058b9a3 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java @@ -90,12 +90,10 @@ public class AccessibleTabBar extends TestCase { SOF.createCalcDoc( null)); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = null; - util.utils.pause(5000); - XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xDoc). getCurrentController().getFrame().getContainerWindow(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java index cf08f7f5298b..e8b4c56e7498 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java @@ -112,7 +112,7 @@ public class AccessibleTabBarPage extends TestCase { log.println( "creating a calc document" ); xDoc = UnoRuntime.queryInterface(XComponent.class, SOF.createCalcDoc(null));// SOF.createDrawDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF().createInstance ("com.sun.star.awt.Toolkit") ; @@ -121,7 +121,7 @@ public class AccessibleTabBarPage extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java index e66b35e2aa10..64ca390ffa0f 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java @@ -114,7 +114,7 @@ public class AccessibleTabBarPageList extends TestCase { log.println("creating a draw document"); xDoc = SOF.createDrawDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF() .createInstance("com.sun.star.awt.Toolkit"); @@ -122,7 +122,7 @@ public class AccessibleTabBarPageList extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java index 14785f368241..02d4c53130cd 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java @@ -131,7 +131,7 @@ public class AccessibleTreeListBox extends TestCase { log.println( "creating a text document" ); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -149,7 +149,7 @@ public class AccessibleTreeListBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java index 85226f42daf2..7bd12efc842d 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java @@ -150,7 +150,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -172,7 +172,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -213,7 +213,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { xSelect.select(params); - util.utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = secondController.getFrame().getContainerWindow(); diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java index 25a7df2cea5b..e1f3c36e5834 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java @@ -81,7 +81,7 @@ public class AccessibleControlShape extends TestCase { final XShape oShape = FormTools.insertControlShape (xDrawDoc,3000,4500,15000,1000,"CommandButton"); - utils.pause(5000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentWindow (aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java index 77db894d1cf8..e2e2fe7bd756 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java @@ -46,7 +46,7 @@ public class AccessibleEditableTextPara extends TestCase { /** * Called to create an instance of <code>TestEnvironment</code> * with an object to test and related objects. - * Obtains accissible object for the spreadsheet document. + * Obtains accessible object for the spreadsheet document. * * @param Param test parameters * @param log writer to log information while testing @@ -128,7 +128,7 @@ public class AccessibleEditableTextPara extends TestCase { try { log.println("creating a spreadsheetdocument"); xSpreadsheetDoc = UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null)); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException( "Couldn't create document ", e ); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java index 64c1dc7913d1..c04359569b6c 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java @@ -60,7 +60,7 @@ public class SwAccessibleDocumentPageView extends TestCase { */ @Override protected TestEnvironment createTestEnvironment( - TestParameters Param, PrintWriter log) throws Exception{ + final TestParameters Param, PrintWriter log) throws Exception{ XInterface oObj = null; @@ -102,7 +102,7 @@ public class SwAccessibleDocumentPageView extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -120,7 +120,7 @@ public class SwAccessibleDocumentPageView extends TestCase { public void fireEvent() { String oldText = the_text.getString(); the_text.setString("EVENT FIRED"); - util.utils.pause(2000); + util.utils.waitForEventIdle(Param.getMSF()); the_text.setString(oldText); } }); diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java index b15621045c19..a8e6c3d16ffa 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java @@ -108,7 +108,7 @@ public class SwAccessiblePageView extends TestCase { paraP = UnoRuntime.queryInterface(XPropertySet.class, para); paraP.setPropertyValue("BreakType",com.sun.star.style.BreakType.PAGE_AFTER); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XController xController = xTextDoc.getCurrentController(); @@ -128,7 +128,7 @@ public class SwAccessiblePageView extends TestCase { if(xDispatcher != null) xDispatcher.dispatch( aURL, null ); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java index 924595a2ad2b..37e0e2762b49 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java @@ -93,7 +93,7 @@ public class AccessibleButton extends lib.TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); DiagThread psDiag = new DiagThread(xTextDoc, msf); psDiag.start(); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java index b955e3db0303..6b52387b0a7f 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java @@ -97,7 +97,7 @@ public class AccessibleCheckBox extends TestCase { xTextDoc = SOF.createTextDoc(null); } - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); XInterface oObj = null; @@ -108,7 +108,7 @@ public class AccessibleCheckBox extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); log.println("Opening Dialog in second thread"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java index 855fff011783..09452072b1b5 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java @@ -117,7 +117,7 @@ public class AccessibleComboBox extends TestCase { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); } - util.utils.pause(Param.getInt("ShortWait")); + util.utils.waitForEventIdle(Param.getMSF()); AccessibilityTools.printAccessibleTree(log, xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)); oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "", diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java index 284f7a554494..3daf7f9f2151 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleDropDownListBox.java @@ -73,7 +73,7 @@ public class AccessibleDropDownListBox extends TestCase { PrintWriter log) { XInterface oObj = null; - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = AccessibilityTools.getCurrentWindow( xTextDoc); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java index 1372f1dc6e25..935df4482fa7 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java @@ -123,7 +123,7 @@ public class AccessibleEdit extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java index 5ca277cf63aa..fc2aca6a36df 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java @@ -129,7 +129,7 @@ public class AccessibleFixedText extends TestCase { oObj = (XInterface) Param.getMSF().createInstance( "com.sun.star.awt.Toolkit"); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWinDlg); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java index c390dd00255d..2d800168fb31 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java @@ -69,7 +69,7 @@ public class AccessibleList extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -99,8 +99,6 @@ public class AccessibleList extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(1000); - XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -121,7 +119,7 @@ public class AccessibleList extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); log.println("# Getting the ListBox"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java index 3316a7968275..b829eee9ee62 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java @@ -92,7 +92,7 @@ public class AccessibleListBox extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -122,7 +122,7 @@ public class AccessibleListBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -145,7 +145,7 @@ public class AccessibleListBox extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL, "", "com.sun.star.comp.toolkit.AccessibleListBox"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java index 63e1cab1e66b..b14b56468404 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java @@ -90,7 +90,7 @@ public class AccessibleListItem extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -120,7 +120,7 @@ public class AccessibleListItem extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -142,7 +142,7 @@ public class AccessibleListItem extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.LIST_ITEM,"Spr"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java index e5ff3fb8e69b..e452adf0e732 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java @@ -79,14 +79,14 @@ public class AccessibleMenu extends TestCase { * walking through the accessible component tree of a document. */ @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, + protected TestEnvironment createTestEnvironment(final TestParameters Param, PrintWriter log) throws Exception { XMultiServiceFactory msf = Param.getMSF(); SOfficeFactory SOF = SOfficeFactory.getFactory(msf); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); @@ -120,7 +120,7 @@ public class AccessibleMenu extends TestCase { try { act2.doAccessibleAction(0); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); act1.doAccessibleAction(0); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java index 5b91847a95cf..ab730c631d55 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java @@ -71,7 +71,7 @@ public class AccessibleMenuBar extends TestCase { @Override protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java index ef64304715d6..9f36d0f90a97 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java @@ -86,7 +86,7 @@ public class AccessibleMenuItem extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); Object atw = tk.getActiveTopWindow(); @@ -105,10 +105,9 @@ public class AccessibleMenuItem extends TestCase { XAccessibleAction act = UnoRuntime.queryInterface( XAccessibleAction.class, Menu); act.doAccessibleAction(0); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); - - //get a menue-item + //get a menu-item oObj = Menu.getAccessibleContext().getAccessibleChild(11); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { } diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java index f78335981175..3000e38dbe6d 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java @@ -73,7 +73,7 @@ public class AccessibleMenuSeparator extends TestCase { @Override protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); @@ -93,10 +93,9 @@ public class AccessibleMenuSeparator extends TestCase { XAccessibleAction.class, Menu); act.doAccessibleAction(0); - util.utils.pause(500); + util.utils.waitForEventIdle(Param.getMSF()); - - //get a menue-separator + //get a menu-separator oObj = Menu.getAccessibleContext().getAccessibleChild(3); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java index b6a7f71d98c7..ed7d506c23bb 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java @@ -123,8 +123,6 @@ public class AccessiblePopupMenu extends TestCase { toolkit = (XInterface) tParam.getMSF().createInstance( "com.sun.star.awt.Toolkit"); - util.utils.shortWait(); - XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); XInterface oObj = null; diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java index f74d3eb1c3e1..56ba232676a0 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java @@ -160,7 +160,7 @@ public class AccessibleRadioButton extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(2000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -190,7 +190,7 @@ public class AccessibleRadioButton extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(2000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF().createInstance( "com.sun.star.awt.Toolkit"); @@ -198,7 +198,7 @@ public class AccessibleRadioButton extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(2000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java index ca68609f2561..a96933bd3134 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java @@ -152,7 +152,7 @@ public class AccessibleTabControl extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(500); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -182,7 +182,7 @@ public class AccessibleTabControl extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(500); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = (XInterface) tParam.getMSF().createInstance( "com.sun.star.awt.Toolkit"); @@ -190,7 +190,7 @@ public class AccessibleTabControl extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(500); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java index c7ebc5e0ffb5..1069383ccdd8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java @@ -94,7 +94,7 @@ public class AccessibleTabPage extends TestCase { if (accCloseButton != null) { log.println("closing InsertFields Dialog"); accCloseButton.doAccessibleAction(0); - util.utils.pause(1000); + util.utils.waitForEventIdle(Param.getMSF()); } } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); @@ -137,7 +137,7 @@ public class AccessibleTabPage extends TestCase { if (accCloseButton != null) { log.println("closing InsertFields Dialog"); accCloseButton.doAccessibleAction(0); - util.utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); } } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); @@ -158,7 +158,7 @@ public class AccessibleTabPage extends TestCase { log.println("creating a text document"); xTextDoc = SOF.createTextDoc(null); - util.utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -188,7 +188,7 @@ public class AccessibleTabPage extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface oObj = null; @@ -198,7 +198,7 @@ public class AccessibleTabPage extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -226,7 +226,7 @@ public class AccessibleTabPage extends TestCase { oObj); accComp.getLocationOnScreen(); - util.utils.pause(1000); + util.utils.waitForEventIdle(tParam.getMSF()); XInterface xEventInt = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables"); final XAccessibleComponent eventAccComp = UnoRuntime.queryInterface( diff --git a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java index 128d9998ee73..1dd4c9be253e 100644 --- a/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java +++ b/qadevOOo/tests/java/mod/_toolkit/UnoControlContainer.java @@ -49,7 +49,6 @@ import util.utils; public class UnoControlContainer extends TestCase { private static XTextDocument xTextDoc; private static XTextDocument xTD2; - private static XControl xCtrl; private static XControl xCtrl1; private static XControl xCtrl2; @@ -104,7 +103,7 @@ public class UnoControlContainer extends TestCase { access = UnoRuntime.queryInterface( XControlAccess.class, xTextDoc.getCurrentController()); - xCtrl = access.getControl(model); + access.getControl(model); // create second XControl diff --git a/sc/qa/complex/calcPreview/ViewForwarder.java b/sc/qa/complex/calcPreview/ViewForwarder.java index ea74e4132aa9..2c23a43cf86a 100644 --- a/sc/qa/complex/calcPreview/ViewForwarder.java +++ b/sc/qa/complex/calcPreview/ViewForwarder.java @@ -235,7 +235,7 @@ public class ViewForwarder { return; } - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); System.out.println("Press any key after resizing "); try{ @@ -277,7 +277,7 @@ public class ViewForwarder { System.out.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width); System.out.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height); - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); System.out.println("Press any key when the second line is on top"); try{ @@ -639,7 +639,7 @@ public class ViewForwarder { return; } - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); System.out.println("Press any key after resizing "); try{ @@ -681,7 +681,7 @@ public class ViewForwarder { System.out.println("P-Parent-BoundsWidth= "+accPPC.getBounds().Width); System.out.println("P-Parent-BoundsHeight= "+accPPC.getBounds().Height); - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); System.out.println("Press any key when the header is not visible."); try{ @@ -845,7 +845,7 @@ public class ViewForwarder { return; } - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); XWindow xWindow = AccessibilityTools.getCurrentWindow(xModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -924,7 +924,7 @@ public class ViewForwarder { return; } - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); xSpreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class, xComp); @@ -957,7 +957,7 @@ public class ViewForwarder { return; } - util.utils.pause(500); + util.utils.waitForEventIdle(mXMSF); System.out.println("Press any key when a shape is on top."); try{ diff --git a/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java index 356c59579041..c639ca168a2a 100644 --- a/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java +++ b/sfx2/qa/complex/sfx2/GlobalEventBroadcaster.java @@ -104,7 +104,7 @@ public class GlobalEventBroadcaster { notifyEvents.clear(); { XTextDocument xTextDoc = wHelper.openEmptyDoc(); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus" }; assertTrue("Wrong events fired when opening empty doc", @@ -114,7 +114,7 @@ public class GlobalEventBroadcaster { System.out.println("changing the writer doc"); notifyEvents.clear(); xTextDoc.getText().setString("GlobalEventBroadcaster"); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); expected = new String[] { "OnModifyChanged" }; assertTrue("Wrong events fired when changing doc", @@ -124,7 +124,7 @@ public class GlobalEventBroadcaster { System.out.println("closing the empty writer doc"); notifyEvents.clear(); wHelper.closeDoc(xTextDoc); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); } expected = new String[] { "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; @@ -137,7 +137,7 @@ public class GlobalEventBroadcaster { { XTextDocument xTextDoc = wHelper.openFromDialog(".uno:NewWindow", "", false); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); expected = new String[] { "OnUnfocus", "OnCreate", "OnViewCreated", "OnFocus", "OnUnfocus", "OnViewCreated", "OnFocus", }; assertTrue("Wrong events fired when opening an writer doc via Window-New Window", @@ -148,7 +148,7 @@ public class GlobalEventBroadcaster { notifyEvents.clear(); wHelper.closeDoc(xTextDoc); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); } expected = new String[] { "OnViewClosed", "OnUnfocus", "OnFocus", "OnViewClosed", "OnUnload" }; @@ -161,7 +161,7 @@ public class GlobalEventBroadcaster { if (false) { System.out.println("Opening document with label wizard"); XTextDocument xTextDoc = wHelper.openFromDialog("private:factory/swriter?slot=21051", "", false); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, wHelper.getToolkit().getActiveTopWindow()); UITools ut = new UITools(xWindow); notifyEvents.clear(); @@ -172,9 +172,7 @@ public class GlobalEventBroadcaster { System.out.println("Couldn't press Button"); } System.out.println("... done"); - util.utils.pause(2000); - util.utils.pause(2000); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); expected = new String[] { "OnViewClosed", "OnCreate", "OnFocus", "OnModifyChanged" }; assertTrue("Wrong events fired when starting labels wizard", @@ -182,9 +180,9 @@ public class GlobalEventBroadcaster { System.out.println("Try to close document..."); wHelper.closeDoc(xTextDoc); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); wHelper.closeFromDialog(); - util.utils.pause(2000); + util.utils.waitForEventIdle(m_xMSF); xTextDoc = null; } diff --git a/sfx2/qa/complex/sfx2/tools/WriterHelper.java b/sfx2/qa/complex/sfx2/tools/WriterHelper.java index 74b1c3277194..d0d47ce64485 100644 --- a/sfx2/qa/complex/sfx2/tools/WriterHelper.java +++ b/sfx2/qa/complex/sfx2/tools/WriterHelper.java @@ -111,7 +111,7 @@ public class WriterHelper { System.out.println("Couldn't press button"); } - util.utils.pause(4000); + util.utils.waitForEventIdle(m_xMSF); } XDesktop xDesktop = getDesktop(); diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java index f7709b63d560..ccdf2b87ff03 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java @@ -193,7 +193,7 @@ public class AccessibleStatusBar { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -218,17 +218,17 @@ public class AccessibleStatusBar { "com.sun.star.awt.Toolkit") ; XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xIfc); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); System.out.println("...OK."); XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, parentContext); @@ -289,8 +289,8 @@ public class AccessibleStatusBar { System.out.println("*** Now testing XAccessibleEventBroadcaster ***"); _XAccessibleEventBroadcaster _xAccEvBcast = new _XAccessibleEventBroadcaster(testObject, xWindow); - assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener()); - assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener()); + assertTrue("failed: XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(xMSF)); + assertTrue("failed: XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(xMSF)); } diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java index 530351e65b93..524aaf5148ee 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java @@ -196,7 +196,7 @@ public class AccessibleStatusBarItem { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -222,18 +222,18 @@ public class AccessibleStatusBarItem { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); xWindow = UnoRuntime.queryInterface( XWindow.class,tk.getActiveTopWindow()); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); if ( parentContext == null ) { fail("Could not create a test object."); } @@ -312,8 +312,8 @@ public class AccessibleStatusBarItem { System.out.println("*** Now testing XAccessibleEventBroadcaster ***"); _XAccessibleEventBroadcaster _xAccEvBcast = new _XAccessibleEventBroadcaster(object, xWindow); - assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener()); - assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener()); + assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::addEventListener", _xAccEvBcast._addEventListener(xMSF)); + assertTrue("failed: "+accName+" - XAccessibleEventBroadcaster::removeEventListener", _xAccEvBcast._removeEventListener(xMSF)); System.out.println("*** Now testing XAccessibleText ***"); _XAccessibleText _xAccText = diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java index 323553b754a4..fe48a6cb86b3 100644 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java @@ -18,18 +18,19 @@ package complex.toolkit.accessibility; -import com.sun.star.lang.EventObject; -import com.sun.star.awt.Rectangle; -import com.sun.star.awt.PosSize; -import com.sun.star.awt.XWindow; import com.sun.star.accessibility.AccessibleEventObject; import com.sun.star.accessibility.AccessibleStateType; import com.sun.star.accessibility.XAccessible; +import com.sun.star.accessibility.XAccessibleContext; import com.sun.star.accessibility.XAccessibleEventBroadcaster; import com.sun.star.accessibility.XAccessibleEventListener; -import com.sun.star.accessibility.XAccessibleContext; -import com.sun.star.uno.XInterface; +import com.sun.star.awt.PosSize; +import com.sun.star.awt.Rectangle; +import com.sun.star.awt.XWindow; +import com.sun.star.lang.EventObject; +import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.XInterface; /** * Testing <code> @@ -108,14 +109,14 @@ public class _XAccessibleEventBroadcaster { * Adds two listeners and fires event by mean of object relation. <p> * Has <b> OK </b> status if both listeners were called */ - public boolean _addEventListener() { + public boolean _addEventListener(XMultiServiceFactory xMSF) { System.out.println("adding two listeners"); oObj.addAccessibleEventListener(list); boolean isTransient = chkTransient(oObj); System.out.println("fire event"); prod.fireEvent() ; - util.utils.pause(1500); + util.utils.waitForEventIdle(xMSF); boolean works = true; @@ -143,7 +144,7 @@ public class _XAccessibleEventBroadcaster { * <li> <code>addEventListener()</code> : to have added listeners </li> * </ul> */ - public boolean _removeEventListener() { + public boolean _removeEventListener(XMultiServiceFactory xMSF) { list.notifiedEvent = null; @@ -153,7 +154,7 @@ public class _XAccessibleEventBroadcaster { System.out.println("fire event"); prod.fireEvent() ; - util.utils.pause(500); + util.utils.waitForEventIdle(xMSF); if (list.notifiedEvent == null) { System.out.println("listener wasn't called -- OK"); diff --git a/vcl/qa/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java index 99893d6fcf30..ec09cac7a89a 100644 --- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java +++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java @@ -18,16 +18,18 @@ package complex.persistent_window_states; -import com.sun.star.awt.Rectangle; +import helper.WindowListener; + import com.sun.star.awt.PosSize; -import com.sun.star.frame.XComponentLoader; +import com.sun.star.awt.Rectangle; import com.sun.star.awt.XWindow; -import com.sun.star.beans.PropertyValue; import com.sun.star.beans.PropertyState; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.frame.XFrame; +import com.sun.star.beans.PropertyValue; import com.sun.star.frame.FrameSearchFlag; -import helper.WindowListener; +import com.sun.star.frame.XComponentLoader; +import com.sun.star.frame.XFrame; +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.uno.UnoRuntime; /** * Load and resize a document. @@ -57,7 +59,7 @@ public class DocumentHandle { * @param hidden If true, the document is loaded hidden. * @return The size of the opened/created document. */ - public Rectangle loadDocument(String docName, boolean hidden) + public Rectangle loadDocument(XMultiServiceFactory xMSF, String docName, boolean hidden) throws Exception{ wl.resetTrigger(); try { @@ -85,7 +87,7 @@ public class DocumentHandle { XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame); xFrameLoader.loadComponentFromURL(docName, "_self", 0, szArgs); // wait for the document to load. - util.utils.pause(10000); + util.utils.waitForEventIdle(xMSF); xWin = xFrame.getContainerWindow(); xWin.addWindowListener(wl); @@ -123,13 +125,13 @@ public class DocumentHandle { * Y-Position +10 pixel * @return True if resize worked. */ - public boolean resizeDocument() { + public boolean resizeDocument(XMultiServiceFactory xMSF) { Rectangle newPosSize = xWin.getPosSize(); newPosSize.Width = newPosSize.Width - 20; newPosSize.Height = newPosSize.Height - 20; newPosSize.X = newPosSize.X + 80; newPosSize.Y = newPosSize.Y + 80; - return resizeDocument(newPosSize); + return resizeDocument(xMSF, newPosSize); } /** @@ -137,11 +139,11 @@ public class DocumentHandle { * @param newPosSize The new position and size of the window. * @return True if resize worked. */ - private boolean resizeDocument(Rectangle newPosSize){ + private boolean resizeDocument(XMultiServiceFactory xMSF, Rectangle newPosSize){ wl.resetTrigger(); xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, newPosSize.Height, PosSize.POSSIZE); - util.utils.pause(3000); + util.utils.waitForEventIdle(xMSF); return wl.resizedTrigger; } } diff --git a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java index fd91beb4617d..5f2df615d82c 100644 --- a/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java +++ b/vcl/qa/complex/persistent_window_states/PersistentWindowTest.java @@ -120,7 +120,7 @@ public class PersistentWindowTest Rectangle rect1 = handle.getDocumentPosSize(); // resize - handle.resizeDocument(); + handle.resizeDocument(getMSF()); // after resize Rectangle rect2 = handle.getDocumentPosSize(); @@ -269,7 +269,7 @@ public class PersistentWindowTest } } docHandle = new DocumentHandle(xCompLoader); - docHandle.loadDocument(docLoader, false); + docHandle.loadDocument(xMSF, docLoader, false); } catch (com.sun.star.uno.Exception e) { |