summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-03-02 13:49:19 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-04-17 16:14:53 +0100
commite89231bf31554e123dec1569a120be5cc24b6b8d (patch)
treef20fda26d0b90cf848818cd99c294232d95a5255 /unotest
parentfa15135c278e7f371c7bc22bc85e53198b521ca9 (diff)
OfficeConnection.java: don't wait forever if terminate() fails
Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/java/org/openoffice/test/OfficeConnection.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/unotest/source/java/org/openoffice/test/OfficeConnection.java b/unotest/source/java/org/openoffice/test/OfficeConnection.java
index ae2cae058667..3f2544308c31 100644
--- a/unotest/source/java/org/openoffice/test/OfficeConnection.java
+++ b/unotest/source/java/org/openoffice/test/OfficeConnection.java
@@ -125,6 +125,12 @@ public final class OfficeConnection {
context = null;
try {
desktopTerminated = desktop.terminate();
+ if (!desktopTerminated) {
+ // in case terminate() fails we would wait forever
+ // for the process to die, so kill it
+ process.destroy();
+ }
+ assertTrue(desktopTerminated);
} catch (DisposedException e) {}
// it appears that DisposedExceptions can already happen
// while receiving the response of the terminate call
@@ -139,7 +145,6 @@ public final class OfficeConnection {
}
boolean outTerminated = outForward == null || outForward.terminated();
boolean errTerminated = errForward == null || errForward.terminated();
- assertTrue(desktopTerminated);
assertEquals(0, code);
assertTrue(outTerminated);
assertTrue(errTerminated);