From 09330056a01a4b5c3d16e3ffb6c1bff36099eb83 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Dec 2014 10:02:49 +0200 Subject: 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 --- vcl/qa/complex/memCheck/CheckMemoryUsage.java | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) (limited to 'vcl/qa/complex/memCheck/CheckMemoryUsage.java') 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); } @@ -484,22 +487,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 -- cgit