[Libreoffice-commits] .: test/source

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Tue Mar 29 12:11:28 PDT 2011


 test/source/java/org/openoffice/test/OfficeConnection.java |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit b4583275a16df263462447ea5be6b90d561d7746
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date:   Tue Mar 29 19:51:34 2011 +0200

    enable headless Junit tests

diff --git a/test/source/java/org/openoffice/test/OfficeConnection.java b/test/source/java/org/openoffice/test/OfficeConnection.java
index d097668..a7231fc 100644
--- a/test/source/java/org/openoffice/test/OfficeConnection.java
+++ b/test/source/java/org/openoffice/test/OfficeConnection.java
@@ -53,13 +53,21 @@ public final class OfficeConnection {
     public void setUp() throws Exception {
         String sofficeArg = Argument.get("soffice");
         if (sofficeArg.startsWith("path:")) {
+            String headless_flags = "";
+            try {
+                if(Argument.get("headless").length() > 0) {
+                    // meh, we warn about -headless being replaced by --headless, but that does not actually work
+                    headless_flags = "-headless";
+                }
+            } catch(Exception e) {}
             description = "pipe,name=oootest" + UUID.randomUUID();
             ProcessBuilder pb = new ProcessBuilder(
                 sofficeArg.substring("path:".length()), "--quickstart=no",
                 "--nofirststartwizard", "--norestore",
                 "--accept=" + description + ";urp",
                 "-env:UserInstallation=" + Argument.get("user"),
-                "-env:UNO_JAVA_JFW_ENV_JREHOME=true");
+                "-env:UNO_JAVA_JFW_ENV_JREHOME=true",
+                headless_flags);
             String envArg = Argument.get("env");
             if (envArg != null) {
                 Map<String, String> env = pb.environment();


More information about the Libreoffice-commits mailing list