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/runner/util | |
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/runner/util')
-rw-r--r-- | qadevOOo/runner/util/DesktopTools.java | 2 | ||||
-rw-r--r-- | qadevOOo/runner/util/PropertyName.java | 5 | ||||
-rw-r--r-- | qadevOOo/runner/util/utils.java | 13 |
3 files changed, 12 insertions, 8 deletions
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); |