@Test public void testValidate_AcceptOnEnd() throws Exception { policy.inspectAll = true; ChecksumValidator validator = newValidator( SHA1, MD5 ); fetcher.mock( SHA1, "foo" ); fetcher.mock( MD5, "bar" ); validator.validate( checksums( SHA1, "foo", MD5, "bar" ), null ); fetcher.assertFetchedFiles( SHA1, MD5 ); policy.assertCallbacks( "match(SHA-1, 0000)", "match(MD5, 0000)", "noMore()" ); }
public void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); }
ChecksumValidator { public void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); } }
ChecksumValidator { public void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); } ChecksumValidator( Logger logger, File dataFile, FileProcessor fileProcessor,
                              ChecksumFetcher checksumFetcher, ChecksumPolicy checksumPolicy,
                              Collection<Checksum> checksums ); }
ChecksumValidator { public void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); } ChecksumValidator( Logger logger, File dataFile, FileProcessor fileProcessor,
                              ChecksumFetcher checksumFetcher, ChecksumPolicy checksumPolicy,
                              Collection<Checksum> checksums ); ChecksumCalculator newChecksumCalculator( File targetFile ); void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ); void retry(); boolean handle( ChecksumFailureException exception ); void commit(); void close(); }
ChecksumValidator { public void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ) throws ChecksumFailureException { if ( checksumPolicy == null ) { return; } if ( inlinedChecksums != null && validateInlinedChecksums( actualChecksums, inlinedChecksums ) ) { return; } if ( validateExternalChecksums( actualChecksums ) ) { return; } checksumPolicy.onNoMoreChecksums(); } ChecksumValidator( Logger logger, File dataFile, FileProcessor fileProcessor,
                              ChecksumFetcher checksumFetcher, ChecksumPolicy checksumPolicy,
                              Collection<Checksum> checksums ); ChecksumCalculator newChecksumCalculator( File targetFile ); void validate( Map<String, ?> actualChecksums, Map<String, ?> inlinedChecksums ); void retry(); boolean handle( ChecksumFailureException exception ); void commit(); void close();  }