You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ge...@apache.org on 2008/07/15 08:24:24 UTC

svn commit: r676806 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java

Author: gertv
Date: Mon Jul 14 23:24:23 2008
New Revision: 676806

URL: http://svn.apache.org/viewvc?rev=676806&view=rev
Log:
Fix for IOConverterTest -- it fails in the source distribution

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java?rev=676806&r1=676805&r2=676806&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java Mon Jul 14 23:24:23 2008
@@ -18,6 +18,7 @@
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
@@ -32,14 +33,9 @@
     private static final byte[] TESTDATA = "My test data".getBytes();
 
     public void testToBytes() throws FileNotFoundException, IOException {
-        int fileSize = 962;
-        byte[] data = IOConverter.toBytes(new FileInputStream("src/test/resources/org/apache/camel/converter/dummy.txt"));
-        // since we set the dummy.txt svn property svn:eol-style to be native,
-        // the file size could be different when you run the test in Windows box
-        if (System.getProperty("os.name").startsWith("Windows")) {
-            fileSize = 979;
-        }
-        assertEquals("get the wrong byte size", fileSize, data.length);
+        File file = new File("src/test/resources/org/apache/camel/converter/dummy.txt");
+        byte[] data = IOConverter.toBytes(new FileInputStream(file));
+        assertEquals("get the wrong byte size", file.length(), data.length);
         assertEquals('#', (char) data[0]);
         assertEquals('!', (char) data[data.length - 1]);
     }