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 /vcl/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 'vcl/qa')
-rw-r--r-- | vcl/qa/complex/memCheck/CheckMemoryUsage.java | 25 | ||||
-rw-r--r-- | vcl/qa/complex/persistent_window_states/DocumentHandle.java | 10 |
2 files changed, 8 insertions, 27 deletions
diff --git a/vcl/qa/complex/memCheck/CheckMemoryUsage.java b/vcl/qa/complex/memCheck/CheckMemoryUsage.java index 50f475ab8e5a..5eefd42317c8 100644 --- a/vcl/qa/complex/memCheck/CheckMemoryUsage.java +++ b/vcl/qa/complex/memCheck/CheckMemoryUsage.java @@ -223,7 +223,8 @@ public class CheckMemoryUsage System.out.println(); } - shortWait(10000); + System.out.println("Wait for: " + 10000 + "ms"); + util.utils.pause(10000); // Now the real test, load document and store 25 times @@ -374,7 +375,8 @@ public class CheckMemoryUsage public void stop() { // short wait for the office to 'calm down' and free some memory - shortWait(20000); + System.out.println("Wait for: " + 20000 + "ms"); + util.utils.pause(20000); // wait util memory is not freed anymore. int storageAfter = getOfficeMemoryUsage(createModeName("stop", 0)); int mem = 0; @@ -384,7 +386,8 @@ public class CheckMemoryUsage count++; mem = storageAfter; storageAfter = getOfficeMemoryUsage(createModeName("stop", count)); - shortWait(1000); + System.out.println("Wait for: " + 1000 + "ms"); + util.utils.pause(1000); } m_nMemoryUsage = (storageAfter - m_nMemoryStart); } @@ -485,22 +488,6 @@ public class CheckMemoryUsage } /** - * Let this thread sleep for some time - * @param milliSeconds time to wait in milliseconds. - */ - public static void shortWait(int milliSeconds) - { - System.out.println("Wait for: " + milliSeconds + "ms"); - try - { - Thread.sleep(milliSeconds); - } - catch (InterruptedException e) - { // ignore - } - } - - /** * Own file filter, will just return ok for all files that end with a given * suffix */ diff --git a/vcl/qa/complex/persistent_window_states/DocumentHandle.java b/vcl/qa/complex/persistent_window_states/DocumentHandle.java index 65ba8b1532c7..99893d6fcf30 100644 --- a/vcl/qa/complex/persistent_window_states/DocumentHandle.java +++ b/vcl/qa/complex/persistent_window_states/DocumentHandle.java @@ -85,10 +85,7 @@ public class DocumentHandle { XComponentLoader xFrameLoader = UnoRuntime.queryInterface(XComponentLoader.class, xFrame); xFrameLoader.loadComponentFromURL(docName, "_self", 0, szArgs); // wait for the document to load. - try { - Thread.sleep(10000); - } - catch(InterruptedException e) {} + util.utils.pause(10000); xWin = xFrame.getContainerWindow(); xWin.addWindowListener(wl); @@ -144,10 +141,7 @@ public class DocumentHandle { wl.resetTrigger(); xWin.setPosSize(newPosSize.X, newPosSize.Y, newPosSize.Width, newPosSize.Height, PosSize.POSSIZE); - try { - Thread.sleep(3000); - } - catch(InterruptedException e) {} + util.utils.pause(3000); return wl.resizedTrigger; } } |