Kaydet (Commit) e0c4b36a authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS qadev8 (1.2.2); FILE MERGED

2003/06/10 15:12:42 sg 1.2.2.1: #109887#CHG: enhanced reading parameters
üst fa181597
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: CfgParser.java,v $ * $RCSfile: CfgParser.java,v $
* *
* $Revision: 1.2 $ * $Revision: 1.3 $
* *
* last change:$Date: 2003-05-27 12:02:07 $ * last change:$Date: 2003-06-11 16:24:38 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -72,7 +72,7 @@ import java.io.FileInputStream; ...@@ -72,7 +72,7 @@ import java.io.FileInputStream;
* inside TestParameters * inside TestParameters
*/ */
public class CfgParser { public class CfgParser {
protected boolean debug = false;
protected String iniFile=""; protected String iniFile="";
public CfgParser(String ini) { public CfgParser(String ini) {
...@@ -81,6 +81,7 @@ public class CfgParser { ...@@ -81,6 +81,7 @@ public class CfgParser {
} }
public void getIniParameters(TestParameters param) { public void getIniParameters(TestParameters param) {
debug = param.DebugIsActive;
Properties cfg = null; Properties cfg = null;
if (iniFile.equals("")) { if (iniFile.equals("")) {
//no iniFile given, search one in the users home directory //no iniFile given, search one in the users home directory
...@@ -110,10 +111,14 @@ public class CfgParser { ...@@ -110,10 +111,14 @@ public class CfgParser {
protected Properties getProperties(String name) { protected Properties getProperties(String name) {
Properties prop = new Properties(); Properties prop = new Properties();
if ( debug ) {
System.out.println("Looking for "+name);
}
FileInputStream propFile = null; FileInputStream propFile = null;
try { try {
propFile = new FileInputStream(name); propFile = new FileInputStream(name);
prop.load(propFile); prop.load(propFile);
System.out.println("Parsing properties from "+name);
propFile.close(); propFile.close();
} catch (Exception e) { } catch (Exception e) {
//Exception while reading prop-file, returning null //Exception while reading prop-file, returning null
...@@ -136,7 +141,6 @@ public class CfgParser { ...@@ -136,7 +141,6 @@ public class CfgParser {
return path+fileSeparator+".runner.props"; return path+fileSeparator+".runner.props";
} else { } else {
//suppose I'm on Windows //suppose I'm on Windows
System.out.println("Parsing "+path+fileSeparator+"runner.props");
return path+fileSeparator+"runner.props"; return path+fileSeparator+"runner.props";
} }
} }
......
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