summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/source/cpp/officeconnection.cxx50
-rw-r--r--test/source/java/OfficeConnection.java13
2 files changed, 23 insertions, 40 deletions
diff --git a/test/source/cpp/officeconnection.cxx b/test/source/cpp/officeconnection.cxx
index 210989f10b15..7940a327b0fa 100644
--- a/test/source/cpp/officeconnection.cxx
+++ b/test/source/cpp/officeconnection.cxx
@@ -100,38 +100,26 @@ void OfficeConnection::setUp() {
toAbsoluteFileUrl(argPath).pData, args,
sizeof args / sizeof args[0], 0, 0, 0, envs, envs == 0 ? 0 : 1,
&process_));
- try {
- css::uno::Reference< css::bridge::XUnoUrlResolver > resolver(
- css::bridge::UnoUrlResolver::create(
- cppu::defaultBootstrap_InitialComponentContext()));
- for (int i = 0;; ++i) {
- try {
- factory_ =
- css::uno::Reference< css::lang::XMultiServiceFactory >(
- resolver->resolve(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:")) +
- desc +
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- ";StarOffice.ServiceManager"))),
- css::uno::UNO_QUERY_THROW);
- break;
- } catch (css::connection::NoConnectException &) {
- if (i == 600) { // 600 sec
- throw;
- }
- }
- TimeValue delay = { 1, 0 }; // 1 sec
- CPPUNIT_ASSERT_EQUAL(
- osl_Process_E_TimedOut,
- osl_joinProcessWithTimeout(process_, &delay));
- }
- } catch (...) {
+ css::uno::Reference< css::bridge::XUnoUrlResolver > resolver(
+ css::bridge::UnoUrlResolver::create(
+ cppu::defaultBootstrap_InitialComponentContext()));
+ for (int i = 0;; ++i) {
+ try {
+ factory_ =
+ css::uno::Reference< css::lang::XMultiServiceFactory >(
+ resolver->resolve(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("uno:")) +
+ desc +
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ ";StarOffice.ServiceManager"))),
+ css::uno::UNO_QUERY_THROW);
+ break;
+ } catch (css::connection::NoConnectException &) {}
+ TimeValue delay = { 1, 0 }; // 1 sec
CPPUNIT_ASSERT_EQUAL(
- osl_Process_E_None, osl_terminateProcess(process_));
- osl_freeProcessHandle(process_);
- process_ = 0;
- throw;
+ osl_Process_E_TimedOut,
+ osl_joinProcessWithTimeout(process_, &delay));
}
}
diff --git a/test/source/java/OfficeConnection.java b/test/source/java/OfficeConnection.java
index f28e385e64dd..d4d7d7a70007 100644
--- a/test/source/java/OfficeConnection.java
+++ b/test/source/java/OfficeConnection.java
@@ -74,11 +74,7 @@ public final class OfficeConnection {
"uno:" + description +
";urp;StarOffice.ServiceManager"));
break;
- } catch (NoConnectException e) {
- if (i == 600) { // 600 sec
- throw e;
- }
- }
+ } catch (NoConnectException e) {}
assertNull(waitForProcess(process, 1000)); // 1 sec
}
}
@@ -99,15 +95,14 @@ public final class OfficeConnection {
// receiving the response of the terminate call
desktop = null;
}
- Integer code = 0;
+ int code = 0;
if (process != null) {
- code = waitForProcess(process, 600000); // 600 sec
- process.destroy();
+ code = process.waitFor();
}
boolean outTerminated = outForward == null || outForward.terminated();
boolean errTerminated = errForward == null || errForward.terminated();
assertTrue(desktopTerminated);
- assertEquals(new Integer(0), code);
+ assertEquals(0, code);
assertTrue(outTerminated);
assertTrue(errTerminated);
}