summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/ifc
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 /qadevOOo/tests/java/ifc
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 'qadevOOo/tests/java/ifc')
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java12
-rw-r--r--qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java15
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XImageProducer.java4
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XItemListener.java4
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XRadioButton.java4
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XScrollBar.java17
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSpinField.java20
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XSpinValue.java17
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextComponent.java6
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTextListener.java4
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTopWindow.java10
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java7
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XWindow.java28
-rw-r--r--qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java15
-rw-r--r--qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java5
-rw-r--r--qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java5
-rw-r--r--qadevOOo/tests/java/ifc/connection/_XAcceptor.java5
-rw-r--r--qadevOOo/tests/java/ifc/connection/_XConnector.java5
-rw-r--r--qadevOOo/tests/java/ifc/container/_XContainer.java16
-rw-r--r--qadevOOo/tests/java/ifc/container/_XIndexAccess.java5
-rw-r--r--qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java6
-rw-r--r--qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java18
-rw-r--r--qadevOOo/tests/java/ifc/form/_XFormController.java20
-rw-r--r--qadevOOo/tests/java/ifc/form/_XLoadable.java15
-rw-r--r--qadevOOo/tests/java/ifc/form/_XReset.java18
-rw-r--r--qadevOOo/tests/java/ifc/form/_XSubmit.java14
-rw-r--r--qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java29
-rw-r--r--qadevOOo/tests/java/ifc/form/submission/_XSubmission.java6
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XComponentLoader.java12
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatch.java15
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java8
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java4
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFrame.java4
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XFrameLoader.java15
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java5
-rw-r--r--qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java4
-rw-r--r--qadevOOo/tests/java/ifc/io/_XActiveDataControl.java1
-rw-r--r--qadevOOo/tests/java/ifc/lang/_XComponent.java4
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java10
-rw-r--r--qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java18
-rw-r--r--qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java14
-rw-r--r--qadevOOo/tests/java/ifc/task/_XJobExecutor.java4
-rw-r--r--qadevOOo/tests/java/ifc/text/_XDocumentIndex.java6
-rw-r--r--qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java16
-rw-r--r--qadevOOo/tests/java/ifc/text/_XPagePrintable.java2
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java10
-rw-r--r--qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java14
-rw-r--r--qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java4
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java14
-rw-r--r--qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java16
-rw-r--r--qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java4
51 files changed, 113 insertions, 421 deletions
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
index 98a0309d867a..3002dbe8ced4 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
@@ -114,11 +114,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest {
log.println("fire event");
prod.fireEvent() ;
- try {
- Thread.sleep(3000);
- }
- catch (InterruptedException ex) {
- }
+ util.utils.pause(3000);
boolean works = true;
@@ -163,11 +159,7 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest {
log.println("fire event");
prod.fireEvent() ;
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException ex) {
- }
+ util.utils.shortWait();
if (list.notifiedEvent == null) {
log.println("listener wasn't called -- OK");
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java
index de8787871b8f..fdb7d2fb8c89 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleSelection.java
@@ -212,7 +212,7 @@ public class _XAccessibleSelection extends MultiMethodTest {
if (isSelectable(tEnv.getTestObject(), k)) {
oObj.selectAccessibleChild(k);
- shortWait();
+ util.utils.shortWait();
isSelected = oObj.isAccessibleChildSelected(k);
log.println("isAccessibleChildSelected - " +
isSelected);
@@ -247,7 +247,7 @@ public class _XAccessibleSelection extends MultiMethodTest {
// clearAccessibleSelection() call is oneway so we need
// some waiting
- shortWait();
+ util.utils.shortWait();
if ((childCount > 0) && !OneAlwaysSelected) {
try {
@@ -284,7 +284,7 @@ public class _XAccessibleSelection extends MultiMethodTest {
// selectAllAccessibleChildren() call is oneway so we need
// some waiting
- shortWait();
+ util.utils.shortWait();
boolean res = true;
boolean isSelected = true;
@@ -435,7 +435,7 @@ public class _XAccessibleSelection extends MultiMethodTest {
if (isSelectable(tEnv.getTestObject(), k)) {
oObj.selectAccessibleChild(k);
- shortWait();
+ util.utils.shortWait();
log.println("selected child count: " +
oObj.getSelectedAccessibleChildCount());
XAccessible selChild = oObj.getSelectedAccessibleChild(0);
@@ -583,11 +583,4 @@ public class _XAccessibleSelection extends MultiMethodTest {
return res;
}
-
- private void shortWait() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException ex) {
- }
- }
} \ No newline at end of file
diff --git a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java
index 70b4d9322e04..b61bb04a3749 100644
--- a/qadevOOo/tests/java/ifc/awt/_XImageProducer.java
+++ b/qadevOOo/tests/java/ifc/awt/_XImageProducer.java
@@ -144,9 +144,7 @@ public class _XImageProducer extends MultiMethodTest {
oObj.startProduction() ;
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {}
+ util.utils.shortWait();
tRes.tested("startProduction()", consumer.initCalled) ;
}
diff --git a/qadevOOo/tests/java/ifc/awt/_XItemListener.java b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
index 8bd31ed04ba8..9e0527b5288e 100644
--- a/qadevOOo/tests/java/ifc/awt/_XItemListener.java
+++ b/qadevOOo/tests/java/ifc/awt/_XItemListener.java
@@ -95,9 +95,7 @@ public class _XItemListener extends MultiMethodTest {
event.Highlighted = 2 ;
oObj.itemStateChanged(event) ;
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {}
+ util.utils.pause(200);
result = itemListener.itemStateChangedCalled &&
itemListener.event.Selected == 1 &&
diff --git a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
index 306fed422425..b1900464749a 100644
--- a/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
+++ b/qadevOOo/tests/java/ifc/awt/_XRadioButton.java
@@ -117,9 +117,7 @@ public class _XRadioButton extends MultiMethodTest {
boolean result = true ;
oObj.setState(!state) ;
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {}
+ util.utils.pause(200);
result = oObj.getState() == !state ;
diff --git a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java
index f385db27719e..9c78eec7ff9b 100644
--- a/qadevOOo/tests/java/ifc/awt/_XScrollBar.java
+++ b/qadevOOo/tests/java/ifc/awt/_XScrollBar.java
@@ -39,7 +39,7 @@ public class _XScrollBar extends MultiMethodTest {
public void _addAdjustmentListener() {
util.FormTools.switchDesignOf(tParam.getMSF(),
(XTextDocument) tEnv.getObjRelation("Document"));
- shortWait();
+ util.utils.shortWait();
oObj.addAdjustmentListener(listener);
adjustScrollBar();
@@ -167,7 +167,7 @@ public class _XScrollBar extends MultiMethodTest {
sc.setValue(500);
- shortWait();
+ util.utils.shortWait();
XAccessible acc = UnoRuntime.queryInterface(
XAccessible.class, tEnv.getTestObject());
@@ -186,18 +186,7 @@ public class _XScrollBar extends MultiMethodTest {
System.out.println("couldn't adjust scrollbar");
}
- shortWait();
- }
-
- /**
- * Sleeps for 0.5 sec. to allow Office to react
- */
- private void shortWait() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- log.println("While waiting :" + e);
- }
+ util.utils.shortWait();
}
public class AdjustmentListener
diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinField.java b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
index c1f2e0eb3aba..d6a9b3a9b59f 100644
--- a/qadevOOo/tests/java/ifc/awt/_XSpinField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XSpinField.java
@@ -94,7 +94,7 @@ public class _XSpinField extends MultiMethodTest {
requiredMethod("addSpinListener()") ;
oObj.up() ;
- shortWait();
+ util.utils.shortWait();
tRes.tested("up()", listener.upFl) ;
}
@@ -112,7 +112,7 @@ public class _XSpinField extends MultiMethodTest {
requiredMethod("addSpinListener()") ;
oObj.down() ;
- shortWait();
+ util.utils.shortWait();
tRes.tested("down()", listener.downFl) ;
}
@@ -130,7 +130,7 @@ public class _XSpinField extends MultiMethodTest {
requiredMethod("addSpinListener()") ;
oObj.first() ;
- shortWait();
+ util.utils.shortWait();
tRes.tested("first()", listener.firstFl) ;
}
@@ -148,7 +148,7 @@ public class _XSpinField extends MultiMethodTest {
requiredMethod("addSpinListener()") ;
oObj.last() ;
- shortWait();
+ util.utils.shortWait();
tRes.tested("last()", listener.lastFl) ;
}
@@ -192,16 +192,4 @@ public class _XSpinField extends MultiMethodTest {
tRes.tested("enableRepeat()", true) ;
}
-
- /**
- * Waits for 0.5 sec to allow listener to be called.
- */
- private void shortWait() {
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException ex) {
- }
-
- }
}
diff --git a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java
index b8a2765627f3..ebf5aa75182a 100644
--- a/qadevOOo/tests/java/ifc/awt/_XSpinValue.java
+++ b/qadevOOo/tests/java/ifc/awt/_XSpinValue.java
@@ -38,7 +38,7 @@ public class _XSpinValue extends MultiMethodTest {
public void _addAdjustmentListener() {
util.FormTools.switchDesignOf(tParam.getMSF(),
(XTextDocument) tEnv.getObjRelation("Document"));
- shortWait();
+ util.utils.shortWait();
oObj.addAdjustmentListener(listener);
adjustScrollBar();
@@ -158,7 +158,7 @@ public class _XSpinValue extends MultiMethodTest {
sv.setValue(500);
- shortWait();
+ util.utils.shortWait();
XAccessible acc = UnoRuntime.queryInterface(
XAccessible.class, tEnv.getTestObject());
@@ -177,18 +177,7 @@ public class _XSpinValue extends MultiMethodTest {
System.out.println("couldn't adjust scrollbar");
}
- shortWait();
- }
-
- /**
- * Sleeps for 0.5 sec. to allow Office to react
- */
- private void shortWait() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- log.println("While waiting :" + e);
- }
+ util.utils.shortWait();
}
public class AdjustmentListener
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
index 33f8fdfe10e5..c1a73b656ff3 100644
--- a/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
+++ b/qadevOOo/tests/java/ifc/awt/_XTextComponent.java
@@ -90,11 +90,7 @@ public class _XTextComponent extends MultiMethodTest {
public void _addTextListener(){
oObj.addTextListener(listener);
oObj.setText("Listen");
- try {
- Thread.sleep(500);
- } catch(InterruptedException e) {
- e.printStackTrace(log);
- }
+ util.utils.shortWait();
if (!textChanged) {
log.println("Listener wasn't called after changing Text");
}
diff --git a/qadevOOo/tests/java/ifc/awt/_XTextListener.java b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
index ded65478433d..3a3120802ba3 100644
--- a/qadevOOo/tests/java/ifc/awt/_XTextListener.java
+++ b/qadevOOo/tests/java/ifc/awt/_XTextListener.java
@@ -98,9 +98,7 @@ public class _XTextListener extends MultiMethodTest {
event.dummy1 = 2;
oObj.textChanged(event);
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {}
+ util.utils.pause(200);
result = textListener.textChangedCalled &&
textListener.event.dummy1 == 2;
diff --git a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
index d82baf23b967..22da48aabd52 100644
--- a/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
+++ b/qadevOOo/tests/java/ifc/awt/_XTopWindow.java
@@ -140,7 +140,7 @@ public class _XTopWindow extends MultiMethodTest {
requiredMethod("addTopWindowListener()");
listener.initListener();
oObj.toFront();
- shortWait();
+ util.utils.pause(1000);
tRes.tested("toFront()", listener.activated && !listener.deactivated);
}
@@ -186,13 +186,5 @@ public class _XTopWindow extends MultiMethodTest {
protected void after() {
aTextDoc.dispose();
}
-
- private void shortWait() {
- try {
- Thread.sleep(1000) ;
- } catch (InterruptedException e) {
- System.out.println("While waiting :" + e) ;
- }
- }
}
diff --git a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
index 557abd569634..56dbf5369470 100644
--- a/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
+++ b/qadevOOo/tests/java/ifc/awt/_XUserInputInterception.java
@@ -33,10 +33,13 @@ import com.sun.star.awt.XWindow;
import com.sun.star.frame.XModel;
import com.sun.star.lang.EventObject;
import com.sun.star.uno.UnoRuntime;
+
import java.awt.Robot;
import java.awt.event.InputEvent;
+
import lib.MultiMethodTest;
import util.AccessibilityTools;
+import util.PropertyName;
/**
* Testing <code>com.sun.star.awt.XUserInputInterception</code>
@@ -148,7 +151,7 @@ public class _XUserInputInterception extends MultiMethodTest {
et.run();
- util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
+ util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2);
log.println("key listener thread should be finished.");
@@ -211,7 +214,7 @@ public class _XUserInputInterception extends MultiMethodTest {
et.run();
- util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT) * 2);
+ util.utils.pause(PropertyName.DEFAULT_SHORT_WAIT_MS * 2);
log.println("mouse listener thread should be finished.");
boolean bOK = m_mousePressed1 & m_mouseReleased1 &
diff --git a/qadevOOo/tests/java/ifc/awt/_XWindow.java b/qadevOOo/tests/java/ifc/awt/_XWindow.java
index 44d3f3646c52..0b7a406badf1 100644
--- a/qadevOOo/tests/java/ifc/awt/_XWindow.java
+++ b/qadevOOo/tests/java/ifc/awt/_XWindow.java
@@ -242,7 +242,7 @@ public class _XWindow extends MultiMethodTest {
oObj.setPosSize(0, 0, 100, 100, PosSize.WIDTH);
}
- shortWait();
+ util.utils.pause(200);
boolean res = wListener.resized && wListener.moved &&
!wListener.hidden && !wListener.shown;
result &= res;
@@ -257,10 +257,10 @@ public class _XWindow extends MultiMethodTest {
// testing wListener.windowHidden()
wListener.init();
- shortWait();
+ util.utils.pause(200);
log.println("set object invisible...");
oObj.setVisible(false);
- shortWait();
+ util.utils.pause(200);
res = wListener.hidden && !wListener.resized
&& !wListener.moved && !wListener.shown;
result &= res;
@@ -275,10 +275,10 @@ public class _XWindow extends MultiMethodTest {
// testing wListener.windowShown()
wListener.init() ;
- shortWait();
+ util.utils.pause(200);
log.println("set object visible...");
oObj.setVisible(true) ;
- shortWait();
+ util.utils.pause(200);
res = wListener.shown && !wListener.resized &&
!wListener.hidden && !wListener.moved;
result &= res;
@@ -361,9 +361,9 @@ public class _XWindow extends MultiMethodTest {
// testing fListener.lost()
oObj.setFocus();
- shortWait();
+ util.utils.pause(200);
win.setFocus();
- shortWait();
+ util.utils.pause(200);
result &= fListener.lost;
if (!fListener.lost) {
log.println("Lost focus was not notified about") ;
@@ -371,7 +371,7 @@ public class _XWindow extends MultiMethodTest {
// testing fListener.gained()
oObj.setFocus() ;
- shortWait();
+ util.utils.pause(200);
result &= fListener.gained;
if (!fListener.gained) {
log.println("Gained focus was not notified about") ;
@@ -599,17 +599,5 @@ public class _XWindow extends MultiMethodTest {
tRes.tested("removePaintListener()", true);
}
- /**
- * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(2000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
}
diff --git a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
index 92df9c390bbd..50508ce8c9b6 100644
--- a/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
+++ b/qadevOOo/tests/java/ifc/beans/_XMultiPropertySet.java
@@ -197,7 +197,7 @@ public class _XMultiPropertySet extends MultiMethodTest {
e.printStackTrace(log);
} // end of try-catch
}
- waitAMoment();
+ util.utils.pause(200);
tRes.tested("addPropertiesChangeListener()", propertiesChanged);
}
@@ -216,7 +216,7 @@ public class _XMultiPropertySet extends MultiMethodTest {
propertiesChanged = false ;
oObj.firePropertiesChangeEvent(testPropsNames, PClistener);
- waitAMoment() ;
+ util.utils.pause(200);
tRes.tested("firePropertiesChangeEvent()", propertiesChanged);
}
@@ -336,17 +336,6 @@ public class _XMultiPropertySet extends MultiMethodTest {
testPropsAmount = nr;
}
- /**
- * Waits some time for listener to be called.
- */
- private void waitAMoment() {
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {
- log.println("!!! Exception while waiting !!!") ;
- }
- }
-
/*
* Does nothing.
*/
diff --git a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java
index d942b6d02f85..9272f9660437 100644
--- a/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java
+++ b/qadevOOo/tests/java/ifc/bridge/_XBridgeFactory.java
@@ -162,10 +162,7 @@ public class _XBridgeFactory extends MultiMethodTest {
acceptorThread = new AcceptorThread(xAccptr) ;
acceptorThread.start();
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException e) {}
+ util.utils.shortWait();
conn = xCntr.connect(connectString) ;
} catch (com.sun.star.uno.Exception e) {
diff --git a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java
index 0cb01dd30f88..db2cd8c9727a 100644
--- a/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java
+++ b/qadevOOo/tests/java/ifc/bridge/_XUnoUrlResolver.java
@@ -165,10 +165,7 @@ public class _XUnoUrlResolver extends MultiMethodTest {
xInstProv, connectStr);
brThread.start();
- try {
- Thread.sleep(500);
- }
- catch(InterruptedException e) {}
+ util.utils.shortWait();
// get an instance from the remote
Object obj = oObj.resolve(
"uno:" + connectStr + ";urp;com.sun.star.lang.ServiceManager");
diff --git a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java
index f939eb2c0d42..f0b5dc850fe0 100644
--- a/qadevOOo/tests/java/ifc/connection/_XAcceptor.java
+++ b/qadevOOo/tests/java/ifc/connection/_XAcceptor.java
@@ -146,10 +146,7 @@ public class _XAcceptor extends MultiMethodTest {
acception = new AcceptorThread(oObj) ;
acception.start() ;
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException e) {}
+ util.utils.shortWait();
XConnection con = xConnector.connect(connectString) ;
diff --git a/qadevOOo/tests/java/ifc/connection/_XConnector.java b/qadevOOo/tests/java/ifc/connection/_XConnector.java
index adc8a044e711..5d63fafd2fc6 100644
--- a/qadevOOo/tests/java/ifc/connection/_XConnector.java
+++ b/qadevOOo/tests/java/ifc/connection/_XConnector.java
@@ -127,10 +127,7 @@ public class _XConnector extends MultiMethodTest {
acceptorThread = new AcceptorThread(xAcceptor) ;
acceptorThread.start() ;
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException e) {}
+ util.utils.shortWait();
// connect to acceptor
try {
diff --git a/qadevOOo/tests/java/ifc/container/_XContainer.java b/qadevOOo/tests/java/ifc/container/_XContainer.java
index f3277e9da837..78b8d79140ec 100644
--- a/qadevOOo/tests/java/ifc/container/_XContainer.java
+++ b/qadevOOo/tests/java/ifc/container/_XContainer.java
@@ -254,10 +254,10 @@ public class _XContainer extends MultiMethodTest {
protected boolean performChanges2() {
int precount = CC.getControls().length;
CC.addControl("NewControl",(XControl) inst);
- shortWait();
+ util.utils.pause(1000);
int count = CC.getControls().length;
CC.removeControl(CC.getControl("NewControl"));
- shortWait();
+ util.utils.pause(1000);
return count>precount;
}
@@ -337,18 +337,6 @@ public class _XContainer extends MultiMethodTest {
return res;
}
-
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(1000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
}
diff --git a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java
index 5b5e8f8de987..99e3d609a74e 100644
--- a/qadevOOo/tests/java/ifc/container/_XIndexAccess.java
+++ b/qadevOOo/tests/java/ifc/container/_XIndexAccess.java
@@ -75,10 +75,7 @@ public class _XIndexAccess extends MultiMethodTest {
requiredMethod("getCount()");
// get count from holder
- try {
- Thread.sleep(200);
- }
- catch(InterruptedException e) {}
+ util.utils.pause(200);
boolean result = true;
log.println("Testing getByIndex()");
diff --git a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
index b2b3ff3bb4ca..12e54b665a70 100644
--- a/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/document/_XEventBroadcaster.java
@@ -48,7 +48,7 @@ public class _XEventBroadcaster extends MultiMethodTest {
XModel docModel = UnoRuntime.queryInterface(
XModel.class,tEnv.getTestObject());
docModel.getCurrentController().getFrame().getContainerWindow().setFocus();
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
XController xc = UnoRuntime.queryInterface(XController.class,tEnv.getObjRelation("CONT2"));
xc.getFrame().getContainerWindow().setFocus();
}
@@ -58,7 +58,7 @@ public class _XEventBroadcaster extends MultiMethodTest {
listenerCalled = false;
oObj.addEventListener(listener);
switchFocus();
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
tRes.tested("addEventListener()",listenerCalled);
}
@@ -67,7 +67,7 @@ public class _XEventBroadcaster extends MultiMethodTest {
listenerCalled = false;
oObj.removeEventListener(listener);
switchFocus();
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
tRes.tested("removeEventListener()",!listenerCalled);
}
diff --git a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
index 70eccdc4f3a2..5f93420c1362 100644
--- a/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java
@@ -124,13 +124,13 @@ public class _XChangeBroadcaster extends MultiMethodTest {
win1.setFocus();
changeContent() ;
- shortWait();
+ util.utils.pause(2000);
win2.setFocus();
XTextComponent TC = UnoRuntime.queryInterface
(XTextComponent.class,tEnv.getObjRelation("CONTROL"));
TC.setText("NOXChangeBroadcaster");
- shortWait();
+ util.utils.pause(2000);
tRes.tested("addChangeListener()", changed);
}
@@ -156,23 +156,11 @@ public class _XChangeBroadcaster extends MultiMethodTest {
changeContent() ;
win2.setFocus();
- shortWait();
+ util.utils.pause(2000);
tRes.tested("removeChangeListener()", !changed);
}
/**
- * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(2000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
- /**
* Changes the content of the component depending on whether
* <code>XTextComponent</code> is supported or not. If yes
* then the text is chahged, if not the relation <code>change()</code>
diff --git a/qadevOOo/tests/java/ifc/form/_XFormController.java b/qadevOOo/tests/java/ifc/form/_XFormController.java
index 241df1c5c969..f8024d17e664 100644
--- a/qadevOOo/tests/java/ifc/form/_XFormController.java
+++ b/qadevOOo/tests/java/ifc/form/_XFormController.java
@@ -87,10 +87,10 @@ public class _XFormController extends MultiMethodTest {
XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl);
wind.setFocus();
- shortWait();
+ util.utils.pause(1000);
XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
otherWind.setFocus();
- shortWait();
+ util.utils.pause(1000);
log.println("activated = " + listener.activated +
", deactivated = " + listener.deactivated) ;
@@ -112,10 +112,10 @@ public class _XFormController extends MultiMethodTest {
XWindow wind = UnoRuntime.queryInterface(XWindow.class, cntrl);
wind.setFocus();
- shortWait();
+ util.utils.pause(1000);
XWindow otherWind = (XWindow)tEnv.getObjRelation("otherWindow");
otherWind.setFocus();
- shortWait();
+ util.utils.pause(1000);
log.println("activated = " + listener.activated +
", deactivated = " + listener.deactivated) ;
@@ -148,17 +148,5 @@ public class _XFormController extends MultiMethodTest {
tRes.tested("getCurrentControl()", res) ;
}
-
- /**
- * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(1000) ;
- } catch (InterruptedException e) {
- System.out.println("While waiting :" + e) ;
- }
- }
}
diff --git a/qadevOOo/tests/java/ifc/form/_XLoadable.java b/qadevOOo/tests/java/ifc/form/_XLoadable.java
index 27729c2b30c1..da8f57bb140e 100644
--- a/qadevOOo/tests/java/ifc/form/_XLoadable.java
+++ b/qadevOOo/tests/java/ifc/form/_XLoadable.java
@@ -99,15 +99,6 @@ public class _XLoadable extends MultiMethodTest {
}
/**
- * Waits for 0.1 second. Used to get time for load completion.
- */
- private void shortWait() {
- try {
- Thread.sleep(100);
- } catch (InterruptedException e) {}
- }
-
- /**
* Loads the form. <p>
* Has <b> OK </b> status if <code>isLoaded()</code> returns
* <code>true</code> and listener method <code>loaded()</code>
@@ -126,7 +117,7 @@ public class _XLoadable extends MultiMethodTest {
boolean result = true ;
oObj.load() ;
- shortWait() ;
+ util.utils.pause(100);
result = oObj.isLoaded() && loadListener.loadedCalled ;
tRes.tested("load()", result) ;
@@ -151,7 +142,7 @@ public class _XLoadable extends MultiMethodTest {
boolean result = true ;
oObj.unload() ;
- shortWait() ;
+ util.utils.pause(100);
result = !oObj.isLoaded() && loadListener.unloadedCalled ;
tRes.tested("unload()", result) ;
@@ -176,7 +167,7 @@ public class _XLoadable extends MultiMethodTest {
boolean result = true ;
oObj.reload() ;
- shortWait() ;
+ util.utils.pause(100);
result = oObj.isLoaded() && loadListener.reloadedCalled;
tRes.tested("reload()", result) ;
diff --git a/qadevOOo/tests/java/ifc/form/_XReset.java b/qadevOOo/tests/java/ifc/form/_XReset.java
index f61c114acdbc..033b9a3d1b2a 100644
--- a/qadevOOo/tests/java/ifc/form/_XReset.java
+++ b/qadevOOo/tests/java/ifc/form/_XReset.java
@@ -134,11 +134,11 @@ public class _XReset extends MultiMethodTest {
log.println("Testing reset() ...");
approve = false;
oObj.reset();
- shortWait();
+ util.utils.shortWait();
tRes.tested("reset()", (approveReset[0] && (! resetted[0])));
approve = true;
oObj.reset();
- shortWait();
+ util.utils.shortWait();
tRes.tested("addResetListener()", (approveReset[1] && resetted[1]));
} // finished _reset
@@ -159,23 +159,11 @@ public class _XReset extends MultiMethodTest {
approveReset[0] = resetted[0] = false;
oObj.removeResetListener(listener1);
oObj.reset();
- shortWait();
+ util.utils.shortWait();
tRes.tested("removeResetListener()", !approveReset[0] && !resetted[0]);
//removing the second listener here may avoid crashing the office
} // finished _removeResetListener()
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
} // finished class _XRefresh
diff --git a/qadevOOo/tests/java/ifc/form/_XSubmit.java b/qadevOOo/tests/java/ifc/form/_XSubmit.java
index 7cec878a2c03..bfe3c2ba0611 100644
--- a/qadevOOo/tests/java/ifc/form/_XSubmit.java
+++ b/qadevOOo/tests/java/ifc/form/_XSubmit.java
@@ -134,7 +134,7 @@ public class _XSubmit extends MultiMethodTest {
}
oObj.submit(cntrl, new MouseEvent());
- shortWait();
+ util.utils.pause(200);
log.println("Listener1 called " + listener1.called + " times");
log.println("Listener2 called " + listener2.called + " times");
@@ -160,18 +160,6 @@ public class _XSubmit extends MultiMethodTest {
}
/**
- * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
- /**
* Forces environment recreation.
*/
@Override
diff --git a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
index fbd9def90b75..34ca21809240 100644
--- a/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/form/_XUpdateBroadcaster.java
@@ -136,12 +136,12 @@ public class _XUpdateBroadcaster extends MultiMethodTest {
try {
checker.update() ;
- shortWait() ;
+ util.utils.pause(200);
checker.commit() ;
- shortWait() ;
+ util.utils.pause(200);
boolean committed = checker.wasCommited() ;
- shortWait() ;
+ util.utils.pause(200);
bResult = listener.approveCalled &&
! listener.updateCalled &&
@@ -152,18 +152,18 @@ public class _XUpdateBroadcaster extends MultiMethodTest {
(listener.updateCalled ? "":"NOT")+" called, the value was " +
(committed ? "" : "NOT") + " committed.") ;
- shortWait() ;
+ util.utils.pause(200);
listener.init() ;
listener.approve = true ;
- shortWait() ;
+ util.utils.pause(200);
checker.update() ;
- shortWait() ;
+ util.utils.pause(200);
checker.commit() ;
- shortWait() ;
+ util.utils.pause(200);
committed = checker.wasCommited() ;
- shortWait() ;
+ util.utils.pause(200);
log.println("Calling with approving : approveUpdate() was " +
(listener.approveCalled ? "":"NOT")+" called, updated() was "+
@@ -202,10 +202,10 @@ public class _XUpdateBroadcaster extends MultiMethodTest {
try {
checker.update() ;
- shortWait() ;
+ util.utils.pause(200);
checker.commit() ;
- shortWait() ;
+ util.utils.pause(200);
bResult = ! listener.approveCalled &&
! listener.updateCalled ;
@@ -219,15 +219,6 @@ public class _XUpdateBroadcaster extends MultiMethodTest {
tRes.tested("removeUpdateListener()", bResult);
}
- private void shortWait() {
- try {
- Thread.sleep(200);
- }
- catch (InterruptedException ex) {
- }
-
- }
-
/**
* Forces environment recreation.
*/
diff --git a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java
index c93424d318df..194319580c7f 100644
--- a/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java
+++ b/qadevOOo/tests/java/ifc/form/submission/_XSubmission.java
@@ -110,11 +110,7 @@ public class _XSubmission extends MultiMethodTest {
log.println("Sleeping 2s");
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- // sleeping didn't work
- }
+ util.utils.pause(2000);
log.println("... done");
diff --git a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java
index 8422b8682448..fdcb31fd0940 100644
--- a/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java
+++ b/qadevOOo/tests/java/ifc/frame/_XComponentLoader.java
@@ -65,11 +65,7 @@ public class _XComponentLoader extends MultiMethodTest {
oDoc = oObj.loadComponentFromURL(
url, frameName, 0, szArgs);
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException ex) {
- }
+ util.utils.shortWait();
oDoc.dispose();
@@ -78,11 +74,7 @@ public class _XComponentLoader extends MultiMethodTest {
oDoc = oObj.loadComponentFromURL(
url, frameName, 0, szArgs);
- try {
- Thread.sleep(500);
- }
- catch (InterruptedException ex) {
- }
+ util.utils.shortWait();
oDoc.dispose();
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatch.java b/qadevOOo/tests/java/ifc/frame/_XDispatch.java
index f686150ab870..59dfe64c3101 100644
--- a/qadevOOo/tests/java/ifc/frame/_XDispatch.java
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatch.java
@@ -130,10 +130,7 @@ public class _XDispatch extends MultiMethodTest {
notificationListener = new TestNotificationListener(log) ;
xND.dispatchWithNotification(url, arguments, notificationListener);
- try {
- Thread.sleep(200);
- }
- catch(InterruptedException e) {}
+ util.utils.pause(200);
log.println(" Listener called: "+ notificationListener.finishedDispatch);
@@ -174,10 +171,7 @@ public class _XDispatch extends MultiMethodTest {
oObj.dispatch(url, new PropertyValue[0]) ;
- try {
- Thread.sleep(200);
- }
- catch(InterruptedException e) {}
+ util.utils.pause(200);
log.println("Listener called: "+ listener.statusChangedCalled);
@@ -219,10 +213,7 @@ public class _XDispatch extends MultiMethodTest {
oObj.dispatch(url, new PropertyValue[0]) ;
- try {
- Thread.sleep(200);
- }
- catch(InterruptedException e) {}
+ util.utils.pause(200);
System.out.println("Listener called: "+ listener.statusChangedCalled);
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java
index 03225e4170e2..f9b9bbe65ae2 100644
--- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorder.java
@@ -86,7 +86,7 @@ public class _XDispatchRecorder extends MultiMethodTest {
XDispatch xDisp = xDispProv.queryDispatch(dispURL, "", 0);
xDisp.dispatch(dispURL, dispArgs);
- shortWait();
+ util.utils.shortWait();
log.println("Getting macro ... :");
String macro = oObj.getRecordedMacro();
@@ -195,12 +195,6 @@ public class _XDispatchRecorder extends MultiMethodTest {
}
- private void shortWait() {
- try {
- Thread.sleep(500);
- } catch (InterruptedException ex) {}
- }
-
private void clearBuffer() {
oObj.startRecording(xFrame);
oObj.endRecording();
diff --git a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java
index f92f366e0683..938c298296e5 100644
--- a/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java
+++ b/qadevOOo/tests/java/ifc/frame/_XDispatchRecorderSupplier.java
@@ -173,9 +173,7 @@ public class _XDispatchRecorderSupplier extends MultiMethodTest {
}
}
- try {
- Thread.sleep(500);
- } catch (InterruptedException ex) {}
+ util.utils.shortWait();
XModel model = UnoRuntime.queryInterface(XModel.class, xTextDoc);
XFrame fr = model.getCurrentController().getFrame();
diff --git a/qadevOOo/tests/java/ifc/frame/_XFrame.java b/qadevOOo/tests/java/ifc/frame/_XFrame.java
index 1771e3d8faf0..c24c4fa2145e 100644
--- a/qadevOOo/tests/java/ifc/frame/_XFrame.java
+++ b/qadevOOo/tests/java/ifc/frame/_XFrame.java
@@ -189,9 +189,7 @@ public class _XFrame extends MultiMethodTest {
return;
}
- try {
- Thread.sleep(500);
- }catch (InterruptedException ex) {}
+ util.utils.shortWait();
if (!listenerCalled[0]) {
diff --git a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java
index a71491e002cd..0fb7b9acd225 100644
--- a/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java
+++ b/qadevOOo/tests/java/ifc/frame/_XFrameLoader.java
@@ -104,7 +104,7 @@ public class _XFrameLoader extends MultiMethodTest {
.createInstance("com.sun.star.frame.Desktop") ;
XDesktop dsk = UnoRuntime.queryInterface(XDesktop.class, oDsk) ;
- shortWait() ;
+ util.utils.shortWait();
frame = dsk.getCurrentFrame() ;
} catch ( com.sun.star.uno.Exception e ) {
// Some exception occurs.FAILED
@@ -146,7 +146,7 @@ public class _XFrameLoader extends MultiMethodTest {
if (!loaded) {
oObj.load(frame, url, args, listener) ;
- shortWait();
+ util.utils.shortWait();
loaded = listener.finished ;
}
@@ -166,7 +166,7 @@ public class _XFrameLoader extends MultiMethodTest {
oObj.load(frame, url, args, listener) ;
oObj.cancel() ;
- shortWait();
+ util.utils.shortWait();
if (listener.cancelled) {
log.println("Loading was canceled.") ;
@@ -188,14 +188,5 @@ public class _XFrameLoader extends MultiMethodTest {
if (frameSup != null) frameSup.dispose() ;
frame.dispose();
}
-
- private void shortWait() {
- try {
- Thread.sleep(5000);
- }
- catch (InterruptedException ex) {
- }
-
- }
}
diff --git a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java
index a4a94055c328..eaf3b554dd55 100644
--- a/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java
+++ b/qadevOOo/tests/java/ifc/frame/_XNotifyingDispatch.java
@@ -106,10 +106,7 @@ public class _XNotifyingDispatch extends MultiMethodTest {
oObj.dispatchWithNotification(url, arguments, notificationListener);
- try {
- Thread.sleep(200);
- }
- catch(InterruptedException e) {}
+ util.utils.pause(200);
log.println("Listener called: "+ notificationListener.finishedDispatch);
diff --git a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java
index 109dfa5fbb4b..6b3ed19d0265 100644
--- a/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java
+++ b/qadevOOo/tests/java/ifc/frame/_XSynchronousFrameLoader.java
@@ -151,9 +151,7 @@ public class _XSynchronousFrameLoader extends MultiMethodTest {
oObj.cancel() ;
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {}
+ util.utils.pause(1000);
tRes.tested("cancel()", !result[0]) ;
diff --git a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java
index 52952cfd2695..ffcd3d65c147 100644
--- a/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java
+++ b/qadevOOo/tests/java/ifc/io/_XActiveDataControl.java
@@ -135,6 +135,7 @@ public class _XActiveDataControl extends MultiMethodTest {
oObj.start();
// waiting a little bit for data transferred
+ util.utils.pause(200);
try {
Thread.sleep(200);
} catch (InterruptedException e) {
diff --git a/qadevOOo/tests/java/ifc/lang/_XComponent.java b/qadevOOo/tests/java/ifc/lang/_XComponent.java
index c05b7c5deffe..b1c8399f6679 100644
--- a/qadevOOo/tests/java/ifc/lang/_XComponent.java
+++ b/qadevOOo/tests/java/ifc/lang/_XComponent.java
@@ -142,9 +142,7 @@ public class _XComponent extends MultiMethodTest {
altDispose.dispose();
}
- try {
- Thread.sleep(500) ;
- } catch (InterruptedException e) {}
+ util.utils.shortWait();
if (Loutput[0]!=null) log.println(Loutput[0]);
if (Loutput[1]!=null) log.println(Loutput[1]);
log.println( "end dispose" + Thread.currentThread());
diff --git a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java
index a9a5b8535e2f..55da8c133513 100644
--- a/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/sheet/_XEnhancedMouseClickBroadcaster.java
@@ -100,7 +100,7 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest {
rob.mouseRelease(InputEvent.BUTTON3_MASK);
System.out.println("done");
System.out.println("warte");
- shortWait();
+ util.utils.pause(200);
System.out.println("Press Button");
rob.mousePress(InputEvent.BUTTON1_MASK);
System.out.println("Release Button");
@@ -114,14 +114,6 @@ public class _XEnhancedMouseClickBroadcaster extends MultiMethodTest {
return true;
}
- private void shortWait() {
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e) {
- System.out.println("While waiting :" + e);
- }
- }
-
protected class MyListener implements XEnhancedMouseClickHandler {
public void disposing(
com.sun.star.lang.EventObject eventObject) {
diff --git a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
index 053e0df20a4a..a8767cc1a0b5 100644
--- a/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
+++ b/qadevOOo/tests/java/ifc/sheet/_XRangeSelection.java
@@ -62,7 +62,7 @@ public class _XRangeSelection extends MultiMethodTest {
XWindow xWindow = xModel.getCurrentController().getFrame().getContainerWindow();
XTopWindow xTopWindow = UnoRuntime.queryInterface(XTopWindow.class, xWindow);
xTopWindow.toFront();
- util.utils.shortWait(500);
+ util.utils.pause(500);
}
@@ -114,7 +114,7 @@ public class _XRangeSelection extends MultiMethodTest {
props[2].Value = Boolean.FALSE;
oObj.startRangeSelection(props);
// wait for listeners
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
// get closer button: move if window cobvers the sheet center
Point closer = getCloser(center);
@@ -123,22 +123,22 @@ public class _XRangeSelection extends MultiMethodTest {
// do something to trigger the listeners
clickOnSheet(center);
- util.utils.shortWait(5000);
+ util.utils.pause(5000);
// click on closer
clickOnSheet(closer);
- util.utils.shortWait(5000);
+ util.utils.pause(5000);
// open a new range selection
props[0].Value = "C4:E6";
oObj.startRangeSelection(props);
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
props[0].Value = "C2:E3";
oObj.startRangeSelection(props);
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
oObj.startRangeSelection(props);
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
oObj.abortRangeSelection();
aListener.reset();
System.out.println("Listener called: " + aListener.bAbortCalled);
@@ -295,9 +295,9 @@ public class _XRangeSelection extends MultiMethodTest {
Robot rob = new Robot();
rob.mouseMove(point.X, point.Y);
rob.mousePress(InputEvent.BUTTON1_MASK);
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
rob.mouseRelease(InputEvent.BUTTON1_MASK);
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
} catch (java.awt.AWTException e) {
log.println("couldn't press mouse button");
}
diff --git a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java
index 362ca903c880..35fc2f1ac08b 100644
--- a/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java
+++ b/qadevOOo/tests/java/ifc/system/_XSystemShellExecute.java
@@ -90,7 +90,7 @@ public class _XSystemShellExecute extends MultiMethodTest {
} catch(com.sun.star.uno.Exception e) {
log.println("Exception:" + e);
}
- shortWait();
+ util.utils.pause(1000);
i++;
}
@@ -103,18 +103,6 @@ public class _XSystemShellExecute extends MultiMethodTest {
tRes.tested("execute()", bExist);
}
-
- /**
- * Sleeps to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(1000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
} // finish class _XSystemShellExecute
diff --git a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java
index 0c8ec5257d93..d13cf0ead61b 100644
--- a/qadevOOo/tests/java/ifc/task/_XJobExecutor.java
+++ b/qadevOOo/tests/java/ifc/task/_XJobExecutor.java
@@ -57,9 +57,7 @@ public class _XJobExecutor extends MultiMethodTest {
oObj.trigger("TestEvent");
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {}
+ util.utils.pause(1000);
int after = Integer.parseInt(counter.getName());
diff --git a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java
index bef2f396849d..bb843ee2d22b 100644
--- a/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java
+++ b/qadevOOo/tests/java/ifc/text/_XDocumentIndex.java
@@ -96,11 +96,7 @@ public class _XDocumentIndex extends MultiMethodTest {
oObj.update();
- try {
- Thread.sleep(1000);
- }
- catch (InterruptedException ex) {
- }
+ util.utils.pause(1000);
String contentAfter = oObj.getAnchor().getString();
diff --git a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java
index 13bd492edacf..003d732c5943 100644
--- a/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/text/_XMailMergeBroadcaster.java
@@ -103,7 +103,7 @@ public class _XMailMergeBroadcaster extends MultiMethodTest {
("'could not fire event: " + e)) ;
}
- shortWait();
+ util.utils.pause(200);
tRes.tested("addMailMergeEventListener()", changed);
}
@@ -132,23 +132,11 @@ public class _XMailMergeBroadcaster extends MultiMethodTest {
("'could not fire event: " + e)) ;
}
- shortWait();
+ util.utils.pause(200);
tRes.tested("removeMailMergeEventListener()", !changed);
}
- /**
- * Sleeps for 0.2 sec. to allow StarOffice to react on <code>
- * execute</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(200) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
} // finished class _XMailMergeBroadcaster
diff --git a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java
index 55bf4fae025d..452fe6ad9aaf 100644
--- a/qadevOOo/tests/java/ifc/text/_XPagePrintable.java
+++ b/qadevOOo/tests/java/ifc/text/_XPagePrintable.java
@@ -132,7 +132,7 @@ public class _XPagePrintable extends MultiMethodTest {
oObj.printPages(PrintOptions);
- util.utils.shortWait(tParam.getInt(util.PropertyName.SHORT_WAIT));
+ util.utils.shortWait();
if (! util.utils.fileExists(xMSF, printFile)){
log.println("ERROR: could not find '" + printFile + "'");
diff --git a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java
index 751c22efacfd..d270850d78ca 100644
--- a/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java
+++ b/qadevOOo/tests/java/ifc/ucb/_XCommandProcessor.java
@@ -200,20 +200,14 @@ public class _XCommandProcessor extends MultiMethodTest {
for (int i = 0; i < 10; i++) {
log.println("try to abort command");
oObj.abort(cmdId);
- try {
- Thread.sleep(10);
- } catch (InterruptedException e) {
- }
+ util.utils.pause(10);
}
}
};
aborter.start();
- try {
- Thread.sleep(15);
- } catch (InterruptedException e) {
- }
+ util.utils.pause(15);
log.println("executing command");
try {
diff --git a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java
index 00c6103f1d9d..6e1acd537d49 100644
--- a/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java
+++ b/qadevOOo/tests/java/ifc/ucb/_XSimpleFileAccess2.java
@@ -47,7 +47,7 @@ public class _XSimpleFileAccess2 extends MultiMethodTest {
String filename = dirname+"XSimpleFileAccess.txt";
XInputStream iStream = oObj.openFileRead(filename);
oObj.writeFile(fileURL,iStream);
- shortWait();
+ util.utils.pause(1000);
result = oObj.exists(fileURL);
oObj.kill(fileURL);
tRes.tested("writeFile()",result);
@@ -66,17 +66,5 @@ public class _XSimpleFileAccess2 extends MultiMethodTest {
} //EOF writeFile()
- /**
- * Sleeps for 1 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(1000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
} // finish class _XSimpleFileAccess
diff --git a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java
index 06c61013f7a2..243fdc0dc7c5 100644
--- a/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java
+++ b/qadevOOo/tests/java/ifc/ui/_XContextMenuInterception.java
@@ -68,7 +68,7 @@ public class _XContextMenuInterception extends MultiMethodTest {
log.println("ensure that the first model is focused");
DesktopTools.bringWindowToFront(docModel);
- utils.shortWait(3000);
+ utils.pause(3000);
}
@Override
@@ -182,7 +182,7 @@ public class _XContextMenuInterception extends MultiMethodTest {
log.println("couldn't press mouse button");
}
- utils.shortWait(1000);
+ utils.pause(1000);
}
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
index 6cfcc92de4e2..bb10c5abd9cd 100644
--- a/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java
@@ -73,7 +73,7 @@ public class _XExecutableDialog extends MultiMethodTest {
eThread.start();
XCancellable canc = UnoRuntime.queryInterface
(XCancellable.class, tEnv.getTestObject());
- shortWait();
+ util.utils.pause(2000);
if (canc != null) {
closeDialog();
short res = eThread.execRes;
@@ -115,18 +115,6 @@ public class _XExecutableDialog extends MultiMethodTest {
}
}
- /**
- * Sleeps for 5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(2000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
@Override
public void after() {
if (eThread.isAlive()) {
diff --git a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
index f34dd3e879ec..603e6285af01 100644
--- a/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
+++ b/qadevOOo/tests/java/ifc/ui/dialogs/_XFilePickerNotifier.java
@@ -134,7 +134,7 @@ public class _XFilePickerNotifier extends MultiMethodTest {
e.printStackTrace(log) ;
}
- shortWait();
+ util.utils.pause(2000);
if (!listener.called) {
log.println("Listener wasn't called :-(");
@@ -169,7 +169,7 @@ public class _XFilePickerNotifier extends MultiMethodTest {
e.printStackTrace(log) ;
}
- shortWait();
+ util.utils.pause(2000);
closeDialog();
@@ -200,18 +200,6 @@ public class _XFilePickerNotifier extends MultiMethodTest {
}
}
- /**
- * Sleeps for 0.5 sec. to allow StarOffice to react on <code>
- * reset</code> call.
- */
- private void shortWait() {
- try {
- Thread.sleep(2000) ;
- } catch (InterruptedException e) {
- log.println("While waiting :" + e) ;
- }
- }
-
private void closeDialog() {
XCancellable canc = UnoRuntime.queryInterface(
XCancellable.class, tEnv.getTestObject());
diff --git a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java
index 4eceb4ac15c7..221cb7cb5400 100644
--- a/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/view/_XPrintJobBroadcaster.java
@@ -53,7 +53,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest {
public void _addPrintJobListener() {
oObj.addPrintJobListener(listenerImpl);
listenerImpl.fireEvent();
- util.utils.shortWait(1000);
+ util.utils.pause(1000);
tRes.tested("addPrintJobListener()", listenerImpl.actionTriggered());
}
@@ -64,7 +64,7 @@ public class _XPrintJobBroadcaster extends MultiMethodTest {
requiredMethod("addPrintJobListener");
oObj.removePrintJobListener(listenerImpl);
- util.utils.shortWait(5000);
+ util.utils.pause(5000);
listenerImpl.reset();
listenerImpl.fireEvent();