X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=dist%2Fhibernate4-maven-plugin-1.1.1%2Fxref-test%2Fde%2Fjuplo%2Ftest%2FFileComparator.html;fp=dist%2Fhibernate4-maven-plugin-1.1.1%2Fxref-test%2Fde%2Fjuplo%2Ftest%2FFileComparator.html;h=15fac22640eafeb393b66507f56892075b63908e;hb=a53595184bd6e57bdc45292cc92c393c4e2dfe6e;hp=0000000000000000000000000000000000000000;hpb=c48c9ee0e9faa89a4c0a5323b367b9f5a6abe602;p=website diff --git a/dist/hibernate4-maven-plugin-1.1.1/xref-test/de/juplo/test/FileComparator.html b/dist/hibernate4-maven-plugin-1.1.1/xref-test/de/juplo/test/FileComparator.html new file mode 100644 index 00000000..15fac226 --- /dev/null +++ b/dist/hibernate4-maven-plugin-1.1.1/xref-test/de/juplo/test/FileComparator.html @@ -0,0 +1,70 @@ + + +
++1 package de.juplo.test; +2 +3 import java.io.BufferedReader; +4 import java.io.File; +5 import java.io.FileNotFoundException; +6 import java.io.FileReader; +7 import java.io.IOException; +8 +9 +10 public class FileComparator +11 { +12 private final File basedir; +13 private BufferedReader expectedReader; +14 private BufferedReader foundReader; +15 +16 public FileComparator(File basedir) +17 { +18 this.basedir = basedir; +19 } +20 +21 public boolean isEqual(final String expectedFile, final String foundFile) +22 throws +23 FileNotFoundException, +24 IOException +25 { +26 File file; +27 String expected, found; +28 +29 file = new File(basedir, expectedFile); +30 expectedReader = new BufferedReader(new FileReader(file)); +31 +32 file = new File(basedir, foundFile); +33 foundReader = new BufferedReader(new FileReader(file)); +34 +35 +36 while ((expected = expectedReader.readLine()) != null) +37 { +38 found = foundReader.readLine(); +39 if (!expected.equals(found)) +40 { +41 System.err.println("Mismatch!"); +42 System.err.println("Expected: " + expected); +43 System.err.println("Found: " + found); +44 return false; +45 } +46 } +47 +48 if ((found = foundReader.readLine()) != null) +49 { +50 System.err.println("Found more content than expected!"); +51 System.err.println("Starting with: " + found); +52 return false; +53 } +54 +55 return true; +56 } +57 } ++