Package org.opengis.test.referencing
Class ReferencingTestCase
- Direct Known Subclasses:
AuthorityFactoryTest
,CRSTest
,ObjectFactoryTest
,WKTParserTest
Base class of
CoordinateReferenceSystem
implementation tests.
This base class provides verify(…)
methods that subclasses can override if they need to alter
the object verifications.- Since:
- 3.1
-
Field Summary
Fields inherited from class org.opengis.test.TestCase
configurationTip, units, validators
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates a test case initialized to default values. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
verifyCoordinateSystem
(CoordinateSystem cs, Class<? extends CoordinateSystem> type, AxisDirection[] directions, javax.measure.Unit<?>... axisUnits) Compares the type, axis units and directions of the given coordinate system against the expected values.protected void
verifyFlattenedSphere
(Ellipsoid ellipsoid, String name, double semiMajor, double inverseFlattening, javax.measure.Unit<javax.measure.quantity.Length> axisUnit) Compares the name, axis lengths and inverse flattening factor of the given ellipsoid against the expected values.protected void
verifyGeographicExtent
(Extent extent, String description, double southBoundLatitude, double westBoundLongitude, double northBoundLatitude, double eastBoundLongitude) Compares the geographic description and bounding box of the given extent against the expected values.protected void
verifyIdentification
(IdentifiedObject object, String name, String identifier) Compares the name and identifier of the givenobject
against the expected values.protected void
verifyParameter
(ParameterValueGroup group, String name, double value, javax.measure.Unit<?> unit) Compares an operation parameter against the expected value.protected void
verifyPrimeMeridian
(PrimeMeridian primeMeridian, String name, double greenwichLongitude, javax.measure.Unit<javax.measure.quantity.Angle> angularUnit) Compares the name and Greenwich longitude of the given prime meridian against the expected values.protected void
verifyTimeExtent
(Extent extent, Instant startTime, Instant endTime, double tolerance) Compares the temporal elements of the given extent against the expected values.protected void
verifyVerticalExtent
(Extent extent, double minimumValue, double maximumValue, double tolerance, javax.measure.Unit<?> unit) Compares the vertical elements of the given extent against the expected values.Methods inherited from class org.opengis.test.TestCase
configuration, getEnabledFlags
-
Constructor Details
-
ReferencingTestCase
protected ReferencingTestCase()Creates a test case initialized to default values.
-
-
Method Details
-
verifyIdentification
Compares the name and identifier of the givenobject
against the expected values. This method allows for some flexibilities:- For
IdentifiedObject.getName()
:- Only the value returned by
Identifier.getCode()
is verified. The code space, authority and version are ignored. - Only the characters that are valid for Unicode identifiers are compared (ignoring case), as documented in
Assertions.assertUnicodeIdentifierEquals(…)
.
- Only the value returned by
- For
IdentifiedObject.getIdentifiers()
:- Only the value returned by
Identifier.getCode()
is verified. The code space, authority and version are ignored. - The identifiers collection can contain more identifiers than the expected one, and the expected identifier does not need to be first.
- The comparison is case-insensitive.
- Only the value returned by
object
isnull
, then this method does nothing. Deciding ifnull
objects are allowed or not isValidator
's job.- Parameters:
object
- the object to verify, ornull
if none.name
- the expected name (ignoring code space), ornull
if unrestricted.identifier
- the expected identifier code (ignoring code space), ornull
if unrestricted.
- For
-
verifyFlattenedSphere
protected void verifyFlattenedSphere(Ellipsoid ellipsoid, String name, double semiMajor, double inverseFlattening, javax.measure.Unit<javax.measure.quantity.Length> axisUnit) Compares the name, axis lengths and inverse flattening factor of the given ellipsoid against the expected values. This method allows for some flexibilities:IdentifiedObject.getName()
allows for the same flexibilities as the one documented inverifyIdentification(…)
.Ellipsoid.getSemiMajorAxis()
does not need to use the unit of measurement given by theaxisUnit
argument. Unit conversion will be applied as needed.
- 3 decimal digits for
semiMajor
values in metres. - 9 decimal digits for
inverseFlattening
values.
ellipsoid
isnull
, then this method does nothing. Deciding ifnull
datum are allowed or not isValidator
's job.- Parameters:
ellipsoid
- the ellipsoid to verify, ornull
if none.name
- the expected name (ignoring code space), ornull
if unrestricted.semiMajor
- the expected semi-major axis length, in units given by theaxisUnit
argument.inverseFlattening
- the expected inverse flattening factor.axisUnit
- the unit of thesemiMajor
argument (not necessarily the actual unit of the ellipsoid).- See Also:
-
verifyPrimeMeridian
protected void verifyPrimeMeridian(PrimeMeridian primeMeridian, String name, double greenwichLongitude, javax.measure.Unit<javax.measure.quantity.Angle> angularUnit) Compares the name and Greenwich longitude of the given prime meridian against the expected values. This method allows for some flexibilities:IdentifiedObject.getName()
allows for the same flexibilities as the one documented inverifyIdentification(…)
.PrimeMeridian.getGreenwichLongitude()
does not need to use the unit of measurement given by theangularUnit
argument. Unit conversion will be applied as needed.
- 7 decimal digits for
greenwichLongitude
values in degrees.
primeMeridian
isnull
, then this method does nothing. Deciding ifnull
prime meridians are allowed or not isValidator
's job.- Parameters:
primeMeridian
- the prime meridian to verify, ornull
if none.name
- the expected name (ignoring code space), ornull
if unrestricted.greenwichLongitude
- the expected Greenwich longitude, in units given by theangularUnit
argument.angularUnit
- the unit of thegreenwichLongitude
argument (not necessarily the actual unit of the prime meridian).- See Also:
-
verifyCoordinateSystem
protected void verifyCoordinateSystem(CoordinateSystem cs, Class<? extends CoordinateSystem> type, AxisDirection[] directions, javax.measure.Unit<?>... axisUnits) Compares the type, axis units and directions of the given coordinate system against the expected values. This method does not verify the coordinate system name because it is usually not significant. This method does not verify axis names neither because the names specified by ISO 19111 and ISO 19162 differ.If the given
cs
isnull
, then this method does nothing. Deciding ifnull
coordinate systems are allowed or not isValidator
's job.- Parameters:
cs
- the coordinate system to verify, ornull
if none.type
- the expected coordinate system type.directions
- the expected axis directions. The length of this array determines the expectedcs
dimension.axisUnits
- the expected axis units. If the array length is less than thecs
dimension, then the last unit is repeated for all remaining dimensions. If the array length is greater, than extra units are ignored.- See Also:
-
verifyParameter
protected void verifyParameter(ParameterValueGroup group, String name, double value, javax.measure.Unit<?> unit) Compares an operation parameter against the expected value. This method allows for some flexibilities:- The parameter does not need to use the unit of measurement given by the
unit
argument. Unit conversion should be applied as needed by theParameterValue.doubleValue(Unit)
method.
group
isnull
, then this method does nothing. Deciding ifnull
parameters are allowed or not isValidator
's job.- Parameters:
group
- the parameter group containing the parameter to test.name
- the name of the parameter to test.value
- the expected parameter value when expressed in units given by theunit
argument.unit
- the units of measurement of thevalue
argument (not necessarily the unit actually used by the implementation).
- The parameter does not need to use the unit of measurement given by the
-
verifyGeographicExtent
protected void verifyGeographicExtent(Extent extent, String description, double southBoundLatitude, double westBoundLongitude, double northBoundLatitude, double eastBoundLongitude) Compares the geographic description and bounding box of the given extent against the expected values. This method allows for some flexibilities:- For
GeographicDescription
elements:- Descriptions are considered optional. If the given
extent
does not contain anyGeographicDescription
element, then the givendescription
argument is ignored. - If the given
extent
contains more than oneGeographicDescription
element, then only one of them (not necessarily the first one) needs to have the givendescription
value. Other elements are ignored.
- Descriptions are considered optional. If the given
- For
GeographicBoundingBox
elements:- Bounding boxes are considered optional. If the given
extent
does not contain anyGeographicBoundingBox
element, then all given bound arguments are ignored. - If the given
extent
contains more than oneGeographicBoundingBox
element, then the union of them is compared against the given bound arguments.
- Bounding boxes are considered optional. If the given
If the given
extent
isnull
, then this method does nothing. Deciding ifnull
extents are allowed or not isValidator
's job.- Parameters:
extent
- the extent to verify, ornull
if none.description
- the expected area, ornull
if unrestricted.southBoundLatitude
- the expected minimum latitude, or NaN if unrestricted.westBoundLongitude
- the expected minimum longitude, or NaN if unrestricted.northBoundLatitude
- the expected maximum latitude, or NaN if unrestricted.eastBoundLongitude
- the expected maximum longitude, or NaN if unrestricted.- See Also:
- For
-
verifyVerticalExtent
protected void verifyVerticalExtent(Extent extent, double minimumValue, double maximumValue, double tolerance, javax.measure.Unit<?> unit) Compares the vertical elements of the given extent against the expected values. This method allows for some flexibilities:- Vertical extents are considered optional. If the given
extent
does not contain anyVerticalExtent
element, then this method does nothing. VerticalExtent.getMinimumValue()
andgetMaximumValue()
do not need to use the unit of measurement given by theunit
argument. Unit conversions will be applied as needed ifVerticalExtent.getVerticalCRS()
returns a non-null value.- If the given
extent
contains more than oneVerticalExtent
element, then the union of them is compared against the given bound arguments.
If the given
extent
isnull
, then this method does nothing. Deciding ifnull
extents are allowed or not isValidator
's job.- Parameters:
extent
- the extent to verify, ornull
if none.minimumValue
- the expected minimal vertical value, or NaN if unrestricted.maximumValue
- the expected maximal vertical value, or NaN if unrestricted.tolerance
- the tolerance threshold to use for comparison.unit
- the unit ofminimumValue
,maximumValue
andtolerance
arguments, ornull
for skipping the unit conversion.- See Also:
- Vertical extents are considered optional. If the given
-
verifyTimeExtent
protected void verifyTimeExtent(Extent extent, Instant startTime, Instant endTime, double tolerance) Compares the temporal elements of the given extent against the expected values. This method allows for some flexibilities:- Temporal extents are considered optional. If the given
extent
does not contain anyTemporalExtent
element, or if extent bounds can not be represented asInstant
objects, then this method does nothing. - If the given
extent
contains more than oneTemporalExtent
element, then the union of them is compared against the given bound arguments.
extent
isnull
, then this method does nothing. Deciding ifnull
extents are allowed or not isValidator
's job.- Parameters:
extent
- the extent to verify, ornull
if none.startTime
- the expected start time, ornull
if unrestricted.endTime
- the expected end time, ornull
if unrestricted.tolerance
- the tolerance threshold to use for comparison, in unit of days.- See Also:
- Temporal extents are considered optional. If the given
-