DTF SVN: r22 - trunk/src/org/jboss/dtf/testframework/local.
by dtf-commits@lists.jboss.org
Author: jhalliday
Date: 2009-05-12 12:54:21 -0400 (Tue, 12 May 2009)
New Revision: 22
Modified:
trunk/src/org/jboss/dtf/testframework/local/LocalTestManager.java
Log:
Fix file path handling on Windows. DTF-4 and JBTM-550
Modified: trunk/src/org/jboss/dtf/testframework/local/LocalTestManager.java
===================================================================
--- trunk/src/org/jboss/dtf/testframework/local/LocalTestManager.java 2008-11-26 15:08:30 UTC (rev 21)
+++ trunk/src/org/jboss/dtf/testframework/local/LocalTestManager.java 2009-05-12 16:54:21 UTC (rev 22)
@@ -89,10 +89,21 @@
}
public static LocalTestManager getInstance(String testdefsFile, String productConfigFile, String testnodeConfigFile) throws Exception {
- TestDefinitionRepository testDefinitionRepository = new TestDefinitionRepository(new URL("file://"+(new File(testdefsFile).getAbsolutePath())));
- TaskDefinitionRepository taskDefinitionRepository = new TaskDefinitionRepository(new URL("file://"+(new File(testdefsFile).getAbsolutePath())));
- return new LocalTestManager(testDefinitionRepository, taskDefinitionRepository, productConfigFile, "file://"+(new File(testnodeConfigFile).getAbsolutePath()));
+ String prefix = "file://";
+ if(File.separatorChar == '\\') {
+ // we are on a windows box. this is a pain.
+ prefix = "file:/"; // if we use "//" it treats the drive letter as a host.
+ // it's really up to the user to fix the seps in the path, but we'll do it just in case...
+ testdefsFile = testdefsFile.replace('/', File.separatorChar);
+ productConfigFile = productConfigFile.replace('/', File.separatorChar);
+ testnodeConfigFile = testnodeConfigFile.replace('/', File.separatorChar);
+ }
+
+ TestDefinitionRepository testDefinitionRepository = new TestDefinitionRepository(new URL(prefix+(new File(testdefsFile).getAbsolutePath())));
+ TaskDefinitionRepository taskDefinitionRepository = new TaskDefinitionRepository(new URL(prefix+(new File(testdefsFile).getAbsolutePath())));
+
+ return new LocalTestManager(testDefinitionRepository, taskDefinitionRepository, productConfigFile, prefix+(new File(testnodeConfigFile).getAbsolutePath()));
}
public LocalTestManager(TestDefinitionRepository testDefinitionRepository, TaskDefinitionRepository taskDefinitionRepository,
15 years, 7 months