summaryrefslogtreecommitdiff
path: root/vcl/qa/complex/memCheck/CheckMemoryUsage.java
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-12-22 10:02:49 +0200
committerNoel Grandin <noel@peralex.com>2015-01-12 08:36:17 +0200
commit09330056a01a4b5c3d16e3ffb6c1bff36099eb83 (patch)
treeefa793bee83eed4081edd52737e73216a3048b89 /vcl/qa/complex/memCheck/CheckMemoryUsage.java
parent4bf4e3d40778051f1f886c47dd2b2bef82acf1e5 (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/complex/memCheck/CheckMemoryUsage.java')
-rw-r--r--vcl/qa/complex/memCheck/CheckMemoryUsage.java25
1 files changed, 6 insertions, 19 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
*/