I'm trying to compare a String to a file-content, and want to assert wheather they are equal or not.
Like:
13CB0000000000X15.xml (input)
13CB0000000000X15.xml (expected (content of file))
My Assert:
assertTrue("Tatsaechliches Ergebnis weicht von '"
+ expectedResultFileName + "' ab!", result.equals(expected));
This assertion somehow fails, because it says its not equal?!
My file is UTF-8 w/o BOM. There is no LF/ CRLF or else. I even tried to trim it with:
String expected = readFile(testDataBasePath +
File.separator + expectedResultFileName, encoding);
expected = expected.trim();
String result = document.getDocumentElement().getChildNodes().item(0).getNodeValue();
result = result.trim();
What am I missing?