summaryrefslogtreecommitdiff
path: root/qadevOOo/runner/complexlib
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-02-02 12:55:31 +0000
committerRüdiger Timm <rt@openoffice.org>2005-02-02 12:55:31 +0000
commit7a0d011855683b7a5eacb96b132bb261ff7f22ca (patch)
treee3a5d73d6852e25eca064b9679a55231d92e659c /qadevOOo/runner/complexlib
parent8f0e6abd15999aebb60aaa1527bbdddc9f78f01a (diff)
INTEGRATION: CWS imprec01 (1.9.94); FILE MERGED
2005/01/10 12:56:36 cn 1.9.94.1: enable OfficeWatcher for retrigger of TimeOut while logging
Diffstat (limited to 'qadevOOo/runner/complexlib')
-rw-r--r--qadevOOo/runner/complexlib/ComplexTestCase.java36
1 files changed, 33 insertions, 3 deletions
diff --git a/qadevOOo/runner/complexlib/ComplexTestCase.java b/qadevOOo/runner/complexlib/ComplexTestCase.java
index 7cba01b4cf95..4a7696e036c7 100644
--- a/qadevOOo/runner/complexlib/ComplexTestCase.java
+++ b/qadevOOo/runner/complexlib/ComplexTestCase.java
@@ -2,9 +2,9 @@
*
* $RCSfile: ComplexTestCase.java,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Date: 2003-12-11 11:31:22 $
+ * last change: $Date: 2005-02-02 13:55:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -158,12 +158,42 @@ public abstract class ComplexTestCase implements ComplexTest {
(java.io.PrintWriter)log);
log.println("Starting " + testMethod.getName());
th.start();
+
try {
+ // some tests are very dynamic in its exceution time so that
+ // a threadTimeOut fials. In this cases the logging mechanisim
+ // is a usefull way to detect that a office respective a test
+ // is running and not death.
+ // But way ThreadTimeOut?
+ // There exeitsts a complex test which uses no office. Therefore
+ // a logging mechanisim to detect a stalled test.
+
+ int lastPing = -1;
+ int newPing = 0;
+
int sleepingStep = 1000;
int factor = 0;
- while(th.isAlive() && factor*sleepingStep<mThreadTimeOut) {
+
+ while(
+ th.isAlive() &&
+ (
+ lastPing != newPing ||
+ factor*sleepingStep<mThreadTimeOut
+ )
+ )
+ {
Thread.sleep(sleepingStep);
factor++;
+ // if a test starts the office itself it the watcher is a
+ // new one.
+ share.Watcher ow = (share.Watcher)
+ param.get("Watcher");
+ if (ow != null) {
+ lastPing = newPing;
+ newPing = ow.getPing();
+ //System.out.println("lastPing: '" + lastPing + "' newPing '" + newPing + "'");
+ factor = 0;
+ }
}
}