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 voidassertCrsHeader(String crsHeaderValue, CoordinateSystem expectedCrs, String failureMsg) assertCrsHeader.static voidassertDefaultCrs(String crsHeaderValue, String failureMsg) Assert that the passed string is one of the the default CRSstatic CoordinateSystemassertDefaultCrs(List<String> valueToAssert, String failureMsg) Assert that one of the default CRSstatic voidassertDefaultCrsAtFirst(List<String> valueToAssert, String failureMsg) Assert that the first is one of the default CRSstatic voidassertDefaultCrsHeader(String crsHeaderValue, String failureMsg) Assert that one of the default CRSstatic voidassertFalse(boolean valueToAssert, String failureMsg) assertFalse.static voidassertInCrs84(org.locationtech.jts.geom.Geometry geometry, String failureMsg) Assert that the passed geometry is in the valid area of CRS84.static voidassertTrue(boolean valueToAssert, String failureMsg) assertTrue.static voidassertValidCrsIdentifier(CoordinateSystem coordinateSystem, String failureMsg) 1.
-
Constructor Details
-
EtsAssert
public EtsAssert()
-
-
Method Details
-
assertTrue
assertTrue.
- Parameters:
valueToAssert- the boolean to assert to betruefailureMsg- the message to throw in case of a failure, should not benull
-
assertFalse
assertFalse.
- Parameters:
valueToAssert- the boolean to assert to befalsefailureMsg- 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). Ifnullan 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, nevernullfailureMsg- 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, nevernullfailureMsg- 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, nevernullfailureMsg- 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, nevernullexpectedCrs- th expected value, nevernullfailureMsg- 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, nevernullfailureMsg- 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 benullfailureMsg- the message to throw in case of a failure, should not benull
-