diff options
author | Noel Grandin <noel@peralex.com> | 2014-12-22 10:02:49 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-01-12 08:36:17 +0200 |
commit | 09330056a01a4b5c3d16e3ffb6c1bff36099eb83 (patch) | |
tree | efa793bee83eed4081edd52737e73216a3048b89 /qadevOOo | |
parent | 4bf4e3d40778051f1f886c47dd2b2bef82acf1e5 (diff) |
java: simplify sleeping and waiting in tests
- remove the SHORT_WAIT test parameter, no-one is using it
- inline the various independent shortWait() methods
- use the util.utils.shortWait() utility method everywhere
Change-Id: I93cd4a2580172a1441d2ff3d390f52b9505e2721
Diffstat (limited to 'qadevOOo')
128 files changed, 295 insertions, 1240 deletions
diff --git a/qadevOOo/runner/base/java_fat.java b/qadevOOo/runner/base/java_fat.java index 78bcc38fb910..bc63f40b4dfb 100644 --- a/qadevOOo/runner/base/java_fat.java +++ b/qadevOOo/runner/base/java_fat.java @@ -133,7 +133,7 @@ public class java_fat implements TestBase continue; } - util.utils.shortWait(2000); + util.utils.pause(2000); System.out.println("Creating: " + entry.entryName); @@ -430,7 +430,7 @@ public class java_fat implements TestBase if (ph != null) { m_aOffice.closeExistingOffice(m_aParams, true); - util.utils.shortWait(5000); + util.utils.pause(5000); } } diff --git a/qadevOOo/runner/helper/LoggingThread.java b/qadevOOo/runner/helper/LoggingThread.java index 590a467a7134..6878fbc8c708 100644 --- a/qadevOOo/runner/helper/LoggingThread.java +++ b/qadevOOo/runner/helper/LoggingThread.java @@ -70,14 +70,11 @@ public class LoggingThread extends Thread { * finished the LoggingThread */ public void finish() { - try { - finished = true; - synchronized (this) { - notify(); - } - if (debug) log.println("TimeOutLogger: " + utils.getDateTime() + " try to finish "); - sleep(1000); - } catch (InterruptedException ex) { + finished = true; + synchronized (this) { + notify(); } + if (debug) log.println("TimeOutLogger: " + utils.getDateTime() + " try to finish "); + util.utils.pause(1000); } } diff --git a/qadevOOo/runner/helper/OfficeProvider.java b/qadevOOo/runner/helper/OfficeProvider.java index 4496fec9d43f..19890e93edcb 100644 --- a/qadevOOo/runner/helper/OfficeProvider.java +++ b/qadevOOo/runner/helper/OfficeProvider.java @@ -262,13 +262,7 @@ public class OfficeProvider implements AppProvider } if (msf == null) { - try - { - Thread.sleep(500L * k); - } - catch (InterruptedException ex) - { - } + util.utils.pause(500 * k); } k++; } @@ -762,15 +756,8 @@ public class OfficeProvider implements AppProvider { System.out.println(utils.getDateTime() + "OfficeProvider:Owp: ping "); ow.ping(); - try - { - System.out.println(utils.getDateTime() + "OfficeProvider:Owp: sleep "); - OfficeWatcherPing.sleep(1000); // 5000 - } - catch (InterruptedException ex) - { - ex.printStackTrace(); - } + System.out.println(utils.getDateTime() + "OfficeProvider:Owp: sleep "); + util.utils.pause(1000); } } diff --git a/qadevOOo/runner/helper/OfficeWatcher.java b/qadevOOo/runner/helper/OfficeWatcher.java index 60900c0052bd..241115e775bd 100644 --- a/qadevOOo/runner/helper/OfficeWatcher.java +++ b/qadevOOo/runner/helper/OfficeWatcher.java @@ -65,7 +65,7 @@ public class OfficeWatcher extends Thread implements share.Watcher { while (!isDone) { timeOut = params.getInt("TimeOut"); final int previous = StoredPing; - shortWait(timeOut == 0 ? 30000 : timeOut); + util.utils.pause(timeOut == 0 ? 30000 : timeOut); // a timeout with value 0 lets watcher not react. if ((StoredPing == previous) && timeOut != 0) { isDone = true; @@ -95,17 +95,10 @@ public class OfficeWatcher extends Thread implements share.Watcher { } else { dbg("reaeched timeout but ProcessHandler is NULL"); } - shortWait(timeOut == 0 ? 30000 : timeOut); + util.utils.pause(timeOut == 0 ? 30000 : timeOut); dbg("finished"); } - private void shortWait(int timeOut) { - try { - OfficeWatcher.sleep(timeOut); - } catch (InterruptedException ie) { - } - } - private void dbg(String message) { if (debug) { System.out.println(utils.getDateTime() + "OfficeWatcher: " + message); diff --git a/qadevOOo/runner/helper/ProcessHandler.java b/qadevOOo/runner/helper/ProcessHandler.java index 1be600d54993..10241a3b9410 100644 --- a/qadevOOo/runner/helper/ProcessHandler.java +++ b/qadevOOo/runner/helper/ProcessHandler.java @@ -329,13 +329,7 @@ public class ProcessHandler { m_aProcess.destroy(); - try - { - Thread.sleep(1000L * counter); // 5000 - } - catch (InterruptedException e) - { - } + util.utils.pause(1000 * counter); try { final int exit_Value = m_aProcess.exitValue(); @@ -664,14 +658,7 @@ public class ProcessHandler while (m_nTimeoutInSec > 0) { m_nTimeoutInSec--; - try - { - sleep(1000); - } - catch(InterruptedException e) - { - // interrupt flag is set back to 'not interrupted' :-( - } + util.utils.pause(1000); if (isInHoldOn()) { break; diff --git a/qadevOOo/runner/helper/UnoProvider.java b/qadevOOo/runner/helper/UnoProvider.java index 78430d195bf3..d5d18c38fb72 100644 --- a/qadevOOo/runner/helper/UnoProvider.java +++ b/qadevOOo/runner/helper/UnoProvider.java @@ -70,10 +70,7 @@ public class UnoProvider implements AppProvider { public boolean disposeManager(TestParameters param) { param.remove("ServiceManager"); System.gc(); - try { - Thread.sleep(1000); - } - catch(InterruptedException e) {} + util.utils.pause(1000); return true; } diff --git a/qadevOOo/runner/lib/TestParameters.java b/qadevOOo/runner/lib/TestParameters.java index 57501c140c06..33fbd301d7e7 100644 --- a/qadevOOo/runner/lib/TestParameters.java +++ b/qadevOOo/runner/lib/TestParameters.java @@ -151,7 +151,6 @@ public class TestParameters extends HashMap<String,Object> { put(PropertyName.LOGGING_IS_ACTIVE, Boolean.TRUE); put(PropertyName.DEBUG_IS_ACTIVE, Boolean.valueOf(DebugIsActive)); put(PropertyName.OUT_PRODUCER, "stats.SimpleOutProducer"); - put(PropertyName.SHORT_WAIT, Integer.valueOf(500)); put(PropertyName.OFFICE_PROVIDER, "helper.OfficeProvider"); put(PropertyName.LOG_WRITER, "stats.SimpleLogWriter"); put(PropertyName.APP_EXECUTION_COMMAND, ""); diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index d61ba4bc70f8..1f6f6cfeedbc 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -402,7 +402,7 @@ public class DesktopTools oViewProp.setPropertyValue("ZoomType", Short.valueOf(com.sun.star.view.DocumentZoomType.ENTIRE_PAGE)); - utils.shortWait(5000); + utils.pause(5000); } catch (Exception e) { diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index 141fee9e305e..4207d4fe1669 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -67,10 +67,9 @@ public interface PropertyName { */ String OUT_PRODUCER = "OutProducer"; /** - * parameter name: "ShortWait" - * Short wait time for the Office: default is 500 milliseconds + * Default short wait time for the Office */ - String SHORT_WAIT= "ShortWait"; + int DEFAULT_SHORT_WAIT_MS = 500; /** * internal only, no parameter * The OfficeProvider contains the full qualified diff --git a/qadevOOo/runner/util/utils.java b/qadevOOo/runner/util/utils.java index 76d1666f248d..4557cb5484e5 100644 --- a/qadevOOo/runner/util/utils.java +++ b/qadevOOo/runner/util/utils.java @@ -645,10 +645,15 @@ public class utils { } /** Causes the thread to sleep some time. - * It can be used f.e. like: - * util.utils.shortWait(tParam.getInt("ShortWait")); + * This is the default call, which waits for 500ms. */ - public static void shortWait(int milliseconds) { + public static void shortWait() { + pause(PropertyName.DEFAULT_SHORT_WAIT_MS); + } + + /** Causes the thread to sleep some time. + */ + public static void pause(int milliseconds) { try { Thread.sleep(milliseconds); } catch (InterruptedException e) { @@ -827,7 +832,7 @@ public class utils { XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0); xDispatcher.dispatch(aURL, null); - utils.shortWait(3000); + utils.pause(3000); } 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 98a0309d867a..3002dbe8ced4 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java @@ -114,11 +114,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { log.println("fire event"); prod.fireEvent() ; - try { - Thread.sleep(3000); - } - catch (InterruptedException ex) { - } + util.utils.pause(3000); boolean works = true; @@ -163,11 +159,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest { log.println("fire event"); prod.fireEvent() ; - try { - Thread.sleep(500); - } - catch (InterruptedException ex) { - } + util.utils.shortWait(); 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 de8787871b8f..fdb7d2fb8c89 100644 --- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java +++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java @@ -212,7 +212,7 @@ public class _XAccessibleSelection extends MultiMethodTest { if (isSelectable(tEnv.getTestObject(), k)) { oObj.selectAccessibleChild(k); - shortWait(); + util.utils.shortWait(); isSelected = oObj.isAccessibleChildSelected(k); log.println("isAccessibleChildSelected - " + isSelected); @@ -247,7 +247,7 @@ public class _XAccessibleSelection extends MultiMethodTest { // clearAccessibleSelection() call is oneway so we need // some waiting - shortWait(); + util.utils.shortWait(); if ((childCount > 0) && !OneAlwaysSelected) { try { @@ -284,7 +284,7 @@ public class _XAccessibleSelection extends MultiMethodTest { // selectAllAccessibleChildren() call is oneway so we need // some waiting - shortWait(); + util.utils.shortWait(); boolean res = true; boolean isSelected = true; @@ -435,7 +435,7 @@ public class _XAccessibleSelection extends MultiMethodTest { if (isSelectable(tEnv.getTestObject(), k)) { oObj.selectAccessibleChild(k); - shortWait(); + util.utils.shortWait(); log.println("selected child count: " + oObj.getSelectedAccessibleChildCount()); XAccessible selChild = oObj.getSelectedAccessibleChild(0); @@ -583,11 +583,4 @@ public class _XAccessibleSelection extends MultiMethodTest { return res; } - - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException ex) { - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java index 70b4d9322e04..b61bb04a3749 100644 --- a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java +++ b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java @@ -144,9 +144,7 @@ public class _XImageProducer extends MultiMethodTest { oObj.startProduction() ; - try { - Thread.sleep(500) ; - } catch (InterruptedException e) {} + util.utils.shortWait(); tRes.tested("startProduction()", consumer.initCalled) ; } diff --git a/qadevOOo/tests/java/ifc/awt/_XItemListener.java b/qadevOOo/tests/java/ifc/awt/_XItemListener.java index 8bd31ed04ba8..9e0527b5288e 100644 --- a/qadevOOo/tests/java/ifc/awt/_XItemListener.java +++ b/qadevOOo/tests/java/ifc/awt/_XItemListener.java @@ -95,9 +95,7 @@ public class _XItemListener extends MultiMethodTest { event.Highlighted = 2 ; oObj.itemStateChanged(event) ; - try { - Thread.sleep(200) ; - } catch (InterruptedException e) {} + util.utils.pause(200); 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 306fed422425..b1900464749a 100644 --- a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java +++ b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java @@ -117,9 +117,7 @@ public class _XRadioButton extends MultiMethodTest { boolean result = true ; oObj.setState(!state) ; - try { - Thread.sleep(200) ; - } catch (InterruptedException e) {} + util.utils.pause(200); result = oObj.getState() == !state ; diff --git a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java index f385db27719e..9c78eec7ff9b 100644 --- a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java +++ b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java @@ -39,7 +39,7 @@ public class _XScrollBar extends MultiMethodTest { public void _addAdjustmentListener() { util.FormTools.switchDesignOf(tParam.getMSF(), (XTextDocument) tEnv.getObjRelation("Document")); - shortWait(); + util.utils.shortWait(); oObj.addAdjustmentListener(listener); adjustScrollBar(); @@ -167,7 +167,7 @@ public class _XScrollBar extends MultiMethodTest { sc.setValue(500); - shortWait(); + util.utils.shortWait(); XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); @@ -186,18 +186,7 @@ public class _XScrollBar extends MultiMethodTest { System.out.println("couldn't adjust scrollbar"); } - shortWait(); - } - - /** - * Sleeps for 0.5 sec. to allow Office to react - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } + util.utils.shortWait(); } public class AdjustmentListener diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinField.java b/qadevOOo/tests/java/ifc/awt/_XSpinField.java index c1f2e0eb3aba..d6a9b3a9b59f 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() ; - shortWait(); + util.utils.shortWait(); tRes.tested("up()", listener.upFl) ; } @@ -112,7 +112,7 @@ public class _XSpinField extends MultiMethodTest { requiredMethod("addSpinListener()") ; oObj.down() ; - shortWait(); + util.utils.shortWait(); tRes.tested("down()", listener.downFl) ; } @@ -130,7 +130,7 @@ public class _XSpinField extends MultiMethodTest { requiredMethod("addSpinListener()") ; oObj.first() ; - shortWait(); + util.utils.shortWait(); tRes.tested("first()", listener.firstFl) ; } @@ -148,7 +148,7 @@ public class _XSpinField extends MultiMethodTest { requiredMethod("addSpinListener()") ; oObj.last() ; - shortWait(); + util.utils.shortWait(); tRes.tested("last()", listener.lastFl) ; } @@ -192,16 +192,4 @@ public class _XSpinField extends MultiMethodTest { tRes.tested("enableRepeat()", true) ; } - - /** - * Waits for 0.5 sec to allow listener to be called. - */ - private void shortWait() { - try { - Thread.sleep(500); - } - catch (InterruptedException ex) { - } - - } } diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java index b8a2765627f3..ebf5aa75182a 100644 --- a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java +++ b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java @@ -38,7 +38,7 @@ public class _XSpinValue extends MultiMethodTest { public void _addAdjustmentListener() { util.FormTools.switchDesignOf(tParam.getMSF(), (XTextDocument) tEnv.getObjRelation("Document")); - shortWait(); + util.utils.shortWait(); oObj.addAdjustmentListener(listener); adjustScrollBar(); @@ -158,7 +158,7 @@ public class _XSpinValue extends MultiMethodTest { sv.setValue(500); - shortWait(); + util.utils.shortWait(); XAccessible acc = UnoRuntime.queryInterface( XAccessible.class, tEnv.getTestObject()); @@ -177,18 +177,7 @@ public class _XSpinValue extends MultiMethodTest { System.out.println("couldn't adjust scrollbar"); } - shortWait(); - } - - /** - * Sleeps for 0.5 sec. to allow Office to react - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } + util.utils.shortWait(); } public class AdjustmentListener diff --git a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java index 33f8fdfe10e5..c1a73b656ff3 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java +++ b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java @@ -90,11 +90,7 @@ public class _XTextComponent extends MultiMethodTest { public void _addTextListener(){ oObj.addTextListener(listener); oObj.setText("Listen"); - try { - Thread.sleep(500); - } catch(InterruptedException e) { - e.printStackTrace(log); - } + util.utils.shortWait(); 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 ded65478433d..3a3120802ba3 100644 --- a/qadevOOo/tests/java/ifc/awt/_XTextListener.java +++ b/qadevOOo/tests/java/ifc/awt/_XTextListener.java @@ -98,9 +98,7 @@ public class _XTextListener extends MultiMethodTest { event.dummy1 = 2; oObj.textChanged(event); - try { - Thread.sleep(200) ; - } catch (InterruptedException e) {} + util.utils.pause(200); 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 d82baf23b967..22da48aabd52 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(); - shortWait(); + util.utils.pause(1000); tRes.tested("toFront()", listener.activated && !listener.deactivated); } @@ -186,13 +186,5 @@ public class _XTopWindow extends MultiMethodTest { protected void after() { aTextDoc.dispose(); } - - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } } diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java index 557abd569634..56dbf5369470 100644 --- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java +++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java @@ -33,10 +33,13 @@ import com.sun.star.awt.XWindow; import com.sun.star.frame.XModel; import com.sun.star.lang.EventObject; import com.sun.star.uno.UnoRuntime; + import java.awt.Robot; import java.awt.event.InputEvent; + import lib.MultiMethodTest; import util.AccessibilityTools; +import util.PropertyName; /** * Testing <code>com.sun.star.awt.XUserInputInterception</code> @@ -148,7 +151,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2); + util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2); log.println("key listener thread should be finished."); @@ -211,7 +214,7 @@ public class _XUserInputInterception extends MultiMethodTest { et.run(); - util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2); + util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2); 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 44d3f3646c52..0b7a406badf1 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); } - shortWait(); + util.utils.pause(200); 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(); - shortWait(); + util.utils.pause(200); log.println("set object invisible..."); oObj.setVisible(false); - shortWait(); + util.utils.pause(200); 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() ; - shortWait(); + util.utils.pause(200); log.println("set object visible..."); oObj.setVisible(true) ; - shortWait(); + util.utils.pause(200); 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(); - shortWait(); + util.utils.pause(200); win.setFocus(); - shortWait(); + util.utils.pause(200); 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() ; - shortWait(); + util.utils.pause(200); result &= fListener.gained; if (!fListener.gained) { log.println("Gained focus was not notified about") ; @@ -599,17 +599,5 @@ public class _XWindow extends MultiMethodTest { tRes.tested("removePaintListener()", true); } - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java index 92df9c390bbd..50508ce8c9b6 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 } - waitAMoment(); + util.utils.pause(200); tRes.tested("addPropertiesChangeListener()", propertiesChanged); } @@ -216,7 +216,7 @@ public class _XMultiPropertySet extends MultiMethodTest { propertiesChanged = false ; oObj.firePropertiesChangeEvent(testPropsNames, PClistener); - waitAMoment() ; + util.utils.pause(200); tRes.tested("firePropertiesChangeEvent()", propertiesChanged); } @@ -336,17 +336,6 @@ public class _XMultiPropertySet extends MultiMethodTest { testPropsAmount = nr; } - /** - * Waits some time for listener to be called. - */ - private void waitAMoment() { - try { - Thread.sleep(200) ; - } catch (InterruptedException e) { - log.println("!!! Exception while waiting !!!") ; - } - } - /* * Does nothing. */ diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java index d942b6d02f85..9272f9660437 100644 --- a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java +++ b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java @@ -162,10 +162,7 @@ public class _XBridgeFactory extends MultiMethodTest { acceptorThread = new AcceptorThread(xAccptr) ; acceptorThread.start(); - try { - Thread.sleep(500); - } - catch (InterruptedException e) {} + util.utils.shortWait(); conn = xCntr.connect(connectString) ; } catch (com.sun.star.uno.Exception e) { diff --git a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java index 0cb01dd30f88..db2cd8c9727a 100644 --- a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java +++ b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java @@ -165,10 +165,7 @@ public class _XUnoUrlResolver extends MultiMethodTest { xInstProv, connectStr); brThread.start(); - try { - Thread.sleep(500); - } - catch(InterruptedException e) {} + util.utils.shortWait(); // get an instance from the remote Object obj = oObj.resolve( "uno:" + connectStr + ";urp;com.sun.star.lang.ServiceManager"); diff --git a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java index f939eb2c0d42..f0b5dc850fe0 100644 --- a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java +++ b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java @@ -146,10 +146,7 @@ public class _XAcceptor extends MultiMethodTest { acception = new AcceptorThread(oObj) ; acception.start() ; - try { - Thread.sleep(500); - } - catch (InterruptedException e) {} + util.utils.shortWait(); XConnection con = xConnector.connect(connectString) ; diff --git a/qadevOOo/tests/java/ifc/connection/_XConnector.java b/qadevOOo/tests/java/ifc/connection/_XConnector.java index adc8a044e711..5d63fafd2fc6 100644 --- a/qadevOOo/tests/java/ifc/connection/_XConnector.java +++ b/qadevOOo/tests/java/ifc/connection/_XConnector.java @@ -127,10 +127,7 @@ public class _XConnector extends MultiMethodTest { acceptorThread = new AcceptorThread(xAcceptor) ; acceptorThread.start() ; - try { - Thread.sleep(500); - } - catch (InterruptedException e) {} + util.utils.shortWait(); // connect to acceptor try { diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java index f3277e9da837..78b8d79140ec 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); - shortWait(); + util.utils.pause(1000); int count = CC.getControls().length; CC.removeControl(CC.getControl("NewControl")); - shortWait(); + util.utils.pause(1000); return count>precount; } @@ -337,18 +337,6 @@ public class _XContainer extends MultiMethodTest { return res; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } } diff --git a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java index 5b5e8f8de987..99e3d609a74e 100644 --- a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java +++ b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java @@ -75,10 +75,7 @@ public class _XIndexAccess extends MultiMethodTest { requiredMethod("getCount()"); // get count from holder - try { - Thread.sleep(200); - } - catch(InterruptedException e) {} + util.utils.pause(200); 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 b2b3ff3bb4ca..12e54b665a70 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.shortWait(1000); + util.utils.pause(1000); 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.shortWait(1000); + util.utils.pause(1000); tRes.tested("addEventListener()",listenerCalled); } @@ -67,7 +67,7 @@ public class _XEventBroadcaster extends MultiMethodTest { listenerCalled = false; oObj.removeEventListener(listener); switchFocus(); - util.utils.shortWait(1000); + util.utils.pause(1000); tRes.tested("removeEventListener()",!listenerCalled); } diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java index 70eccdc4f3a2..5f93420c1362 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() ; - shortWait(); + util.utils.pause(2000); win2.setFocus(); XTextComponent TC = UnoRuntime.queryInterface (XTextComponent.class,tEnv.getObjRelation("CONTROL")); TC.setText("NOXChangeBroadcaster"); - shortWait(); + util.utils.pause(2000); tRes.tested("addChangeListener()", changed); } @@ -156,23 +156,11 @@ public class _XChangeBroadcaster extends MultiMethodTest { changeContent() ; win2.setFocus(); - shortWait(); + util.utils.pause(2000); tRes.tested("removeChangeListener()", !changed); } /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - - /** * Changes the content of the component depending on whether * <code>XTextComponent</code> is supported or not. If yes * then the text is chahged, if not the relation <code>change()</code> diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java index 241df1c5c969..f8024d17e664 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(); - shortWait(); + util.utils.pause(1000); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); otherWind.setFocus(); - shortWait(); + util.utils.pause(1000); 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(); - shortWait(); + util.utils.pause(1000); XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow"); otherWind.setFocus(); - shortWait(); + util.utils.pause(1000); log.println("activated = " + listener.activated + ", deactivated = " + listener.deactivated) ; @@ -148,17 +148,5 @@ public class _XFormController extends MultiMethodTest { tRes.tested("getCurrentControl()", res) ; } - - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } } diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java index 27729c2b30c1..da8f57bb140e 100644 --- a/qadevOOo/tests/java/ifc/form/_XLoadable.java +++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java @@ -99,15 +99,6 @@ public class _XLoadable extends MultiMethodTest { } /** - * Waits for 0.1 second. Used to get time for load completion. - */ - private void shortWait() { - try { - Thread.sleep(100); - } catch (InterruptedException e) {} - } - - /** * Loads the form. <p> * Has <b> OK </b> status if <code>isLoaded()</code> returns * <code>true</code> and listener method <code>loaded()</code> @@ -126,7 +117,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.load() ; - shortWait() ; + util.utils.pause(100); result = oObj.isLoaded() && loadListener.loadedCalled ; tRes.tested("load()", result) ; @@ -151,7 +142,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.unload() ; - shortWait() ; + util.utils.pause(100); result = !oObj.isLoaded() && loadListener.unloadedCalled ; tRes.tested("unload()", result) ; @@ -176,7 +167,7 @@ public class _XLoadable extends MultiMethodTest { boolean result = true ; oObj.reload() ; - shortWait() ; + util.utils.pause(100); 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 f61c114acdbc..033b9a3d1b2a 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(); - shortWait(); + util.utils.shortWait(); tRes.tested("reset()", (approveReset[0] && (! resetted[0]))); approve = true; oObj.reset(); - shortWait(); + util.utils.shortWait(); tRes.tested("addResetListener()", (approveReset[1] && resetted[1])); } // finished _reset @@ -159,23 +159,11 @@ public class _XReset extends MultiMethodTest { approveReset[0] = resetted[0] = false; oObj.removeResetListener(listener1); oObj.reset(); - shortWait(); + util.utils.shortWait(); tRes.tested("removeResetListener()", !approveReset[0] && !resetted[0]); //removing the second listener here may avoid crashing the office } // finished _removeResetListener() - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } // finished class _XRefresh diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java index 7cec878a2c03..bfe3c2ba0611 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()); - shortWait(); + util.utils.pause(200); log.println("Listener1 called " + listener1.called + " times"); log.println("Listener2 called " + listener2.called + " times"); @@ -160,18 +160,6 @@ public class _XSubmit extends MultiMethodTest { } /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(200) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - - /** * Forces environment recreation. */ @Override diff --git a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java index fbd9def90b75..34ca21809240 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() ; - shortWait() ; + util.utils.pause(200); checker.commit() ; - shortWait() ; + util.utils.pause(200); boolean committed = checker.wasCommited() ; - shortWait() ; + util.utils.pause(200); bResult = listener.approveCalled && ! listener.updateCalled && @@ -152,18 +152,18 @@ public class _XUpdateBroadcaster extends MultiMethodTest { (listener.updateCalled ? "":"NOT")+" called, the value was " + (committed ? "" : "NOT") + " committed.") ; - shortWait() ; + util.utils.pause(200); listener.init() ; listener.approve = true ; - shortWait() ; + util.utils.pause(200); checker.update() ; - shortWait() ; + util.utils.pause(200); checker.commit() ; - shortWait() ; + util.utils.pause(200); committed = checker.wasCommited() ; - shortWait() ; + util.utils.pause(200); 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() ; - shortWait() ; + util.utils.pause(200); checker.commit() ; - shortWait() ; + util.utils.pause(200); bResult = ! listener.approveCalled && ! listener.updateCalled ; @@ -219,15 +219,6 @@ public class _XUpdateBroadcaster extends MultiMethodTest { tRes.tested("removeUpdateListener()", bResult); } - private void shortWait() { - try { - Thread.sleep(200); - } - catch (InterruptedException ex) { - } - - } - /** * Forces environment recreation. */ diff --git a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java index c93424d318df..194319580c7f 100644 --- a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java +++ b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java @@ -110,11 +110,7 @@ public class _XSubmission extends MultiMethodTest { log.println("Sleeping 2s"); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - // sleeping didn't work - } + util.utils.pause(2000); log.println("... done"); diff --git a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java index 8422b8682448..fdcb31fd0940 100644 --- a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java @@ -65,11 +65,7 @@ public class _XComponentLoader extends MultiMethodTest { oDoc = oObj.loadComponentFromURL( url, frameName, 0, szArgs); - try { - Thread.sleep(500); - } - catch (InterruptedException ex) { - } + util.utils.shortWait(); oDoc.dispose(); @@ -78,11 +74,7 @@ public class _XComponentLoader extends MultiMethodTest { oDoc = oObj.loadComponentFromURL( url, frameName, 0, szArgs); - try { - Thread.sleep(500); - } - catch (InterruptedException ex) { - } + util.utils.shortWait(); oDoc.dispose(); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatch.java b/qadevOOo/tests/java/ifc/frame/_XDispatch.java index f686150ab870..59dfe64c3101 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatch.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatch.java @@ -130,10 +130,7 @@ public class _XDispatch extends MultiMethodTest { notificationListener = new TestNotificationListener(log) ; xND.dispatchWithNotification(url, arguments, notificationListener); - try { - Thread.sleep(200); - } - catch(InterruptedException e) {} + util.utils.pause(200); log.println(" Listener called: "+ notificationListener.finishedDispatch); @@ -174,10 +171,7 @@ public class _XDispatch extends MultiMethodTest { oObj.dispatch(url, new PropertyValue[0]) ; - try { - Thread.sleep(200); - } - catch(InterruptedException e) {} + util.utils.pause(200); log.println("Listener called: "+ listener.statusChangedCalled); @@ -219,10 +213,7 @@ public class _XDispatch extends MultiMethodTest { oObj.dispatch(url, new PropertyValue[0]) ; - try { - Thread.sleep(200); - } - catch(InterruptedException e) {} + util.utils.pause(200); 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 03225e4170e2..f9b9bbe65ae2 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java @@ -86,7 +86,7 @@ public class _XDispatchRecorder extends MultiMethodTest { XDispatch xDisp = xDispProv.queryDispatch(dispURL, "", 0); xDisp.dispatch(dispURL, dispArgs); - shortWait(); + util.utils.shortWait(); log.println("Getting macro ... :"); String macro = oObj.getRecordedMacro(); @@ -195,12 +195,6 @@ public class _XDispatchRecorder extends MultiMethodTest { } - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} - } - private void clearBuffer() { oObj.startRecording(xFrame); oObj.endRecording(); diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java index f92f366e0683..938c298296e5 100644 --- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java +++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java @@ -173,9 +173,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest { } } - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} + util.utils.shortWait(); 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 1771e3d8faf0..c24c4fa2145e 100644 --- a/qadevOOo/tests/java/ifc/frame/_XFrame.java +++ b/qadevOOo/tests/java/ifc/frame/_XFrame.java @@ -189,9 +189,7 @@ public class _XFrame extends MultiMethodTest { return; } - try { - Thread.sleep(500); - }catch (InterruptedException ex) {} + util.utils.shortWait(); if (!listenerCalled[0]) { diff --git a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java index a71491e002cd..0fb7b9acd225 100644 --- a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java @@ -104,7 +104,7 @@ public class _XFrameLoader extends MultiMethodTest { .createInstance("com.sun.star.frame.Desktop") ; XDesktop dsk = UnoRuntime.queryInterface(XDesktop.class, oDsk) ; - shortWait() ; + util.utils.shortWait(); frame = dsk.getCurrentFrame() ; } catch ( com.sun.star.uno.Exception e ) { // Some exception occurs.FAILED @@ -146,7 +146,7 @@ public class _XFrameLoader extends MultiMethodTest { if (!loaded) { oObj.load(frame, url, args, listener) ; - shortWait(); + util.utils.shortWait(); loaded = listener.finished ; } @@ -166,7 +166,7 @@ public class _XFrameLoader extends MultiMethodTest { oObj.load(frame, url, args, listener) ; oObj.cancel() ; - shortWait(); + util.utils.shortWait(); if (listener.cancelled) { log.println("Loading was canceled.") ; @@ -188,14 +188,5 @@ public class _XFrameLoader extends MultiMethodTest { if (frameSup != null) frameSup.dispose() ; frame.dispose(); } - - private void shortWait() { - try { - Thread.sleep(5000); - } - catch (InterruptedException ex) { - } - - } } diff --git a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java index a4a94055c328..eaf3b554dd55 100644 --- a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java +++ b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java @@ -106,10 +106,7 @@ public class _XNotifyingDispatch extends MultiMethodTest { oObj.dispatchWithNotification(url, arguments, notificationListener); - try { - Thread.sleep(200); - } - catch(InterruptedException e) {} + util.utils.pause(200); 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 109dfa5fbb4b..6b3ed19d0265 100644 --- a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java +++ b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java @@ -151,9 +151,7 @@ public class _XSynchronousFrameLoader extends MultiMethodTest { oObj.cancel() ; - try { - Thread.sleep(1000); - } catch (InterruptedException ex) {} + util.utils.pause(1000); tRes.tested("cancel()", !result[0]) ; diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java index 52952cfd2695..ffcd3d65c147 100644 --- a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java +++ b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java @@ -135,6 +135,7 @@ public class _XActiveDataControl extends MultiMethodTest { oObj.start(); // waiting a little bit for data transferred + util.utils.pause(200); try { Thread.sleep(200); } catch (InterruptedException e) { diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java index c05b7c5deffe..b1c8399f6679 100644 --- a/qadevOOo/tests/java/ifc/lang/_XComponent.java +++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java @@ -142,9 +142,7 @@ public class _XComponent extends MultiMethodTest { altDispose.dispose(); } - try { - Thread.sleep(500) ; - } catch (InterruptedException e) {} + util.utils.shortWait(); if (Loutput[0]!=null) log.println(Loutput[0]); if (Loutput[1]!=null) log.println(Loutput[1]); log.println( "end dispose" + Thread.currentThread()); diff --git a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java index a9a5b8535e2f..55da8c133513 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"); - shortWait(); + util.utils.pause(200); System.out.println("Press Button"); rob.mousePress(InputEvent.BUTTON1_MASK); System.out.println("Release Button"); @@ -114,14 +114,6 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest { return true; } - private void shortWait() { - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - protected class MyListener implements XEnhancedMouseClickHandler { public void disposing( com.sun.star.lang.EventObject eventObject) { diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java index 053e0df20a4a..a8767cc1a0b5 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.shortWait(500); + util.utils.pause(500); } @@ -114,7 +114,7 @@ public class _XRangeSelection extends MultiMethodTest { props[2].Value = Boolean.FALSE; oObj.startRangeSelection(props); // wait for listeners - util.utils.shortWait(1000); + util.utils.pause(1000); // 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.shortWait(5000); + util.utils.pause(5000); // click on closer clickOnSheet(closer); - util.utils.shortWait(5000); + util.utils.pause(5000); // open a new range selection props[0].Value = "C4:E6"; oObj.startRangeSelection(props); - util.utils.shortWait(1000); + util.utils.pause(1000); props[0].Value = "C2:E3"; oObj.startRangeSelection(props); - util.utils.shortWait(1000); + util.utils.pause(1000); oObj.startRangeSelection(props); - util.utils.shortWait(1000); + util.utils.pause(1000); 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.shortWait(1000); + util.utils.pause(1000); rob.mouseRelease(InputEvent.BUTTON1_MASK); - util.utils.shortWait(1000); + util.utils.pause(1000); } 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 362ca903c880..35fc2f1ac08b 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); } - shortWait(); + util.utils.pause(1000); i++; } @@ -103,18 +103,6 @@ public class _XSystemShellExecute extends MultiMethodTest { tRes.tested("execute()", bExist); } - - /** - * Sleeps to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } } // finish class _XSystemShellExecute diff --git a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java index 0c8ec5257d93..d13cf0ead61b 100644 --- a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java +++ b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java @@ -57,9 +57,7 @@ public class _XJobExecutor extends MultiMethodTest { oObj.trigger("TestEvent"); - try { - Thread.sleep(1000); - } catch (InterruptedException ex) {} + util.utils.pause(1000); 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 bef2f396849d..bb843ee2d22b 100644 --- a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java +++ b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java @@ -96,11 +96,7 @@ public class _XDocumentIndex extends MultiMethodTest { oObj.update(); - try { - Thread.sleep(1000); - } - catch (InterruptedException ex) { - } + util.utils.pause(1000); String contentAfter = oObj.getAnchor().getString(); diff --git a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java index 13bd492edacf..003d732c5943 100644 --- a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java +++ b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java @@ -103,7 +103,7 @@ public class _XMailMergeBroadcaster extends MultiMethodTest { ("'could not fire event: " + e)) ; } - shortWait(); + util.utils.pause(200); tRes.tested("addMailMergeEventListener()", changed); } @@ -132,23 +132,11 @@ public class _XMailMergeBroadcaster extends MultiMethodTest { ("'could not fire event: " + e)) ; } - shortWait(); + util.utils.pause(200); tRes.tested("removeMailMergeEventListener()", !changed); } - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * execute</code> call. - */ - private void shortWait() { - try { - Thread.sleep(200) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } // finished class _XMailMergeBroadcaster diff --git a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java index 55bf4fae025d..452fe6ad9aaf 100644 --- a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java +++ b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java @@ -132,7 +132,7 @@ public class _XPagePrintable extends MultiMethodTest { oObj.printPages(PrintOptions); - util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT)); + util.utils.shortWait(); if (! util.utils.fileExists(xMSF, printFile)){ log.println("ERROR: could not find '" + printFile + "'"); diff --git a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java index 751c22efacfd..d270850d78ca 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java +++ b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java @@ -200,20 +200,14 @@ public class _XCommandProcessor extends MultiMethodTest { for (int i = 0; i < 10; i++) { log.println("try to abort command"); oObj.abort(cmdId); - try { - Thread.sleep(10); - } catch (InterruptedException e) { - } + util.utils.pause(10); } } }; aborter.start(); - try { - Thread.sleep(15); - } catch (InterruptedException e) { - } + util.utils.pause(15); log.println("executing command"); try { diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java index 00c6103f1d9d..6e1acd537d49 100644 --- a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java +++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java @@ -47,7 +47,7 @@ public class _XSimpleFileAccess2 extends MultiMethodTest { String filename = dirname+"XSimpleFileAccess.txt"; XInputStream iStream = oObj.openFileRead(filename); oObj.writeFile(fileURL,iStream); - shortWait(); + util.utils.pause(1000); result = oObj.exists(fileURL); oObj.kill(fileURL); tRes.tested("writeFile()",result); @@ -66,17 +66,5 @@ public class _XSimpleFileAccess2 extends MultiMethodTest { } //EOF writeFile() - /** - * Sleeps for 1 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } // finish class _XSimpleFileAccess diff --git a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java index 06c61013f7a2..243fdc0dc7c5 100644 --- a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java +++ b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java @@ -68,7 +68,7 @@ public class _XContextMenuInterception extends MultiMethodTest { log.println("ensure that the first model is focused"); DesktopTools.bringWindowToFront(docModel); - utils.shortWait(3000); + utils.pause(3000); } @Override @@ -182,7 +182,7 @@ public class _XContextMenuInterception extends MultiMethodTest { log.println("couldn't press mouse button"); } - utils.shortWait(1000); + utils.pause(1000); } diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java index 6cfcc92de4e2..bb10c5abd9cd 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()); - shortWait(); + util.utils.pause(2000); if (canc != null) { closeDialog(); short res = eThread.execRes; @@ -115,18 +115,6 @@ public class _XExecutableDialog extends MultiMethodTest { } } - /** - * Sleeps for 5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - @Override public void after() { if (eThread.isAlive()) { diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java index f34dd3e879ec..603e6285af01 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) ; } - shortWait(); + util.utils.pause(2000); if (!listener.called) { log.println("Listener wasn't called :-("); @@ -169,7 +169,7 @@ public class _XFilePickerNotifier extends MultiMethodTest { e.printStackTrace(log) ; } - shortWait(); + util.utils.pause(2000); closeDialog(); @@ -200,18 +200,6 @@ public class _XFilePickerNotifier extends MultiMethodTest { } } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - private void closeDialog() { XCancellable canc = UnoRuntime.queryInterface( XCancellable.class, tEnv.getTestObject()); diff --git a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java index 4eceb4ac15c7..221cb7cb5400 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.shortWait(1000); + util.utils.pause(1000); tRes.tested("addPrintJobListener()", listenerImpl.actionTriggered()); } @@ -64,7 +64,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest { requiredMethod("addPrintJobListener"); oObj.removePrintJobListener(listenerImpl); - util.utils.shortWait(5000); + util.utils.pause(5000); listenerImpl.reset(); listenerImpl.fireEvent(); diff --git a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java index 5f2d45fbb3a1..daac55ca402f 100644 --- a/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java +++ b/qadevOOo/tests/java/mod/_basctl/AccessibleShape.java @@ -95,7 +95,7 @@ public class AccessibleShape extends TestCase { throw new StatusException("Couldn't open Basic Dialog",e); } - utils.shortWait(3000); + utils.pause(3000); try { oObj = (XInterface) tParam.getMSF().createInstance @@ -132,7 +132,7 @@ public class AccessibleShape extends TestCase { newPosSize.Y = oldPosSize.Y + 20; basicIDE.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, newPosSize.Height, PosSize.POSSIZE); - utils.shortWait(1000); + utils.pause(1000); 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 1b81aa16ebf5..bfffdfd7ce3c 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ConnectionLineAccessibility.java @@ -217,7 +217,7 @@ public class ConnectionLineAccessibility extends TestCase { try { - shortWait(); + util.utils.pause(1500); connection = isolConnection.getIsolatedConnection(user, password); statement = connection.createStatement(); @@ -318,7 +318,7 @@ public class ConnectionLineAccessibility extends TestCase QueryComponent = DesktopTools.loadDoc(Param.getMSF(),".component:DB/QueryDesign",loadProps); - util.utils.shortWait(1000); + util.utils.pause(1000); xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent). getCurrentController().getFrame().getContainerWindow(); @@ -335,7 +335,7 @@ public class ConnectionLineAccessibility extends TestCase TestEnvironment tEnv = new TestEnvironment(oObj); - shortWait(); + util.utils.pause(1500); final XWindow queryWin = xWindow; @@ -376,20 +376,4 @@ public class ConnectionLineAccessibility extends TestCase e.printStackTrace(); } } - - /** - * Sleeps for 1.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() - { - try - { - Thread.sleep(1500); - } - catch (InterruptedException e) - { - log.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java index 46a5551c68a1..4d944239d6e0 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java @@ -204,7 +204,7 @@ public class JoinViewAccessibility extends TestCase { { try { - shortWait (); + util.utils.pause(1500); connection = isolConnection.getIsolatedConnection (user, password); statement = connection.createStatement (); @@ -306,7 +306,7 @@ public class JoinViewAccessibility extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - shortWait(); + util.utils.pause(1500); final XWindow queryWin = xWindow; @@ -343,16 +343,4 @@ public class JoinViewAccessibility extends TestCase { e.printStackTrace (); } } - - /** - * Sleeps for 1.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java index 128995024f04..3fb3287d95cf 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java +++ b/qadevOOo/tests/java/mod/_dbaccess/ODatasourceBrowser.java @@ -204,7 +204,7 @@ public class ODatasourceBrowser extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -263,7 +263,7 @@ public class ODatasourceBrowser extends TestCase { throw new StatusException("Couldn't initialize document", e); } - shortWait(); + util.utils.pause(5000); XControlShape aShape = FormTools.createControlShape(xTextDoc, 3000, 4500, 15000, 10000, @@ -309,16 +309,4 @@ public class ODatasourceBrowser extends TestCase { return tEnv; } // finish method getTestEnvironment - - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } // finish class oDatasourceBrowser diff --git a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java index d3cfde832908..255b7f9d1668 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java +++ b/qadevOOo/tests/java/mod/_dbaccess/OQueryDesign.java @@ -136,7 +136,7 @@ public class OQueryDesign extends TestCase { Args[1] = param2; getting.dispatch(the_url,Args); - shortWait(); + util.utils.pause(5000); Object oDBC = null; @@ -289,17 +289,5 @@ public class OQueryDesign extends TestCase { } - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } // finish class oDatasourceBrowser diff --git a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java index aaa4303b2a90..b7c5513b2145 100644 --- a/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java +++ b/qadevOOo/tests/java/mod/_dbaccess/TableWindowAccessibility.java @@ -190,7 +190,7 @@ public class TableWindowAccessibility extends TestCase { col_name2 + " int)"); } catch (com.sun.star.sdbc.SQLException e) { try { - shortWait(); + util.utils.pause(1500); connection = isolConnection.getIsolatedConnection(user, password); statement = connection.createStatement(); @@ -281,7 +281,7 @@ public class TableWindowAccessibility extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - shortWait(); + util.utils.pause(1500); XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, @@ -330,17 +330,4 @@ public class TableWindowAccessibility extends TestCase { e.printStackTrace (); } } - - - /** - * Sleeps for 1.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_forms/OTimeControl.java b/qadevOOo/tests/java/mod/_forms/OTimeControl.java index 67703e5a7439..f2748b3e535c 100644 --- a/qadevOOo/tests/java/mod/_forms/OTimeControl.java +++ b/qadevOOo/tests/java/mod/_forms/OTimeControl.java @@ -231,20 +231,8 @@ public class OTimeControl extends TestCase { tEnv.addObjRelation("TestTextListener", listener); FormTools.switchDesignOf((Param.getMSF()), xTextDoc); - shortWait(); + util.utils.pause(200); return tEnv; } // finish method getTestEnvironment - - /** - * Sleeps for 0.2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(200); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } // finish class OTimeControl diff --git a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java index 0149effc9bde..d155c4c66525 100644 --- a/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java +++ b/qadevOOo/tests/java/mod/_fwk/DispatchRecorder.java @@ -76,11 +76,7 @@ public class DispatchRecorder extends TestCase { try { SOfficeFactory SOF = SOfficeFactory.getFactory(Param.getMSF()); oDoc = SOF.createTextDoc(null); - try { - Thread.sleep(1000); - } - catch (InterruptedException ex) { - } + util.utils.pause(1000); 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 8816fe136ea6..7d518d924cbc 100644 --- a/qadevOOo/tests/java/mod/_fwk/JobExecutor.java +++ b/qadevOOo/tests/java/mod/_fwk/JobExecutor.java @@ -180,9 +180,7 @@ public class JobExecutor extends TestCase { XChangesBatch xCB = UnoRuntime.queryInterface(XChangesBatch.class, oRootCfg); xCB.commitChanges(); - try { - Thread.sleep(1000); - } catch (InterruptedException ex) {} + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); diff --git a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java index 378a89d74c93..c62bf1ee13c8 100644 --- a/qadevOOo/tests/java/mod/_remotebridge/uno/various.java +++ b/qadevOOo/tests/java/mod/_remotebridge/uno/various.java @@ -214,10 +214,7 @@ public class various extends TestCase { accThread = new AcceptorThread(xAcctr, xInstProv, xBrdgFctr); accThread.start(); // let the thread sleep - try { - Thread.sleep(500); - } - catch (InterruptedException e) {} + util.utils.pause(500); // establish the connection XConnection xConnection = xCntr.connect(connectString); @@ -279,11 +276,7 @@ public class various extends TestCase { bridgeDisposed[0] = true; xComp.dispose(); // wait for dispose - try { - Thread.sleep(5000); - } - catch(InterruptedException e) { - } + util.utils.pause(5000); } } } diff --git a/qadevOOo/tests/java/mod/_remotebridge/various.java b/qadevOOo/tests/java/mod/_remotebridge/various.java index 0cd56a506f12..be245feebf5e 100644 --- a/qadevOOo/tests/java/mod/_remotebridge/various.java +++ b/qadevOOo/tests/java/mod/_remotebridge/various.java @@ -203,10 +203,7 @@ public class various extends TestCase { accThread = new AcceptorThread(xAcctr); accThread.start(); // let the thread sleep - try { - Thread.sleep(500); - } - catch (InterruptedException e) {} + util.utils.pause(500); // establish the connection XConnection xConnection = xCntr.connect(connectString); @@ -268,11 +265,7 @@ public class various extends TestCase { bridgeDisposed[0] = true; xComp.dispose(); // wait for dispose - try { - Thread.sleep(5000); - } - catch(InterruptedException e) { - } + util.utils.pause(5000); } } } diff --git a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java index 01a80ea65460..111b20c246b4 100644 --- a/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java +++ b/qadevOOo/tests/java/mod/_sc/AccessibleEditableTextPara_HeaderFooter.java @@ -68,12 +68,12 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); DiagThread psDiag = new DiagThread(xCalcDoc, msf); psDiag.start(); - util.utils.shortWait(Param.getInt("ShortWait")*5); + util.utils.pause(Param.getInt("ShortWait")*5); Object atw = tk.getActiveTopWindow(); @@ -82,7 +82,7 @@ public class AccessibleEditableTextPara_HeaderFooter extends TestCase { XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); 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 a7e8de208e80..02608fcbdc44 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvCell.java @@ -59,7 +59,7 @@ public class ScAccessibleCsvCell extends TestCase { protected TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log) { XInterface oObj = null; - shortWait(); + util.utils.pause(2000); try { oObj = (XInterface) tParam.getMSF().createInstance @@ -152,19 +152,7 @@ public class ScAccessibleCsvCell extends TestCase { lThread = new loadThread(SOF, args); lThread.start(); - shortWait(); - } - - /** - * Sleeps for 2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } + util.utils.pause(2000); } private class loadThread extends Thread { diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java index bc440dc04f90..8fa3f4c458f8 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvGrid.java @@ -59,7 +59,7 @@ public class ScAccessibleCsvGrid extends TestCase { XInterface oObj = null; - shortWait(); + util.utils.pause(2000); try { oObj = (XInterface) Param.getMSF().createInstance @@ -137,22 +137,10 @@ public class ScAccessibleCsvGrid extends TestCase { lThread = new loadThread(SOF, args); lThread.start(); - shortWait(); + util.utils.pause(2000); } - /** - * Sleeps for 2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - private class loadThread extends Thread { private final SOfficeFactory SOF; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java index 73cd68f0f484..d41103abad15 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleCsvRuler.java @@ -62,7 +62,7 @@ public class ScAccessibleCsvRuler extends TestCase { PrintWriter log) { XInterface oObj = null; - shortWait(); + util.utils.pause(2000); XMultiServiceFactory msf = Param.getMSF(); @@ -172,22 +172,10 @@ public class ScAccessibleCsvRuler extends TestCase { lThread = new loadThread(SOF, args); lThread.start(); - shortWait(); + util.utils.pause(2000); } - /** - * Sleeps for 2 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - private class loadThread extends Thread { private final SOfficeFactory SOF; diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java index de651d08862f..ea3745995342 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocument.java @@ -139,23 +139,11 @@ public class ScAccessibleDocument extends TestCase { String url = utils.getFullTestURL("calcshapes.sxc"); log.println("loading document "+url); xSpreadsheetDoc = SOF.loadDocument(url); - shortWait(); + util.utils.pause(500); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException( "Couldn't create document ", e ); } } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java index 17bcc092f8f7..3cdcce98765f 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessibleDocumentPagePreview.java @@ -149,9 +149,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { throw new StatusException(e, Status.failed("Couldn't change mode")); } - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} + util.utils.shortWait(); XWindow xWindow = AccessibilityTools.getCurrentContainerWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -215,9 +213,7 @@ public class ScAccessibleDocumentPagePreview extends TestCase { log.println("loading document "+url); xSpreadsheetDoc = UnoRuntime.queryInterface( XSpreadsheetDocument.class,SOF.loadDocument(url)); - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} + util.utils.pause(500); } 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 b6eb255012c0..2118c7ad1d78 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -131,9 +131,7 @@ public class ScAccessiblePageHeaderArea extends TestCase { throw new StatusException(e, Status.failed("Couldn't change mode")); } - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} + util.utils.pause(500); 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 782fdd9c3df2..0321f951f6ed 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTabViewObj.java @@ -98,9 +98,7 @@ public class ScTabViewObj extends TestCase { try { log.println("creating two spreadsheet documents"); xSpreadsheetDoc = SOF.createCalcDoc(null); - try { - Thread.sleep(1000); - } catch (InterruptedException e) {} + util.utils.pause(1000); xSpreadsheetDoc2 = SOF.createCalcDoc(null); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); diff --git a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java index 84846d0ddaf3..f6aba03574b6 100644 --- a/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java +++ b/qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java @@ -160,11 +160,7 @@ public class ScTableSheetObj extends TestCase { log.println("Couldn't get XCloseable"); } - try { - log.println("Sleeping 500 Millis"); - Thread.sleep(500); - } catch (InterruptedException ex) { - } + util.utils.pause(500); log.println("... Done"); } diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java b/qadevOOo/tests/java/mod/_sd/AccessibleOutlineView.java index 6d2bfebdcda9..886834a93238 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); - shortWait(); + util.utils.pause(2000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -152,15 +152,7 @@ public class AccessibleOutlineView extends TestCase { } catch (com.sun.star.uno.Exception e) { log.println("Couldn't change mode"); } - shortWait(); - } - - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } + util.utils.pause(2000); } } diff --git a/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java b/qadevOOo/tests/java/mod/_sd/AccessibleSlideView.java index 042f6b13fcbe..ccdd916cf13c 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); - shortWait(); + util.utils.pause(2000); XWindow xWindow = AccessibilityTools.getCurrentWindow ( aModel); @@ -135,7 +135,7 @@ public class AccessibleSlideView extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(2000); aModel = UnoRuntime.queryInterface(XModel.class, xImpressDoc); @@ -160,16 +160,8 @@ public class AccessibleSlideView extends TestCase { log.println("Couldn't change mode"); } - shortWait(); + util.utils.pause(2000); } - - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java index ed00ca1445cd..fc5962395a51 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_DrawView.java @@ -139,9 +139,9 @@ public class DrawController_DrawView extends TestCase { try { log.println( "creating two impress documents" ); xDrawDoc = SOF.createDrawDoc(null); - shortWait(); + util.utils.pause(1000); xSecondDrawDoc = SOF.createDrawDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -180,7 +180,7 @@ public class DrawController_DrawView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -215,7 +215,7 @@ public class DrawController_DrawView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - shortWait(); + util.utils.pause(1000); tEnv.addObjRelation("Selections", new Object[] { @@ -266,14 +266,6 @@ public class DrawController_DrawView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java index 9c7462098a9d..68cf6a1e8886 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_HandoutView.java @@ -157,9 +157,9 @@ public class DrawController_HandoutView extends TestCase { try { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); xDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -201,7 +201,7 @@ public class DrawController_HandoutView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); log.println("switch to HandoutView..."); try{ @@ -211,7 +211,7 @@ public class DrawController_HandoutView extends TestCase { throw new StatusException(e, Status.failed(e.getMessage())); } - utils.shortWait(500); + utils.pause(500); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -248,7 +248,7 @@ public class DrawController_HandoutView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - shortWait(); + util.utils.pause(1000); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); @@ -301,14 +301,6 @@ public class DrawController_HandoutView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java index a16b052ea4ae..b1abd6070b67 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_NotesView.java @@ -157,9 +157,9 @@ public class DrawController_NotesView extends TestCase { try { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); xDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -198,7 +198,7 @@ public class DrawController_NotesView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); log.println("switch to HandoutView..."); try{ @@ -208,7 +208,7 @@ public class DrawController_NotesView extends TestCase { throw new StatusException(e, Status.failed(e.getMessage())); } - utils.shortWait(500); + utils.pause(500); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -245,7 +245,7 @@ public class DrawController_NotesView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - shortWait(); + util.utils.pause(1000); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); @@ -298,14 +298,6 @@ public class DrawController_NotesView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java index 8a6d21e72a14..406c04bc0fed 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_OutlineView.java @@ -157,9 +157,9 @@ public class DrawController_OutlineView extends TestCase { try { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); xDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -198,7 +198,7 @@ public class DrawController_OutlineView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); log.println("switch to HandoutView..."); try{ @@ -208,7 +208,7 @@ public class DrawController_OutlineView extends TestCase { throw new StatusException(e, Status.failed(e.getMessage())); } - utils.shortWait(500); + utils.pause(500); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -245,7 +245,7 @@ public class DrawController_OutlineView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - shortWait(); + util.utils.pause(1000); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); @@ -298,14 +298,6 @@ public class DrawController_OutlineView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java index cd59131d9670..e1a6c2b883a7 100644 --- a/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java +++ b/qadevOOo/tests/java/mod/_sd/DrawController_PresentationView.java @@ -157,9 +157,9 @@ public class DrawController_PresentationView extends TestCase { try { log.println( "creating two impress documents" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); xDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -198,7 +198,7 @@ public class DrawController_PresentationView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); log.println("switch to PresentationView..."); try{ @@ -208,7 +208,7 @@ public class DrawController_PresentationView extends TestCase { throw new StatusException(e, Status.failed(e.getMessage())); } - utils.shortWait(500); + utils.pause(500); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -245,7 +245,7 @@ public class DrawController_PresentationView extends TestCase { xShapes1.add(shape2); xShapes1.add(shape3); xShapes2.add(shape1); - shortWait(); + util.utils.pause(1000); tEnv.addObjRelation("Selections", new Object[] { oDrawPage, oShapeCol1, oShapeCol2}); @@ -298,14 +298,6 @@ public class DrawController_PresentationView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java index 8a12b9a49534..7c12d3a1d75a 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoDrawView.java @@ -153,9 +153,9 @@ public class SdUnoDrawView extends TestCase { try { log.println( "creating two draw documents" ); xDrawDoc = SOF.createDrawDoc(null); - shortWait(); + util.utils.pause(1000); xSecondDrawDoc = SOF.createDrawDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -194,7 +194,7 @@ public class SdUnoDrawView extends TestCase { oShapes.add(shape1); oShapes.add(shape2); oShapes.add(shape3); - shortWait(); + util.utils.pause(1000); XModel aModel = UnoRuntime.queryInterface(XModel.class, xDrawDoc); @@ -264,14 +264,6 @@ public class SdUnoDrawView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } // finish class SdUnoDrawView diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java index 898af44eee57..252863b168d0 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoOutlineView.java @@ -137,7 +137,7 @@ public class SdUnoOutlineView extends TestCase { try { log.println( "creating a impress document" ); xImpressDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(5000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -173,7 +173,7 @@ public class SdUnoOutlineView extends TestCase { try { log.println( "creating a second impress document" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(5000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -217,14 +217,6 @@ public class SdUnoOutlineView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(5000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } // finish class SdUnoOutlineView diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java index d6dd310dabf8..788a17630611 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoPresView.java @@ -152,7 +152,7 @@ public class SdUnoPresView extends TestCase { log.println( "creating two impress documents" ); xImpressDoc = SOF.createImpressDoc(null); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(5000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -263,14 +263,6 @@ public class SdUnoPresView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(5000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } // finish class SdUnoDrawView diff --git a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java index ac3cb35b3eb6..49d6abb33c2d 100644 --- a/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java +++ b/qadevOOo/tests/java/mod/_sd/SdUnoSlideView.java @@ -109,7 +109,7 @@ public class SdUnoSlideView extends TestCase { try { log.println( "creating a impress document" ); xImpressDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); xDP = DrawTools.getDrawPages(xImpressDoc); xDP.insertNewByIndex(0); xDP.insertNewByIndex(0); @@ -144,7 +144,7 @@ public class SdUnoSlideView extends TestCase { try { log.println( "creating a second impress document" ); xSecondDrawDoc = SOF.createImpressDoc(null); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException("Couldn't create document", e); @@ -196,14 +196,6 @@ public class SdUnoSlideView extends TestCase { } // finish method getTestEnvironment - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } // finish class SdUnoOutlineView diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java index 450736072416..68ad155820d8 100644 --- a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java @@ -127,10 +127,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"); - shortWait(); + util.utils.pause(1000); System.out.println("Children "+con.getAccessibleChildCount()); xPS.setPropertyValue("Formula", expFormula); - shortWait(); + util.utils.pause(1000); } catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.IllegalArgumentException e) { } catch(com.sun.star.beans.PropertyVetoException e) { @@ -152,16 +152,4 @@ public class SmEditAccessible extends TestCase { log.println( " disposing xMathDoc " ); xMathDoc.dispose(); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } } // finish class SmModel diff --git a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java index eabf3fe888e8..6c9bc29a4917 100644 --- a/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java +++ b/qadevOOo/tests/java/mod/_sm/SmGraphicAccessible.java @@ -132,9 +132,9 @@ public class SmGraphicAccessible extends TestCase { try { xAC.grabFocus(); xPS.setPropertyValue("Formula", "sum hat x"); - shortWait(); + util.utils.pause(1000); xPS.setPropertyValue("Formula", expFormula); - shortWait(); + util.utils.pause(1000); } catch(com.sun.star.lang.WrappedTargetException e) { } catch(com.sun.star.lang.IllegalArgumentException e) { } catch(com.sun.star.beans.PropertyVetoException e) { @@ -155,16 +155,4 @@ public class SmGraphicAccessible extends TestCase { log.println( " disposing xMathDoc " ); xMathDoc.dispose(); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } } // finish class SmModel diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java index 6fe1e58b1942..bc34cc9c0f86 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBox.java @@ -102,7 +102,7 @@ public class AccessibleBrowseBox extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -121,7 +121,7 @@ public class AccessibleBrowseBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -148,7 +148,7 @@ public class AccessibleBrowseBox extends TestCase { final PropertyValue[] fParams = params; - shortWait(); + util.utils.pause(5000); XWindow xWindow = secondController.getFrame().getContainerWindow(); @@ -177,16 +177,4 @@ public class AccessibleBrowseBox extends TestCase { return tEnv; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java index 8e540d2e2476..8a4d3c2fb857 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderBar.java @@ -132,7 +132,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -171,7 +171,7 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { param3.Value = "biblio"; params[2] = param3; - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -207,14 +207,14 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { TestEnvironment tEnv = new TestEnvironment(oObj); - shortWait(); + util.utils.pause(5000); XAccessibleComponent accComp = UnoRuntime.queryInterface( XAccessibleComponent.class, oObj); final Point point = accComp.getLocationOnScreen(); - shortWait(); + util.utils.pause(5000); tEnv.addObjRelation("EventProducer", new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() { @@ -231,16 +231,4 @@ public class AccessibleBrowseBoxHeaderBar extends TestCase { return tEnv; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java index 5faa71a65272..373307306db9 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxHeaderCell.java @@ -132,7 +132,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { throw new StatusException( "Couldn't create document", e ); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -150,7 +150,7 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -214,16 +214,4 @@ public class AccessibleBrowseBoxHeaderCell extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java index 8ebb43abe371..6cf139093d53 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTable.java @@ -132,7 +132,7 @@ public class AccessibleBrowseBoxTable extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -154,7 +154,7 @@ public class AccessibleBrowseBoxTable extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -212,16 +212,4 @@ public class AccessibleBrowseBoxTable extends TestCase { return tEnv; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java index 98ec82a9699e..94627bb96bf4 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleBrowseBoxTableCell.java @@ -129,7 +129,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { throw new StatusException( "Couldn't create document", e ); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -147,7 +147,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url,noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -178,7 +178,7 @@ public class AccessibleBrowseBoxTableCell extends TestCase { param3.Value = "biblio"; params[2] = param3; - shortWait(); + util.utils.pause(5000); XWindow xWindow = secondController.getFrame().getContainerWindow(); @@ -199,16 +199,4 @@ public class AccessibleBrowseBoxTableCell extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java index 7901d40c6e13..da90e9fe0501 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrl.java @@ -152,7 +152,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -187,7 +187,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(5000); XInterface oObj = null; @@ -203,7 +203,7 @@ public class AccessibleIconChoiceCtrl extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(5000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -263,16 +263,4 @@ public class AccessibleIconChoiceCtrl extends TestCase { return tEnv; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java index 3f15454992c1..b979ec1088ad 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleIconChoiceCtrlEntry.java @@ -156,7 +156,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { throw new StatusException( "Couldn't create document", e ); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -187,7 +187,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(5000); XInterface oObj = null; try { @@ -201,7 +201,7 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(5000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -236,16 +236,4 @@ public class AccessibleIconChoiceCtrlEntry extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java index f7843961c7bf..9803a450272a 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBar.java @@ -97,11 +97,11 @@ public class AccessibleTabBar extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XInterface oObj = null; - shortWait(); + util.utils.pause(5000); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xDoc). getCurrentController().getFrame().getContainerWindow(); @@ -126,18 +126,6 @@ public class AccessibleTabBar extends TestCase { return tEnv; } - /** - * Sleeps for 3 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - protected void closeDoc(XComponent xDoc) { XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDoc); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java index 2473d4a09724..73226ab751dc 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPage.java @@ -118,7 +118,7 @@ public class AccessibleTabBarPage extends TestCase { throw new StatusException( "Couldn't create document", e ); } - shortWait(); + util.utils.pause(5000); XInterface oObj = null; @@ -135,7 +135,7 @@ public class AccessibleTabBarPage extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(5000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class,tk.getActiveTopWindow()); @@ -167,16 +167,4 @@ public class AccessibleTabBarPage extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java index 559b62e65be5..5290e65bcd5d 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTabBarPageList.java @@ -120,7 +120,7 @@ public class AccessibleTabBarPageList extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XInterface oObj = null; @@ -136,7 +136,7 @@ public class AccessibleTabBarPageList extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(5000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -171,18 +171,6 @@ public class AccessibleTabBarPageList extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - protected void closeDoc() { XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xDoc); diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java index 38b826c4d277..40fe66ad8e71 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBox.java @@ -138,7 +138,7 @@ public class AccessibleTreeListBox extends TestCase { throw new StatusException( "Couldn't create document", e ); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -156,7 +156,7 @@ public class AccessibleTreeListBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -216,16 +216,4 @@ public class AccessibleTreeListBox extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java index 8cf434ccc67f..996ef88b43c4 100644 --- a/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java +++ b/qadevOOo/tests/java/mod/_svtools/AccessibleTreeListBoxEntry.java @@ -156,7 +156,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(5000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -178,7 +178,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(the_url, noArgs); - shortWait(); + util.utils.pause(5000); XFrame the_frame1 = the_Desk.getCurrentFrame(); @@ -223,7 +223,7 @@ public class AccessibleTreeListBoxEntry extends TestCase { throw new StatusException("Could not select Biblio-Database", ex); } - shortWait(); + util.utils.pause(5000); XWindow xWindow = secondController.getFrame().getContainerWindow(); @@ -259,18 +259,6 @@ public class AccessibleTreeListBoxEntry extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(5000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - protected void closeDoc() { XCloseable closer = UnoRuntime.queryInterface( XCloseable.class, xTextDoc); diff --git a/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java b/qadevOOo/tests/java/mod/_svx/AccessibleControlShape.java index 6abafcb1d086..25a7df2cea5b 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.shortWait(5000); + utils.pause(5000); 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 f4fe8173764b..77db894d1cf8 100644 --- a/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java +++ b/qadevOOo/tests/java/mod/_svx/AccessibleEditableTextPara.java @@ -128,23 +128,11 @@ public class AccessibleEditableTextPara extends TestCase { try { log.println("creating a spreadsheetdocument"); xSpreadsheetDoc = UnoRuntime.queryInterface(XComponent.class,SOF.createCalcDoc(null)); - shortWait(); + util.utils.pause(500); } catch (com.sun.star.uno.Exception e) { e.printStackTrace( log ); throw new StatusException( "Couldn't create document ", e ); } } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - } diff --git a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java index d4efa3ee73be..1249ef898420 100644 --- a/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java +++ b/qadevOOo/tests/java/mod/_svx/SvxGraphCtrlAccessibleContext.java @@ -114,7 +114,7 @@ public class SvxGraphCtrlAccessibleContext extends TestCase{ XDispatch xDispatcher = xDispProv.queryDispatch( aURL,"",0); if( xDispatcher != null ) xDispatcher.dispatch( aURL, null ); - utils.shortWait(Param.getInt(util.PropertyName.SHORT_WAIT)); + utils.shortWait(); } catch (com.sun.star.uno.Exception e) { log.println("Couldn't change mode"); } diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java index cbfcce7fd050..9348e86f041b 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessibleDocumentPageView.java @@ -113,7 +113,7 @@ public class SwAccessibleDocumentPageView extends TestCase { throw new StatusException(e, Status.failed("Couldn't change mode")); } - shortWait(); + util.utils.pause(2000); XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -131,7 +131,7 @@ public class SwAccessibleDocumentPageView extends TestCase { public void fireEvent() { String oldText = the_text.getString(); the_text.setString("EVENT FIRED"); - shortWait(); + util.utils.pause(2000); the_text.setString(oldText); } }); @@ -142,19 +142,6 @@ public class SwAccessibleDocumentPageView extends TestCase { /** - * Sleeps for 1 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(2000) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } - - - /** * Called while disposing a <code>TestEnvironment</code>. * Disposes text document. * @param Param test parameters diff --git a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java index 3c32a7cd9b81..84fa8139cf68 100644 --- a/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java +++ b/qadevOOo/tests/java/mod/_sw/SwAccessiblePageView.java @@ -144,7 +144,7 @@ public class SwAccessiblePageView extends TestCase { throw new StatusException( "Couldn't get Paragraph", e ); } - shortWait(); + util.utils.pause(500); XController xController = xTextDoc.getCurrentController(); @@ -168,7 +168,7 @@ public class SwAccessiblePageView extends TestCase { throw new StatusException(e, Status.failed("Couldn't change mode")); } - shortWait(); + util.utils.pause(500); XWindow xWindow = AccessibilityTools.getCurrentWindow(aModel); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); @@ -251,16 +251,4 @@ public class SwAccessiblePageView extends TestCase { log.println( "creating a text document" ); xTextDoc = WriterTools.createTextDoc(Param.getMSF()); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500) ; - } catch (InterruptedException e) { - log.println("While waiting :" + e) ; - } - } } diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java index da8ddffd0747..1b8f2461eb23 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleButton.java @@ -100,14 +100,14 @@ public class AccessibleButton extends lib.TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); DiagThread psDiag = new DiagThread(xTextDoc, msf); psDiag.start(); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); Object atw = tk.getActiveTopWindow(); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java index 06d85ac874c0..6def9bb8fe93 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleCheckBox.java @@ -103,7 +103,7 @@ public class AccessibleCheckBox extends TestCase { } } - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); XInterface oObj = null; @@ -120,16 +120,16 @@ public class AccessibleCheckBox extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); log.println("Opening Dialog in second thread"); psDiag = new DiagThread(xTextDoc, msf); psDiag.start(); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); log.println("Getting the active TopWindow"); diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java index d7bb63033fbb..d48bd0b4763c 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleComboBox.java @@ -98,7 +98,7 @@ public class AccessibleComboBox extends TestCase { Param.getMSF()); psDiag.start(); - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); Object atw = tk.getActiveTopWindow(); @@ -124,7 +124,7 @@ public class AccessibleComboBox extends TestCase { } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); } - util.utils.shortWait(Param.getInt("ShortWait")); + util.utils.pause(Param.getInt("ShortWait")); 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 46e1aa1a2063..284f7a554494 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; - shortWait(); + util.utils.pause(500); XWindow xWindow = AccessibilityTools.getCurrentWindow( xTextDoc); @@ -128,16 +128,4 @@ public class AccessibleDropDownListBox extends TestCase { protected void cleanup(TestParameters Param, PrintWriter log) { util.DesktopTools.closeDoc(xTextDoc); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java index 6df7063268bc..270a5ff512d1 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleEdit.java @@ -135,7 +135,7 @@ public class AccessibleEdit extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(500); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -208,16 +208,4 @@ public class AccessibleEdit extends TestCase { throw new StatusException("Can't create document", e); } } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java index 22eab84d3949..873d643a96c2 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleFixedText.java @@ -137,7 +137,7 @@ public class AccessibleFixedText extends TestCase { throw new StatusException("Couldn't get toolkit", e); } - shortWait(); + util.utils.pause(500); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWinDlg); @@ -181,16 +181,4 @@ public class AccessibleFixedText extends TestCase { log.println(" Closing dialog ... "); xWinDlg.dispose(); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java index 82a4b8d09ee6..12992f9209a8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleList.java @@ -78,7 +78,7 @@ public class AccessibleList extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(1000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -113,7 +113,7 @@ public class AccessibleList extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(1000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -136,7 +136,7 @@ public class AccessibleList extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new StatusException("Can't switch to required tab", e); } @@ -213,16 +213,4 @@ public class AccessibleList extends TestCase { throw new StatusException("Can't create document", e); } } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java index 8a855caa0ed9..7eaf80d757e8 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListBox.java @@ -101,7 +101,7 @@ public class AccessibleListBox extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(1000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -136,7 +136,7 @@ public class AccessibleListBox extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(1000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -160,7 +160,7 @@ public class AccessibleListBox extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new StatusException("Can't switch to required tab", e); } @@ -225,16 +225,4 @@ public class AccessibleListBox extends TestCase { throw new StatusException("Can't create document", e); } } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java index 95962691b467..1443a4a68aed 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleListItem.java @@ -99,7 +99,7 @@ public class AccessibleListItem extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(1000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -134,7 +134,7 @@ public class AccessibleListItem extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(1000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -157,7 +157,7 @@ public class AccessibleListItem extends TestCase { XAccessibleSelection.class, oObj); xAccSel.selectAccessibleChild(3); - shortWait(); + util.utils.pause(1000); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { throw new StatusException("Can't switch to required tab", e); } @@ -217,16 +217,4 @@ public class AccessibleListItem extends TestCase { throw new StatusException("Can't create document", e); } } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java index 844f96ce76d0..5c83d76d4f0b 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenu.java @@ -92,7 +92,7 @@ public class AccessibleMenu extends TestCase { throw new StatusException("Can't create document", e); } - shortWait(); + util.utils.pause(500); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); @@ -126,10 +126,7 @@ public class AccessibleMenu extends TestCase { try { act2.doAccessibleAction(0); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - } + util.utils.pause(500); act1.doAccessibleAction(0); } catch (com.sun.star.lang.IndexOutOfBoundsException e) { @@ -170,16 +167,4 @@ public class AccessibleMenu extends TestCase { @Override protected void initialize(TestParameters Param, PrintWriter log) { } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuBar.java index f0330df7feea..5b91847a95cf 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) { - shortWait(); + util.utils.pause(500); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); @@ -128,16 +128,4 @@ public class AccessibleMenuBar extends TestCase { protected void cleanup(TestParameters Param, PrintWriter log) { util.DesktopTools.closeDoc(xTextDoc); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java index 4b5a9514c5c7..6b1da6f840cf 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuItem.java @@ -95,7 +95,7 @@ public class AccessibleMenuItem extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(500); Object atw = tk.getActiveTopWindow(); @@ -114,7 +114,7 @@ public class AccessibleMenuItem extends TestCase { XAccessibleAction act = UnoRuntime.queryInterface( XAccessibleAction.class, Menu); act.doAccessibleAction(0); - shortWait(); + util.utils.pause(500); //get a menue-item @@ -177,16 +177,4 @@ public class AccessibleMenuItem extends TestCase { protected void cleanup(TestParameters Param, PrintWriter log) { util.DesktopTools.closeDoc(xTextDoc); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleMenuSeparator.java index 0e3d97d05acb..f78335981175 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) { - shortWait(); + util.utils.pause(500); XWindow xWindow = UnoRuntime.queryInterface(XModel.class, xTextDoc). getCurrentController().getFrame().getContainerWindow(); @@ -93,7 +93,7 @@ public class AccessibleMenuSeparator extends TestCase { XAccessibleAction.class, Menu); act.doAccessibleAction(0); - shortWait(); + util.utils.pause(500); //get a menue-separator @@ -144,16 +144,4 @@ public class AccessibleMenuSeparator extends TestCase { protected void cleanup(TestParameters Param, PrintWriter log) { util.DesktopTools.closeDoc(xTextDoc); } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - log.println("While waiting :" + e); - } - } }
\ No newline at end of file diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java index 335c8994d977..81da3dd50253 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessiblePopupMenu.java @@ -135,7 +135,7 @@ public class AccessiblePopupMenu extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(tParam); + util.utils.shortWait(); XModel aModel = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -166,7 +166,7 @@ public class AccessiblePopupMenu extends TestCase { log.println("couldn't press mouse button"); } - shortWait(tParam); + util.utils.shortWait(); XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, toolkit); @@ -212,8 +212,4 @@ public class AccessiblePopupMenu extends TestCase { protected void closeDoc() { util.DesktopTools.closeDoc(xTextDoc); } - - private void shortWait(TestParameters tParam) { - util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT)); - } } diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java index 748a64a0496e..c00e6d340610 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleRadioButton.java @@ -168,7 +168,7 @@ public class AccessibleRadioButton extends TestCase { throw new StatusException("Couldn't create document", e); } - util.utils.shortWait(2000); + util.utils.pause(2000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -203,7 +203,7 @@ public class AccessibleRadioButton extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - util.utils.shortWait(2000); + util.utils.pause(2000); XInterface oObj = null; @@ -219,7 +219,7 @@ public class AccessibleRadioButton extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - util.utils.shortWait(2000); + util.utils.pause(2000); 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 e89dba8f95a7..053bbebeb3fc 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabControl.java @@ -160,7 +160,7 @@ public class AccessibleTabControl extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(500); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -195,7 +195,7 @@ public class AccessibleTabControl extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(500); XInterface oObj = null; @@ -211,7 +211,7 @@ public class AccessibleTabControl extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(500); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -255,16 +255,4 @@ public class AccessibleTabControl extends TestCase { return tEnv; } - - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } } diff --git a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java index ae18f9174a8e..abdc09b9dd2a 100644 --- a/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java +++ b/qadevOOo/tests/java/mod/_toolkit/AccessibleTabPage.java @@ -97,7 +97,7 @@ public class AccessibleTabPage extends TestCase { if (accCloseButton != null) { log.println("closing InsertFields Dialog"); accCloseButton.doAccessibleAction(0); - shortWait(); + util.utils.pause(1000); } } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); @@ -140,7 +140,7 @@ public class AccessibleTabPage extends TestCase { if (accCloseButton != null) { log.println("closing InsertFields Dialog"); accCloseButton.doAccessibleAction(0); - shortWait(); + util.utils.pause(1000); } } catch (com.sun.star.lang.IndexOutOfBoundsException e) { e.printStackTrace(log); @@ -167,7 +167,7 @@ public class AccessibleTabPage extends TestCase { throw new StatusException("Couldn't create document", e); } - shortWait(); + util.utils.pause(1000); XModel aModel1 = UnoRuntime.queryInterface(XModel.class, xTextDoc); @@ -202,7 +202,7 @@ public class AccessibleTabPage extends TestCase { PropertyValue[] noArgs = new PropertyValue[0]; getting.dispatch(url[0], noArgs); - shortWait(); + util.utils.pause(1000); XInterface oObj = null; @@ -218,7 +218,7 @@ public class AccessibleTabPage extends TestCase { XExtendedToolkit tk = UnoRuntime.queryInterface( XExtendedToolkit.class, oObj); - shortWait(); + util.utils.pause(1000); XWindow xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); @@ -246,7 +246,7 @@ public class AccessibleTabPage extends TestCase { oObj); accComp.getLocationOnScreen(); - shortWait(); + util.utils.pause(1000); XInterface xEventInt = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.PAGE_TAB, "Variables"); final XAccessibleComponent eventAccComp = UnoRuntime.queryInterface( @@ -263,18 +263,6 @@ public class AccessibleTabPage extends TestCase { return tEnv; } - /** - * Sleeps for 0.5 sec. to allow StarOffice to react on <code> - * reset</code> call. - */ - private void shortWait() { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e); - } - } - protected void closeDoc() { util.DesktopTools.closeDoc(xTextDoc); } |