modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
| 17 ++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
New commits:
commit 9a4c406425741f4dc3ecc546c27aec5d558fa37b
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Apr 30 14:25:36 2013 -0400
BZ 917085 fix test to hopefully run on windows
diff --git
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
index f0605a2..76742e8 100644
---
a/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
+++
b/modules/plugins/ant-bundle/src/test/java/org/rhq/plugins/ant/AntBundlePluginComponentTest.java
@@ -530,8 +530,21 @@ public class AntBundlePluginComponentTest {
assert winDirs.size() == 1 : "should only have 1 ext backup dir on
windows: " + winDirs;
backupDir = winDirs.values().iterator().next().getAbsoluteFile();
}
- File file3Backup = new File(backupDir, file3Dest.getAbsolutePath());
- File file4Backup = new File(backupDir, file4Dest.getAbsolutePath());
+
+ File file3Backup;
+ File file4Backup;
+ boolean isWindows = (File.separatorChar == '\\');
+ if (isWindows) {
+ StringBuilder file3AbsPath = new StringBuilder(file3Dest.getAbsolutePath());
+ StringBuilder file4AbsPath = new StringBuilder(file4Dest.getAbsolutePath());
+ FileUtil.stripDriveLetter(file3AbsPath);
+ FileUtil.stripDriveLetter(file4AbsPath);
+ file3Backup = new File(backupDir, file3AbsPath.toString());
+ file4Backup = new File(backupDir, file4AbsPath.toString());
+ } else {
+ file3Backup = new File(backupDir, file3Dest.getAbsolutePath());
+ file4Backup = new File(backupDir, file4Dest.getAbsolutePath());
+ }
assert file3Backup.isFile() : "should have been backed up: " +
file3Backup;
assert file4Backup.isFile() : "should have been backed up: " +
file4Backup;
assert (TEST3 + "modified").equals(readFile(file3Backup)) : "bad
backup file: " + file3Backup;
Show replies by date