|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fest.assertions.api.AbstractAssert<ImageAssert,BufferedImage>
org.fest.assertions.api.ImageAssert
public class ImageAssert
Assertion methods for images.
To create an instance of this class, invoke
.
Assertions.assertThat(BufferedImage)
Field Summary |
---|
Fields inherited from class org.fest.assertions.api.AbstractAssert |
---|
actual, myself |
Constructor Summary | |
---|---|
protected |
ImageAssert(BufferedImage actual)
|
Method Summary | |
---|---|
ImageAssert |
hasSize(Dimension expected)
Verifies that the actual image has the given size. |
ImageAssert |
isEqualTo(BufferedImage expected)
Verifies that the actual image is equal to the given one. |
ImageAssert |
isEqualTo(BufferedImage expected,
Offset<Integer> offset)
Verifies that the actual image is equal to the given one. |
ImageAssert |
isNotEqualTo(BufferedImage other)
Verifies that the actual value is not equal to the given one. |
ImageAssert |
usingComparator(Comparator<? super BufferedImage> customComparator)
Use given custom comparator instead of relying on actual type A equals method for incoming assertion checks. |
ImageAssert |
usingDefaultComparator()
Revert to standard comparison for incoming assertion checks. |
Methods inherited from class org.fest.assertions.api.AbstractAssert |
---|
as, as, describedAs, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, equals, has, hashCode, hasSameClassAs, is, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ImageAssert(BufferedImage actual)
Method Detail |
---|
public ImageAssert isEqualTo(BufferedImage expected)
isEqualTo
in interface Assert<ImageAssert,BufferedImage>
isEqualTo
in class AbstractAssert<ImageAssert,BufferedImage>
expected
- the given image to compare the actual image to.
this
assertion object.
AssertionError
- if the actual image is not equal to the given one.public ImageAssert isEqualTo(BufferedImage expected, Offset<Integer> offset)
expected
- the given image to compare the actual image to.offset
- helps 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 an offset of 1 we can indicate that
a blue value of 60 is similar to a blue value of 61.
this
assertion object.
NullPointerException
- if the given offset is null
.
AssertionError
- if the actual image is not equal to the given one.public ImageAssert isNotEqualTo(BufferedImage other)
isNotEqualTo
in interface Assert<ImageAssert,BufferedImage>
isNotEqualTo
in class AbstractAssert<ImageAssert,BufferedImage>
other
- the given value to compare the actual value to.
this
assertion object.public ImageAssert hasSize(Dimension expected)
expected
- the expected size of the actual image.
this
assertion object.
NullPointerException
- if the given size is null
.
AssertionError
- if the size of the actual image is not equal to the given size.public ImageAssert usingComparator(Comparator<? super BufferedImage> customComparator)
AbstractAssert
Custom comparator is bound to assertion instance, meaning that if a new assertion is created, it will use default comparison strategy.
Examples :
// frodo and sam are instances of Character with Hobbit race (obviously :). // raceComparator implements Comparator<Character> assertThat(frodo).usingComparator(raceComparator).isEqualTo(sam);
usingComparator
in interface Assert<ImageAssert,BufferedImage>
usingComparator
in class AbstractAssert<ImageAssert,BufferedImage>
customComparator
- the comparator to use for incoming assertion checks.
this
assertion object.public ImageAssert usingDefaultComparator()
AbstractAssert
This method should be used to disable a custom comparison strategy set by calling
Assert.usingComparator(Comparator)
.
usingDefaultComparator
in interface Assert<ImageAssert,BufferedImage>
usingDefaultComparator
in class AbstractAssert<ImageAssert,BufferedImage>
this
assertion object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |