How use JUnit for PDF Compares

Tags: #<Tag:0x00007f70b64815d8> #<Tag:0x00007f70b6481510>

In the first step should define the files.In this example are the files in the same directory how the test class

File example1 = new File( getClass().getResource( "Example1.pdf" ).getFile() );
File example2 = new File( getClass().getResource( "Example2.pdf" ).getFile() );

after them initial the comparer and compare two pdf files

ResultModel result = pdfComparer.compare( example1, example2 );

and now use the standard JUnit methods

Assert.assertEquals( <expected difference>, result.getDifferencesCount( false ) );

View full sourcecode

© Copyright 1996 - 2018, i-net software; All Rights Reserved.