Kaydet (Commit) f8ec51cc authored tarafından Caolán McNamara's avatar Caolán McNamara

boil down the use of OPERATING_SYSTEM to its unorc/uno.ini use

Change-Id: I9f0f98c989cb7ecf6227154e1d81d49abade66c2
üst 29b13a24
......@@ -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)
......
......@@ -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;
......
......@@ -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
......@@ -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";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment