\r
public void testGetDirectory() {\r
TreeMap<String, String> expectedValue = new TreeMap<String, String>();\r
- expectedValue.put("c:\\test\\test.doc", "c:\\test");\r
- expectedValue.put("d:\\test\\test2\\test.doc.xml", "d:\\test\\test2");\r
+ expectedValue.put("/dir1/test.doc", "/dir1");\r
+ expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2");\r
\r
for (String filename : expectedValue.keySet()) {\r
- assertTrue(expectedValue.get(filename).equalsIgnoreCase(\r
- FileHelper.getDirectory(new File(filename))\r
- .getAbsolutePath()));\r
+ File f1 = new File(expectedValue.get(filename));\r
+ File f2 = FileHelper.getDirectory(new File(filename));\r
+\r
+ /*\r
+ * YK: The original version asserted expected values against File#getAbsolutePath():\r
+ * assertTrue(expectedValue.get(filename).equalsIgnoreCase(\r
+ * FileHelper.getDirectory(new File(filename))\r
+ * .getAbsolutePath()));\r
+ *\r
+ * This comparison is platform dependent and resulted in build errors in Gump since 21/02/2009.\r
+ * Assertion via File#equals(File otherFile) is a better approach. \r
+ */\r
+ assertTrue(f1.equals(f2));\r
}\r
}\r
}\r