|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAssert
Assert
public class Assert
Assertion methods to be used by GeoAPI tests. This class inherits all assertion methods
from the JUnit Assert class. Consequently, developers can replace the
following statement:
byimport static org.junit.Assert.*
if they wish to use the assertion methods defined here in addition of JUnit methods.import static org.opengis.test.Assert.*
| Constructor Summary | |
|---|---|
protected |
Assert()
For subclass constructors only. |
| Method Summary | ||
|---|---|---|
static void |
assertAxisDirectionsEqual(String message,
CoordinateSystem cs,
AxisDirection... expected)
Asserts that all axes in the given coordinate system are pointing toward the given directions, in the same order. |
|
static
|
assertBetween(String message,
Comparable<T> minimum,
Comparable<T> maximum,
T value)
Asserts that the given value is between the given range. |
|
static void |
assertBetween(String message,
double minimum,
double maximum,
double value)
Asserts that the given value is between the given range. |
|
static void |
assertBetween(String message,
int minimum,
int maximum,
int value)
Asserts that the given value is between the given range. |
|
static void |
assertContains(String message,
Collection<?> collection,
Object value)
Asserts that the given value is contained in the given collection. |
|
static void |
assertIdentifierEquals(String message,
CharSequence expected,
CharSequence value)
Asserts that the identifiers in the given character sequences are equal, ignoring non-identifier characters. |
|
static void |
assertInstanceOf(String message,
Class<?> expectedType,
Object value)
Asserts that the given value is an instance of the given class. |
|
static void |
assertPathEquals(String message,
PathIterator expected,
PathIterator actual,
double toleranceX,
double toleranceY)
Asserts that all control points in two geometric paths are equal. |
|
static void |
assertPositive(String message,
int value)
Asserts that the given integer value is positive, including zero. |
|
static void |
assertSampleValuesEqual(String message,
RenderedImage expected,
RenderedImage actual,
double tolerance)
Asserts that all sample values in the given images are equal. |
|
static void |
assertShapeEquals(String message,
Shape expected,
Shape actual,
double toleranceX,
double toleranceY)
Asserts that all control points of two shapes are equal. |
|
static void |
assertStrictlyPositive(String message,
int value)
Asserts that the given integer value is strictly positive, excluding zero. |
|
static
|
assertValidRange(String message,
Comparable<T> minimum,
Comparable<T> maximum)
Asserts that the given minimum and maximum values make a valid range. |
|
static void |
assertValidRange(String message,
double minimum,
double maximum)
Asserts that the given minimum and maximum values make a valid range. |
|
static void |
assertValidRange(String message,
int minimum,
int maximum)
Asserts that the given minimum and maximum values make a valid range. |
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Assert()
| Method Detail |
|---|
public static void assertInstanceOf(String message,
Class<?> expectedType,
Object value)
null. If the type is not-null but the value is null, this is considered
as a failure.
message - Header of the exception message in case of failure, or null if none.expectedType - The expected parent class of the value, or null.value - The value to test, or null (which is a failure).
public static void assertPositive(String message,
int value)
message - Header of the exception message in case of failure, or null if none.value - The value to test.
public static void assertStrictlyPositive(String message,
int value)
message - Header of the exception message in case of failure, or null if none.value - The value to test.
public static <T> void assertValidRange(String message,
Comparable<T> minimum,
Comparable<T> maximum)
T - The type of values being compared.message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range to test, or null if unbounded.maximum - The upper bound of the range to test, or null if unbounded.
public static void assertValidRange(String message,
int minimum,
int maximum)
message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range to test.maximum - The upper bound of the range to test.
public static void assertValidRange(String message,
double minimum,
double maximum)
message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range to test.maximum - The upper bound of the range to test.
public static <T> void assertBetween(String message,
Comparable<T> minimum,
Comparable<T> maximum,
T value)
T - The type of values being compared.message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range (inclusive), or null if unbounded.maximum - The upper bound of the range (inclusive), or null if unbounded.value - The value to test, or null (which is a failure).
public static void assertBetween(String message,
int minimum,
int maximum,
int value)
message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range, inclusive.maximum - The upper bound of the range, inclusive.value - The value to test.
public static void assertBetween(String message,
double minimum,
double maximum,
double value)
message - Header of the exception message in case of failure, or null if none.minimum - The lower bound of the range, inclusive.maximum - The upper bound of the range, inclusive.value - The value to test.
public static void assertContains(String message,
Collection<?> collection,
Object value)
message - Header of the exception message in case of failure, or null if none.collection - The collection where to look for inclusion, or null.value - The value to test for inclusion.
public static void assertIdentifierEquals(String message,
CharSequence expected,
CharSequence value)
message - Header of the exception message in case of failure, or null if none.expected - The expected character sequence.value - The character sequence to compare.
public static void assertAxisDirectionsEqual(String message,
CoordinateSystem cs,
AxisDirection... expected)
message - Header of the exception message in case of failure, or null if none.cs - The coordinate system to test.expected - The expected axis directions.
public static void assertShapeEquals(String message,
Shape expected,
Shape actual,
double toleranceX,
double toleranceY)
PathIterator.currentSegment(double[]).SEG_* constants) is the same.
message - Header of the exception message in case of failure, or null if none.expected - The expected shape.actual - The actual shape.toleranceX - The tolerance threshold for x ordinate values.toleranceY - The tolerance threshold for y ordinate values.
public static void assertPathEquals(String message,
PathIterator expected,
PathIterator actual,
double toleranceX,
double toleranceY)
PathIterator.currentSegment(double[]).SEG_* constants) is the same.assertShapeEquals(String, Shape, Shape, double, double)
when the tester needs to compare the shapes with a non-null affine transform or a flatness factor.
in such case, the tester needs to invoke the Shape.getPathIterator(AffineTransform, double)
method himself.
message - Header of the exception message in case of failure, or null if none.expected - The expected path.actual - The actual path.toleranceX - The tolerance threshold for x ordinate values.toleranceY - The tolerance threshold for y ordinate values.
public static void assertSampleValuesEqual(String message,
RenderedImage expected,
RenderedImage actual,
double tolerance)
message - Header of the exception message in case of failure, or null if none.expected - An image containing the expected values.actual - The actual image containing the sample values to compare.tolerance - Tolerance threshold for floating point comparisons.
This threshold is ignored if both images use integer datatype.PixelIterator.assertSampleValuesEqual(PixelIterator, double)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||