X-Git-Url: https://juplo.de/gitweb/?p=website;a=blobdiff_plain;f=dist%2Fhibernate-maven-plugin-2.1.0%2Fxref-test%2Fde%2Fjuplo%2Ftest%2FFileComparator.html;fp=dist%2Fhibernate-maven-plugin-2.1.0%2Fxref-test%2Fde%2Fjuplo%2Ftest%2FFileComparator.html;h=64291cd7e819a4a45d7c8105639fac44ae0f2ac3;hp=0000000000000000000000000000000000000000;hb=a53595184bd6e57bdc45292cc92c393c4e2dfe6e;hpb=c48c9ee0e9faa89a4c0a5323b367b9f5a6abe602 diff --git a/dist/hibernate-maven-plugin-2.1.0/xref-test/de/juplo/test/FileComparator.html b/dist/hibernate-maven-plugin-2.1.0/xref-test/de/juplo/test/FileComparator.html new file mode 100644 index 00000000..64291cd7 --- /dev/null +++ b/dist/hibernate-maven-plugin-2.1.0/xref-test/de/juplo/test/FileComparator.html @@ -0,0 +1,70 @@ + + + +FileComparator xref + + + +
View Javadoc
+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  }
+
+
+ + +