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 /toolkit/qa | |
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 'toolkit/qa')
3 files changed, 10 insertions, 41 deletions
diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java index ee88bbc4f4af..f7709b63d560 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBar.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBar.java @@ -61,18 +61,6 @@ public class AccessibleStatusBar { } /** - * 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) ; - } - } - - /** * Check document types */ @Test @@ -205,7 +193,7 @@ public class AccessibleStatusBar { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - shortWait(); + util.utils.pause(500); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -230,17 +218,17 @@ public class AccessibleStatusBar { "com.sun.star.awt.Toolkit") ; XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class, xIfc); - shortWait(); + util.utils.pause(500); xWindow = UnoRuntime.queryInterface(XWindow.class, tk.getActiveTopWindow()); - shortWait(); + util.utils.pause(500); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - shortWait(); + util.utils.pause(500); System.out.println("...OK."); XServiceInfo xSI = UnoRuntime.queryInterface(XServiceInfo.class, parentContext); diff --git a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java index e2d510887694..530351e65b93 100644 --- a/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java +++ b/toolkit/qa/complex/toolkit/AccessibleStatusBarItem.java @@ -58,17 +58,6 @@ public class AccessibleStatusBarItem { XWindow xWindow = null; /** - * Sleeps for a certain time. - */ - private void shortWait() { - try { - Thread.sleep(500); - } catch (InterruptedException e) { - System.out.println("While waiting :" + e) ; - } - } - - /** * Check document types */ @Test @@ -207,7 +196,7 @@ public class AccessibleStatusBarItem { try { System.out.println("****** Open a new calc document"); xSpreadsheetDoc = xSOF.createCalcDoc("_blank"); - shortWait(); + util.utils.pause(500); getTestObject(); } catch(com.sun.star.uno.Exception e) { @@ -233,18 +222,18 @@ public class AccessibleStatusBarItem { XExtendedToolkit tk = UnoRuntime.queryInterface(XExtendedToolkit.class,xIfc); - shortWait(); + util.utils.pause(500); xWindow = UnoRuntime.queryInterface( XWindow.class,tk.getActiveTopWindow()); - shortWait(); + util.utils.pause(500); XAccessible xRoot = AccessibilityTools.getAccessibleObject(xWindow); XAccessibleContext parentContext = null; System.out.println("Get the accessible status bar."); parentContext = AccessibilityTools.getAccessibleObjectForRole( xRoot, AccessibleRole.STATUS_BAR, ""); - shortWait(); + util.utils.pause(500); if ( parentContext == null ) { fail("Could not create a test object."); } diff --git a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java index f94cb6f1d4b5..323553b754a4 100644 --- a/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java +++ b/toolkit/qa/complex/toolkit/accessibility/_XAccessibleEventBroadcaster.java @@ -115,11 +115,7 @@ public class _XAccessibleEventBroadcaster { System.out.println("fire event"); prod.fireEvent() ; - try { - Thread.sleep(1500); - } - catch (InterruptedException ex) { - } + util.utils.pause(1500); boolean works = true; @@ -157,11 +153,7 @@ public class _XAccessibleEventBroadcaster { System.out.println("fire event"); prod.fireEvent() ; - try { - Thread.sleep(500); - } - catch (InterruptedException ex) { - } + util.utils.pause(500); if (list.notifiedEvent == null) { System.out.println("listener wasn't called -- OK"); |