From f8ec51cc28ce8e3902ac53c6a1720a5a0ac82261 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 15 Jan 2017 21:12:13 +0000 Subject: boil down the use of OPERATING_SYSTEM to its unorc/uno.ini use Change-Id: I9f0f98c989cb7ecf6227154e1d81d49abade66c2 --- qadevOOo/runner/helper/CfgParser.java | 23 ----------------------- qadevOOo/runner/helper/UnoProvider.java | 10 +--------- qadevOOo/runner/lib/TestParameters.java | 27 +++++---------------------- qadevOOo/runner/util/PropertyName.java | 26 ++------------------------ 4 files changed, 8 insertions(+), 78 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/runner/helper/CfgParser.java b/qadevOOo/runner/helper/CfgParser.java index 7c7e17a208c0..59f0d2745fc3 100644 --- a/qadevOOo/runner/helper/CfgParser.java +++ b/qadevOOo/runner/helper/CfgParser.java @@ -81,29 +81,6 @@ public class CfgParser } debug = param.getBool(PropertyName.DEBUG_IS_ACTIVE); - - //check for platform dependent parameters - //this would have a $OperatingSystem as prefix - String os = (String) param.get(PropertyName.OPERATING_SYSTEM); - if (os != null && os.length() > 1) - { - - Map aux = new HashMap(); - for (Iterator> it = param.entrySet().iterator(); it.hasNext();) - { - Map.Entry entry = it.next(); - String key = entry.getKey(); - if (key.startsWith(os)) - { - Object oldValue = entry.getValue(); - String newKey = key.substring(os.length() + 1); - it.remove(); - aux.put(newKey, oldValue); - } - } - param.putAll(aux); - - } } private Properties getProperties(String name) diff --git a/qadevOOo/runner/helper/UnoProvider.java b/qadevOOo/runner/helper/UnoProvider.java index d5d18c38fb72..017c2227ccf9 100644 --- a/qadevOOo/runner/helper/UnoProvider.java +++ b/qadevOOo/runner/helper/UnoProvider.java @@ -109,15 +109,7 @@ public class UnoProvider implements AppProvider { if (unorcName == null) { String office = (String)param.get("AppExecutionCommand"); // determine unorc name: unorc or uno.ini on windows - String opSystem = (String)param.get(PropertyName.OPERATING_SYSTEM); - if ( opSystem != null && opSystem.equalsIgnoreCase(PropertyName.WNTMSCI)) { - unorcName = "uno.ini"; - } - else { - unorcName = "unorc"; - } - if (office == null) - return null; + unorcName = (String)param.get(PropertyName.UNORC_NAME); // use '/', because this will be a URL in any case. unorcName = office.substring(0, office.indexOf("program")+7) + "/" + unorcName; diff --git a/qadevOOo/runner/lib/TestParameters.java b/qadevOOo/runner/lib/TestParameters.java index d5fdf5fb404f..b5d033b6ad48 100644 --- a/qadevOOo/runner/lib/TestParameters.java +++ b/qadevOOo/runner/lib/TestParameters.java @@ -159,7 +159,7 @@ public class TestParameters extends HashMap { put(PropertyName.AUTO_RESTART, Boolean.FALSE); // get the operating system - put(PropertyName.OPERATING_SYSTEM, getSOCompatibleOSName()); + put(PropertyName.UNORC_NAME, getUnoRcName()); //For compatibility Reasons System.setProperty("DOCPTH", DefaultTestDocumentPath); @@ -193,31 +193,14 @@ public class TestParameters extends HashMap { } /** - * Convert the system dependent operating system name to a name according - * to OOo rules. - * @return A valid OS name, or "" if the name is not known. + * @return The uno rc file name uno.ini for windows and unorc for everything else */ - private String getSOCompatibleOSName() { + private String getUnoRcName() { String osname = System.getProperty ("os.name").toLowerCase (); - String osarch = System.getProperty ("os.arch"); - String operatingSystem = ""; if (osname.indexOf ("windows")>-1) { - operatingSystem = PropertyName.WNTMSCI; - } else if (osname.indexOf ("linux")>-1 || osname.indexOf ("kfreebsd")>-1) { - operatingSystem = PropertyName.UNXLNGI; - } else if (osname.indexOf ("sunos")>-1) { - if (osarch.equals ("x86")) { - operatingSystem = PropertyName.UNXSOLI; - } else { - operatingSystem = PropertyName.UNXSOLS; - } - } else if (osname.indexOf ("mac")>-1) { - operatingSystem = PropertyName.UNXMACXI; - } else { - System.out.println("ERROR: not supported platform: " + osname); - System.exit(1); + return "uno.ini"; } - return operatingSystem; + return "unorc"; } }// finish class TestParamenters diff --git a/qadevOOo/runner/util/PropertyName.java b/qadevOOo/runner/util/PropertyName.java index b15fc88e1db2..5a28278fa66b 100644 --- a/qadevOOo/runner/util/PropertyName.java +++ b/qadevOOo/runner/util/PropertyName.java @@ -93,9 +93,9 @@ public interface PropertyName { */ String THREAD_TIME_OUT = "ThreadTimeOut"; /** - * parameter name: "OperatingSystem" + * parameter name: "UnoRcName" */ - String OPERATING_SYSTEM = "OperatingSystem"; + String UNORC_NAME = "UnoRcName"; /** * parameter name: "AutoRestart" * If this parameter is true the OfficeProvider tries @@ -114,26 +114,4 @@ public interface PropertyName { * path to the source root of OpenOffice.org */ String SRC_ROOT = "SRC_ROOT"; - - /** - * internal only, no parameter - */ - String WNTMSCI = "wntmsci"; - /** - * internal only, no parameter - */ - String UNXLNGI = "unxlngi"; - /** - * internal only, no parameter - */ - String UNXSOLS = "unxsols"; - /** - * internal only, no parameter - */ - String UNXSOLI = "unxsoli"; - /** - * internal only, no parameter - */ - String UNXMACXI = "unxmacxi"; - } -- cgit v1.2.3