Author: lzoubek(a)redhat.com
Date: 2011-08-03 14:34:20 -0400 (Wed, 03 Aug 2011)
New Revision: 33549
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java
Log:
swtbot ext: fixed NPE when runtime is relative path
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java 2011-08-03
18:19:48 UTC (rev 33548)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/config/ServerBean.java 2011-08-03
18:34:20 UTC (rev 33549)
@@ -27,14 +27,15 @@
String runtimeFile = downloadRuntime(url);
if (runtimeFile!=null) {
// where to unzip it?
- String runtimeOutput;
+ File runtimeOutput;
+ File runtimeHomeAbs = new File(bean.runtimeHome).getAbsoluteFile();
if (TestConfigurator.Values.SERVER_TYPE_JBOSSAS.equals(bean.type)) {
- runtimeOutput=new File(bean.runtimeHome).getParent();
+ runtimeOutput=runtimeHomeAbs.getParentFile();
}
else {
- runtimeOutput=new File(bean.runtimeHome).getParentFile().getParent();
+ runtimeOutput=runtimeHomeAbs.getParentFile().getParentFile();
}
- FileHelper.unzipArchive(new File(runtimeFile), new File(runtimeOutput));
+ FileHelper.unzipArchive(new File(runtimeFile), runtimeOutput);
}
}
return bean;
Show replies by date