String text2 = "To be or not to be - Shakespeare";
File file2 = new File(getTestDirectory(), "checksum-test2.txt");
FileUtils.writeStringToFile(file2, text2, "US-ASCII");
// compute the expected checksum
Checksum expectedChecksum = new CRC32();
expectedChecksum.update(text1.getBytes("US-ASCII"), 0, text1.length());
expectedChecksum.update(text2.getBytes("US-ASCII"), 0, text2.length());
long expectedValue = expectedChecksum.getValue();
// compute the checksum of the file
Checksum testChecksum = new CRC32();
FileUtils.checksum(file1, testChecksum);
FileUtils.checksum(file2, testChecksum);
long resultValue = testChecksum.getValue();
assertEquals(expectedValue, resultValue);
}