Class EtsAssert
java.lang.Object
org.opengis.cite.ogcapifeatures10.EtsAssert
Provides a set of custom assertion methods.
- Author:
- Lyn Goltz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertCrsHeader
(String crsHeaderValue, CoordinateSystem expectedCrs, String failureMsg) assertCrsHeader.static void
assertDefaultCrs
(String crsHeaderValue, String failureMsg) Assert that the passed string is one of the the default CRSstatic CoordinateSystem
assertDefaultCrs
(List<String> valueToAssert, String failureMsg) Assert that one of the default CRSstatic void
assertDefaultCrsAtFirst
(List<String> valueToAssert, String failureMsg) Assert that the first is one of the default CRSstatic void
assertDefaultCrsHeader
(String crsHeaderValue, String failureMsg) Assert that one of the default CRSstatic void
assertFalse
(boolean valueToAssert, String failureMsg) assertFalse.static void
assertInCrs84
(org.locationtech.jts.geom.Geometry geometry, String failureMsg) Assert that the passed geometry is in the valid area of CRS84.static void
assertTrue
(boolean valueToAssert, String failureMsg) assertTrue.static void
assertValidCrsIdentifier
(CoordinateSystem coordinateSystem, String failureMsg) 1.
-
Constructor Details
-
EtsAssert
public EtsAssert()
-
-
Method Details
-
assertTrue
assertTrue.
- Parameters:
valueToAssert
- the boolean to assert to betrue
failureMsg
- the message to throw in case of a failure, should not benull
-
assertFalse
assertFalse.
- Parameters:
valueToAssert
- the boolean to assert to befalse
failureMsg
- the message to throw in case of a failure, should not benull
-
assertValidCrsIdentifier
1. For http-URIs (starting with http:) validate that the string conforms to the syntax specified by RFC 7230, section 2.7.1. 2. For https-URIs (starting with https:) validate that the string conforms to the syntax specified by RFC 7230, section 2.7.2. 3. For URNs (starting with urn:) validate that the string conforms to the syntax specified by RFC 8141, section 2. 4. For OGC URNs (starting with urn:ogc:def:crs:) and OGC http-URIs (starting with http://www.opengis.net/def/crs/) validate that the string conforms to the syntax specified by OGC Name Type Specification - definitions - part 1 – basic name.
- Parameters:
coordinateSystem
- the coordinate system to assert as valid identifier (see above). Ifnull
an AssertionError is thrown.failureMsg
- the message to throw in case of a failure, should not benull
-
assertDefaultCrs
Assert that one of the default CRS* http://www.opengis.net/def/crs/OGC/1.3/CRS84 (for coordinates without height) * http://www.opengis.net/def/crs/OGC/0/CRS84h (for coordinates with height)
is in the list of passed crs.- Parameters:
valueToAssert
- list of CRS which should contain the default crs, nevernull
failureMsg
- the message to throw in case of a failure, should not benull
- Returns:
- the default CRS
-
assertDefaultCrsAtFirst
Assert that the first is one of the default CRS* http://www.opengis.net/def/crs/OGC/1.3/CRS84 (for coordinates without height) * http://www.opengis.net/def/crs/OGC/0/CRS84h (for coordinates with height)
- Parameters:
valueToAssert
- list of CRS which should contain the default crs, nevernull
failureMsg
- the message to throw in case of a failure, should not benull
-
assertDefaultCrs
Assert that the passed string is one of the the default CRS* http://www.opengis.net/def/crs/OGC/1.3/CRS84 (for coordinates without height) * http://www.opengis.net/def/crs/OGC/0/CRS84h (for coordinates with height)
- Parameters:
crsHeaderValue
- CRS which should be the default crs, nevernull
failureMsg
- the message to throw in case of a failure, should not benull
-
assertCrsHeader
public static void assertCrsHeader(String crsHeaderValue, CoordinateSystem expectedCrs, String failureMsg) assertCrsHeader.
- Parameters:
crsHeaderValue
- the value from the header, nevernull
expectedCrs
- th expected value, nevernull
failureMsg
- the message to throw in case of a failure, should not benull
-
assertDefaultCrsHeader
Assert that one of the default CRS* http://www.opengis.net/def/crs/OGC/1.3/CRS84 (for coordinates without height) * http://www.opengis.net/def/crs/OGC/0/CRS84h (for coordinates with height)
- Parameters:
crsHeaderValue
- the value from the header, nevernull
failureMsg
- the message to throw in case of a failure, should not benull
-
assertInCrs84
Assert that the passed geometry is in the valid area of CRS84.- Parameters:
geometry
- to check, may benull
failureMsg
- the message to throw in case of a failure, should not benull
-