Upgraded Hibernate from 5.2.4.Final to 5.2.18.Final
[hibernate4-maven-plugin] / src / test / java / de / juplo / test / FileComparator.java
index beb2564..9229fc8 100644 (file)
@@ -5,6 +5,7 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
+import java.util.regex.Pattern;
 
 
 public class FileComparator
@@ -36,6 +37,15 @@ public class FileComparator
     while ((expected = expectedReader.readLine()) != null)
     {
       found = foundReader.readLine();
+      if (found == null)
+      {
+        System.err.println("Found less content than expected!");
+        System.err.println("First missing line: " + expected);
+        return false;
+      }
+
+      expected = expected.trim();
+      found = found.trim();
       if (!expected.equals(found))
       {
         System.err.println("Mismatch!");