summaryrefslogtreecommitdiff
path: root/qadevOOo
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-15 21:12:13 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-01-16 09:14:07 +0000
commitf8ec51cc28ce8e3902ac53c6a1720a5a0ac82261 (patch)
tree857f350f39d4bd02b6f59d04997c87f56b85409b /qadevOOo
parent29b13a24cf5f0e6e58641d4a55cdfa03c83b68ac (diff)
boil down the use of OPERATING_SYSTEM to its unorc/uno.ini use
Change-Id: I9f0f98c989cb7ecf6227154e1d81d49abade66c2
Diffstat (limited to 'qadevOOo')
-rw-r--r--qadevOOo/runner/helper/CfgParser.java23
-rw-r--r--qadevOOo/runner/helper/UnoProvider.java10
-rw-r--r--qadevOOo/runner/lib/TestParameters.java27
-rw-r--r--qadevOOo/runner/util/PropertyName.java26
4 files changed, 8 insertions, 78 deletions
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<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 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<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 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 <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";
-
}