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/tests/java/mod/_svtools | |
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/tests/java/mod/_svtools')
12 files changed, 31 insertions, 175 deletions
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); |