@Test public void testCompareFile() throws Exception { String resources = getClass().getResource("/compare").toURI().getPath(); LOG.info("Resources folder: " + resources); // Text content and Binary both same String srcFile = resources + "/source.csv"; String refFile = resources + "/bin_same_ref.csv"; Assert.assertTrue(FileRuntimeHelper.compareInTextMode(srcFile, refFile, "UTF-8")); Assert.assertTrue(FileRuntimeHelper.compareInBinaryMode(srcFile, refFile)); // Text content are same and Binary is different srcFile = resources + "/prenoms_fr2.csv.short.dos"; refFile = resources + "/prenoms_fr2.csv.short.linux"; Assert.assertTrue(FileRuntimeHelper.compareInTextMode(srcFile, refFile, "UTF-8")); Assert.assertFalse(FileRuntimeHelper.compareInBinaryMode(srcFile, refFile)); // Text are different srcFile = resources + "/source.csv"; refFile = resources + "/text_diff_ref.csv"; Assert.assertFalse(FileRuntimeHelper.compareInTextMode(srcFile, refFile, "UTF-8")); Assert.assertFalse(FileRuntimeHelper.compareInBinaryMode(srcFile, refFile)); }