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(-)
New commits: commit f8ec51cc28ce8e3902ac53c6a1720a5a0ac82261 Author: Caolán McNamara <caol...@redhat.com> Date: Sun Jan 15 21:12:13 2017 +0000 boil down the use of OPERATING_SYSTEM to its unorc/uno.ini use Change-Id: I9f0f98c989cb7ecf6227154e1d81d49abade66c2 diff --git a/qadevOOo/runner/helper/CfgParser.java b/qadevOOo/runner/helper/CfgParser.java index 7c7e17a..59f0d27 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<String, Object> aux = new HashMap<String, Object>(); - for (Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator(); it.hasNext();) - { - Map.Entry<String, Object> 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 d5d18c3..017c222 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 d5fdf5f..b5d033b 100644 --- a/qadevOOo/runner/lib/TestParameters.java +++ b/qadevOOo/runner/lib/TestParameters.java @@ -159,7 +159,7 @@ public class TestParameters extends HashMap<String,Object> { 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<String,Object> { } /** - * 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 b15fc88..5a28278 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 <CODE>true</CODE> the <CODE>OfficeProvider</CODE> 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"; - }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits