src/test/java/org/jboss/loom/utils/compar/FileHashComparerTest.java
@Test
    public void testCompareHashesAndDir() throws Exception {
        System.out.println( "compareHashesAndDir" );
        
        File hashes = new File("testdata/utils/crc32hashes.txt");
        File dir = new File("./testdata/singleFiles/");
        
        Map<File, FileHashComparer.MatchResult> expResult = new HashMap();
        expResult.put(hashes, FileHashComparer.MatchResult.MATCH);
        
        //long crc32 = FileHashComparer.computeCrc32(new File("testdata/singleFiles/oracle-ds.xml"));
        
        ComparisonResult results = FileHashComparer.compareHashesAndDir( hashes, dir, FileFilterUtils.trueFileFilter());
        
        assertEquals( FileHashComparer.MatchResult.MATCH,    results.getMatches().get(PATH_ORACLE_DS) );
        assertEquals( FileHashComparer.MatchResult.MISMATCH, results.getMatches().get(PATH_DATASOURCES) );
        assertEquals( FileHashComparer.MatchResult.MISSING,  results.getMatches().get(PATH_NON_EXISTENT) );
    }
/**
     * Test of compareHashesAndDir method, of class FileHashComparer.
     */
Test of compareHashesAndDir method, of class FileHashComparer.
Test of compareHashesAndDir method of class FileHashComparer .
@Test
    public void testCompareHashesAndDir() throws Exception {
        System.out.println( "compareHashesAndDir" );
        File hashes = new File("testdata/utils/crc32hashes.txt");
        File dir = new File("./testdata/singleFiles/");
        Map<File, FileHashComparer.MatchResult> expResult = new HashMap();
        expResult.put(hashes, FileHashComparer.MatchResult.MATCH);
        ComparisonResult results = FileHashComparer.compareHashesAndDir( hashes, dir, FileFilterUtils.trueFileFilter());
        assertEquals( FileHashComparer.MatchResult.MATCH,    results.getMatches().get(PATH_ORACLE_DS) );
        assertEquals( FileHashComparer.MatchResult.MISMATCH, results.getMatches().get(PATH_DATASOURCES) );
        assertEquals( FileHashComparer.MatchResult.MISSING,  results.getMatches().get(PATH_NON_EXISTENT) );
    }
@ Test public void testCompareHashesAndDir ( ) throws Exception { System . out . println ( "compareHashesAndDir" ) ; File hashes = new File ( "testdata/utils/crc32hashes.txt" ) ; File dir = new File ( "./testdata/singleFiles/" ) ; Map < File , FileHashComparer . MatchResult > expResult = new HashMap ( ) ; expResult . put ( hashes , FileHashComparer . MatchResult . MATCH ) ; ComparisonResult results = FileHashComparer . compareHashesAndDir ( hashes , dir , FileFilterUtils . trueFileFilter ( ) ) ; assertEquals ( FileHashComparer . MatchResult . MATCH , results . getMatches ( ) . get ( PATH_ORACLE_DS ) ) ; assertEquals ( FileHashComparer . MatchResult . MISMATCH , results . getMatches ( ) . get ( PATH_DATASOURCES ) ) ; assertEquals ( FileHashComparer . MatchResult . MISSING , results . getMatches ( ) . get ( PATH_NON_EXISTENT ) ) ; }
Test of compareHashesAndDir method, of class FileHashComparer.
Test of compareHashesAndDir method of class FileHashComparer .
//long crc32 = FileHashComparer.computeCrc32(new File("testdata/singleFiles/oracle-ds.xml"));