summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-07-06 15:23:32 +0200
committersb <sb@openoffice.org>2010-07-06 15:23:32 +0200
commite8d3f4cc2cc59fefcd2fb44165cc1a37eb9d5e1d (patch)
treee889814bfb079d55604b453c288a707418208a6a /test
parentaf970845ba8b95a84a45fc84f646c5e5c938f8cb (diff)
sb123: #i112519# do not terminate OOo accessed via OOO_TEST_SOFFICE=connect:...
Diffstat (limited to 'test')
-rw-r--r--test/source/cpp/officeconnection.cxx31
-rw-r--r--test/source/java/org/openoffice/test/OfficeConnection.java34
2 files changed, 34 insertions, 31 deletions
diff --git a/test/source/cpp/officeconnection.cxx b/test/source/cpp/officeconnection.cxx
index d18f266ecb7d..4baa18081379 100644
--- a/test/source/cpp/officeconnection.cxx
+++ b/test/source/cpp/officeconnection.cxx
@@ -137,22 +137,23 @@ void OfficeConnection::setUp() {
}
void OfficeConnection::tearDown() {
- if (context_.is()) {
- css::uno::Reference< css::frame::XDesktop > desktop(
- context_->getServiceManager()->createInstanceWithContext(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")),
- context_),
- css::uno::UNO_QUERY_THROW);
- context_.clear();
- try {
- CPPUNIT_ASSERT(desktop->terminate());
- desktop.clear();
- } catch (css::lang::DisposedException &) {}
- // it appears that DisposedExceptions can already happen while
- // receiving the response of the terminate call
- }
if (process_ != 0) {
+ if (context_.is()) {
+ css::uno::Reference< css::frame::XDesktop > desktop(
+ context_->getServiceManager()->createInstanceWithContext(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.frame.Desktop")),
+ context_),
+ css::uno::UNO_QUERY_THROW);
+ context_.clear();
+ try {
+ CPPUNIT_ASSERT(desktop->terminate());
+ desktop.clear();
+ } catch (css::lang::DisposedException &) {}
+ // it appears that DisposedExceptions can already happen while
+ // receiving the response of the terminate call
+ }
CPPUNIT_ASSERT_EQUAL(osl_Process_E_None, osl_joinProcess(process_));
oslProcessInfo info;
info.Size = sizeof info;
diff --git a/test/source/java/org/openoffice/test/OfficeConnection.java b/test/source/java/org/openoffice/test/OfficeConnection.java
index e87efb210f62..60978717a993 100644
--- a/test/source/java/org/openoffice/test/OfficeConnection.java
+++ b/test/source/java/org/openoffice/test/OfficeConnection.java
@@ -104,22 +104,24 @@ public final class OfficeConnection {
throws InterruptedException, com.sun.star.uno.Exception
{
boolean desktopTerminated = true;
- if (context != null) {
- XMultiComponentFactory factory = context.getServiceManager();
- assertNotNull(factory);
- XDesktop desktop = UnoRuntime.queryInterface(
- XDesktop.class,
- factory.createInstanceWithContext(
- "com.sun.star.frame.Desktop", context));
- context = null;
- try {
- desktopTerminated = desktop.terminate();
- } catch (DisposedException e) {}
- // it appears that DisposedExceptions can already happen while
- // receiving the response of the terminate call
- desktop = null;
- } else if (process != null) {
- process.destroy();
+ if (process != null) {
+ if (context != null) {
+ XMultiComponentFactory factory = context.getServiceManager();
+ assertNotNull(factory);
+ XDesktop desktop = UnoRuntime.queryInterface(
+ XDesktop.class,
+ factory.createInstanceWithContext(
+ "com.sun.star.frame.Desktop", context));
+ context = null;
+ try {
+ desktopTerminated = desktop.terminate();
+ } catch (DisposedException e) {}
+ // it appears that DisposedExceptions can already happen
+ // while receiving the response of the terminate call
+ desktop = null;
+ } else {
+ process.destroy();
+ }
}
int code = 0;
if (process != null) {