poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ye...@apache.org
Subject svn commit: r746746 - /poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java
Date Sun, 22 Feb 2009 16:08:07 GMT
Author: yegor
Date: Sun Feb 22 16:08:06 2009
New Revision: 746746

URL: http://svn.apache.org/viewvc?rev=746746&view=rev
Log:
fixed platform-dependent unit test

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java?rev=746746&r1=746745&r2=746746&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestFileHelper.java Sun Feb
22 16:08:06 2009
@@ -33,13 +33,23 @@
 
 	public void testGetDirectory() {
 		TreeMap<String, String> expectedValue = new TreeMap<String, String>();
-		expectedValue.put("c:\\test\\test.doc", "c:\\test");
-		expectedValue.put("d:\\test\\test2\\test.doc.xml", "d:\\test\\test2");
+		expectedValue.put("/dir1/test.doc", "/dir1");
+		expectedValue.put("/dir1/dir2/test.doc.xml", "/dir1/dir2");
 
 		for (String filename : expectedValue.keySet()) {
-			assertTrue(expectedValue.get(filename).equalsIgnoreCase(
-					FileHelper.getDirectory(new File(filename))
-							.getAbsolutePath()));
+            File f1 = new File(expectedValue.get(filename));
+            File f2 = FileHelper.getDirectory(new File(filename));
+
+            /*
+             * YK: The original version asserted expected values against File#getAbsolutePath():
+             * assertTrue(expectedValue.get(filename).equalsIgnoreCase(
+             *        FileHelper.getDirectory(new File(filename))
+             *                .getAbsolutePath()));
+             *
+             * This comparison is platform dependent and resulted in build errors in Gump
since 21/02/2009.
+             * Assertion via File#equals(File otherFile) is a better approach. 
+             */
+            assertTrue(f1.equals(f2));
 		}
 	}
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message