Kaydet (Commit) c55f945e authored tarafından Noel Grandin's avatar Noel Grandin

java: move DEFAULT_SHORT_WAIT_MS to util.utils

so I can turn PopertyNames into an enum

Change-Id: I939a83c0962813302a3653e75976147b2300cb18
üst b82cc80e
......@@ -221,7 +221,7 @@ public class RecoveryTest extends ComplexTestCase {
log.println("wating for recovery dialog...");
int counter = 0;
int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / PropertyName.DEFAULT_SHORT_WAIT_MS;
int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / utils.DEFAULT_SHORT_WAIT_MS;
XDialog oDialog = rt.getActiveDialog(xMSF);
......@@ -352,7 +352,7 @@ public class RecoveryTest extends ComplexTestCase {
util.utils.shortWait();
int counter = 0;
int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / PropertyName.DEFAULT_SHORT_WAIT_MS;
int maximum = param.getInt(PropertyName.THREAD_TIME_OUT) / utils.DEFAULT_SHORT_WAIT_MS;
XAccessibleContext oButton = null;
while ((oButton == null) && (counter < maximum)){
......
......@@ -93,7 +93,7 @@ public class RecoveryTools {
// This could consumes more time then the TimeOut allow.
int counter = 0;
int multi = 5;
int pause = PropertyName.DEFAULT_SHORT_WAIT_MS * 10;
int pause = utils.DEFAULT_SHORT_WAIT_MS * 10;
int timeOut = param.getInt(PropertyName.THREAD_TIME_OUT)*5;
int maximum = (timeOut / pause) * multi;
......@@ -184,7 +184,7 @@ public class RecoveryTools {
helper.ProcessHandler ph = (helper.ProcessHandler) param.get("AppProvider");
int timeOut = param.getInt(PropertyName.THREAD_TIME_OUT)*5;
int pause = PropertyName.DEFAULT_SHORT_WAIT_MS * 20;
int pause = utils.DEFAULT_SHORT_WAIT_MS * 20;
int multi = 0;
while ((ph != null) && (ph.getExitCode()<0) && (pause*multi < timeOut)) {
log.println("waiting until the office is closed... remaining " + (timeOut - pause * multi)/1000 + " seconds");
......@@ -257,7 +257,7 @@ public class RecoveryTools {
{
KlickButtonThread kbt = new KlickButtonThread(xWindow, buttonName);
kbt.start();
util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 10);
util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 10);
}
public void copyRecoveryData(boolean backup)
......
......@@ -62,10 +62,6 @@ public interface PropertyName {
* for Logging
*/
String OUT_PRODUCER = "OutProducer";
/**
* Default short wait time for the Office
*/
int DEFAULT_SHORT_WAIT_MS = 500;
/**
* internal only, no parameter
* The OfficeProvider contains the full qualified
......
......@@ -648,7 +648,7 @@ public class utils {
* This is the default call, which waits for 500ms.
*/
public static void shortWait() {
pause(PropertyName.DEFAULT_SHORT_WAIT_MS);
pause(utils.DEFAULT_SHORT_WAIT_MS);
}
/** Causes the thread to sleep some time.
......@@ -857,4 +857,9 @@ public class utils {
dfmt.format(cal.get(Calendar.MILLISECOND));
return "[" + dateTime + "]";
}
/**
* Default short wait time for the Office
*/
public static final int DEFAULT_SHORT_WAIT_MS = 500;
}
......@@ -39,7 +39,7 @@ import java.awt.event.InputEvent;
import lib.MultiMethodTest;
import util.AccessibilityTools;
import util.PropertyName;
import util.utils;
/**
* Testing <code>com.sun.star.awt.XUserInputInterception</code>
......@@ -151,7 +151,7 @@ public class _XUserInputInterception extends MultiMethodTest {
et.run();
util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2);
util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2);
log.println("key listener thread should be finished.");
......@@ -214,7 +214,7 @@ public class _XUserInputInterception extends MultiMethodTest {
et.run();
util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2);
util.utils.pause(utils.DEFAULT_SHORT_WAIT_MS * 2);
log.println("mouse listener thread should be finished.");
boolean bOK = m_mousePressed1 & m_mouseReleased1 &
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment