-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
30 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
core/src/test/java/org/mapfish/print/test/util/ImageSimilarityTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.mapfish.print.test.util; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import javax.imageio.ImageIO; | ||
import org.junit.Test; | ||
import org.mapfish.print.AbstractMapfishSpringTest; | ||
|
||
public class ImageSimilarityTest extends AbstractMapfishSpringTest { | ||
|
||
/** Ensure that we ar not regenerating the expected images in the CI. */ | ||
@Test | ||
public void testNotRegenerateImage() throws Exception { | ||
assertFalse( | ||
"This flag should not be committed as true", ImageSimilarity.REGENERATE_EXPECTED_IMAGES); | ||
} | ||
|
||
/** Test that we get a distance in images with small differences. */ | ||
@Test | ||
public void testSmallDist() throws Exception { | ||
assertTrue( | ||
new ImageSimilarity(getFile("imageSimilarity/with.png")) | ||
.calcDistance(ImageIO.read(getFile("imageSimilarity/without.png"))) | ||
> 0); | ||
} | ||
} |
Binary file added
BIN
+212 KB
core/src/test/resources/org/mapfish/print/test/util/imageSimilarity/with.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+27.9 KB
core/src/test/resources/org/mapfish/print/test/util/imageSimilarity/without.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.