public class ImageAssert extends GenericAssert<ImageAssert,BufferedImage>
BufferedImage
s.
To create a new instance of this class invoke
.
Assertions.assertThat(BufferedImage)
actual, myself
Modifier | Constructor and Description |
---|---|
protected |
ImageAssert(BufferedImage actual)
Creates a new
ImageAssert . |
Modifier and Type | Method and Description |
---|---|
ImageAssert |
hasSize(Dimension expected)
Verifies that the size of the actual image is equal to the given one.
|
ImageAssert |
isEqualTo(BufferedImage expected)
Verifies that the actual image is equal to the given one.
|
ImageAssert |
isEqualTo(BufferedImage expected,
Threshold threshold)
Verifies that the actual image is equal to the given one.
|
ImageAssert |
isNotEqualTo(BufferedImage image)
Verifies that the actual image is not equal to the given one.
|
static BufferedImage |
read(String imageFilePath)
Reads the image in the specified path.
|
as, as, describedAs, describedAs, doesNotSatisfy, is, isIn, isIn, isNot, isNotIn, isNotIn, isNotNull, isNotSameAs, isNull, isSameAs, overridingErrorMessage, satisfies
customErrorMessage, description, description, description, equals, fail, fail, failIfCustomMessageIsSet, failIfCustomMessageIsSet, failure, formattedErrorMessage, hashCode, rawDescription, replaceDefaultErrorMessagesWith
protected ImageAssert(BufferedImage actual)
ImageAssert
.actual
- the target to verify.public static BufferedImage read(String imageFilePath) throws IOException
imageFilePath
- the path of the image to read.NullPointerException
- if the given path is null
.IllegalArgumentException
- if the given path does not belong to a file.IOException
- if any I/O error occurred while reading the image.public ImageAssert isEqualTo(BufferedImage expected)
isEqualTo
in class GenericAssert<ImageAssert,BufferedImage>
expected
- the given image to compare the actual image to.AssertionError
- if the actual image is not equal to the given one.public ImageAssert isEqualTo(BufferedImage expected, Threshold threshold)
expected
- the given image to compare the actual image to.threshold
- the threshold to use to decide if the color of two pixels are similar: two pixels that are
identical to the human eye may still have slightly different color values. For example, by using a threshold of 1
we can indicate that a blue value of 60 is similar to a blue value of 61.AssertionError
- if the actual image is not equal to the given one.public ImageAssert isNotEqualTo(BufferedImage image)
isNotEqualTo
in class GenericAssert<ImageAssert,BufferedImage>
image
- the given image to compare the actual image to.AssertionError
- if the actual image is equal to the given one.public ImageAssert hasSize(Dimension expected)
expected
- the expected size of the actual image.AssertionError
- if the actual image is null
.NullPointerException
- if the given size is null
.AssertionError
- if the size of the actual image is not equal to the given one.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.