From 9b8fb077d26883d3749785803f5a9138d7ba0d29 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 22 Dec 2014 15:08:30 +0200 Subject: java: inline some test properties Change-Id: I8be2ee13652ed7223e41765811db577ecc1c85d6 --- qadevOOo/runner/helper/CfgParser.java | 45 ++--------------------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'qadevOOo') diff --git a/qadevOOo/runner/helper/CfgParser.java b/qadevOOo/runner/helper/CfgParser.java index d6cf0e60a762..7c7e17a208c0 100644 --- a/qadevOOo/runner/helper/CfgParser.java +++ b/qadevOOo/runner/helper/CfgParser.java @@ -41,30 +41,13 @@ public class CfgParser public CfgParser(String ini) { - if (ini != null) - { - this.iniFile = ini; - } + this.iniFile = ini; } public void getIniParameters(TestParameters param) { debug = param.getBool(PropertyName.DEBUG_IS_ACTIVE); - Properties cfg = null; - if (iniFile.length() == 0) - { - //no iniFile given, search one in the users home directory - cfg = getProperties(getDefaultFileName(true)); - //try to search the user dir if no iniFile could be found yet - if (cfg == null) - { - cfg = getProperties(getDefaultFileName(false)); - } - } - else - { - cfg = getProperties(iniFile); - } + Properties cfg = getProperties(iniFile); if (cfg != null) { @@ -161,28 +144,4 @@ public class CfgParser return prop; } - private String getDefaultFileName(boolean home) - { - String fileSeparator = System.getProperty("file.separator"); - String path = ""; - if (home) - { - //look inside the home directory - path = System.getProperty("user.home"); - } - else - { - path = System.getProperty("user.dir"); - } - if (fileSeparator.equals("/")) - { - //suppose I'm on Unix-platform - return path + fileSeparator + ".runner.props"; - } - else - { - //suppose I'm on Windows - return path + fileSeparator + "runner.props"; - } - } } -- cgit