Author: lzoubek(a)redhat.com
Date: 2010-07-07 08:55:44 -0400 (Wed, 07 Jul 2010)
New Revision: 23273
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
Log:
SWTBot ext: fixed NPE when loading test config
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-07-07
12:53:56 UTC (rev 23272)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfiguration.java 2010-07-07
12:55:44 UTC (rev 23273)
@@ -32,7 +32,7 @@
public TestConfiguration(String propName, String propFile) throws Exception {
this.propName = propName;
this.propFile = propFile;
- if (propFile != null) {
+ if (!"".equals(propFile)) {
if (new File(propFile).exists()) {
log.info("Loading configuration file '" + propFile +
"'");
swtTestProperties.load(new FileInputStream(propFile));
Modified:
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java
===================================================================
---
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-07-07
12:53:56 UTC (rev 23272)
+++
trunk/jst/tests/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/TestConfigurator.java 2010-07-07
12:55:44 UTC (rev 23273)
@@ -58,8 +58,22 @@
throw new IOException(SWTBOT_TEST_PROPERTIES_MULTI_FILE + " "
+ propMultiFile + " does not exist!");
}
- } else {
- multiProperties.put(SWTBOT_TEST_PROPERTIES_FILE, propFile);
+ }
+ else if (propFile!=null) {
+ if (new File(propFile).exists()) {
+ log
+ .info("Loading exeternaly configuration file '"
+ + propFile + "'");
+ multiProperties.put(SWTBOT_TEST_PROPERTIES_FILE, propFile);
+ }
+ else {
+ throw new IOException(SWTBOT_TEST_PROPERTIES_FILE + " "
+ + propFile + " does not exist!");
+ }
+ }
+ else {
+ log.info("No configuration property passed, using default");
+ multiProperties.put(SWTBOT_TEST_PROPERTIES_FILE, "");
}
Show replies by date