org.opengis.cite.ogcapifeatures10

## Class EtsAssert

- java.lang.Object
- - org.opengis.cite.ogcapifeatures10.EtsAssert

-     public class EtsAssert
      extends Object

  Provides a set of custom assertion methods.
  Author:
    Lyn Goltz

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EtsAssert()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `assertCrsHeader(String crsHeaderValue, CoordinateSystem expectedCrs, String failureMsg)`
    `static CoordinateSystem` | `assertDefaultCrs(List<String> valueToAssert, String failureMsg)` Assert that one of the default CRS
    `static void` | `assertDefaultCrs(String crsHeaderValue, String failureMsg)` Assert that the passed string is one of the the default CRS
    `static void` | `assertDefaultCrsAtFirst(List<String> valueToAssert, String failureMsg)` Assert that the first is one of the default CRS
    `static void` | `assertDefaultCrsHeader(String crsHeaderValue, String failureMsg)` Assert that one of the default CRS
    `static void` | `assertFalse(boolean valueToAssert, String failureMsg)`
    `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)`
    `static void` | `assertValidCrsIdentifier(CoordinateSystem coordinateSystem, String failureMsg)` 1.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### EtsAssert

          public EtsAssert()

  - ### Method Detail

    - #### assertTrue

          public static void assertTrue(boolean valueToAssert,
                                        String failureMsg)

      Parameters:
        `valueToAssert` - the boolean to assert to be `true`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertFalse

          public static void assertFalse(boolean valueToAssert,
                                         String failureMsg)

      Parameters:
        `valueToAssert` - the boolean to assert to be `false`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertValidCrsIdentifier

          public static void assertValidCrsIdentifier(CoordinateSystem coordinateSystem,
                                                      String failureMsg)

            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). If `null` an AssertionError is thrown.
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertDefaultCrs

          public static CoordinateSystem assertDefaultCrs(List<String> valueToAssert,
                                                          String failureMsg)

      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, never `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`
      Returns:
        the default CRS

    - #### assertDefaultCrsAtFirst

          public static void assertDefaultCrsAtFirst(List<String> valueToAssert,
                                                     String failureMsg)

      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, never `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertDefaultCrs

          public static void assertDefaultCrs(String crsHeaderValue,
                                              String failureMsg)

      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, never `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertCrsHeader

          public static void assertCrsHeader(String crsHeaderValue,
                                             CoordinateSystem expectedCrs,
                                             String failureMsg)

      Parameters:
        `crsHeaderValue` - the value from the header, never `null`
        `expectedCrs` - th expected value, never `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertDefaultCrsHeader

          public static void assertDefaultCrsHeader(String crsHeaderValue,
                                                    String failureMsg)

      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, never `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

    - #### assertInCrs84

          public static void assertInCrs84(org.locationtech.jts.geom.Geometry geometry,
                                           String failureMsg)

      Assert that the passed geometry is in the valid area of CRS84.
      Parameters:
        `geometry` - to check, may be `null`
        `failureMsg` - the message to throw in case of a failure, should not be `null`

Copyright © 2022 Open Geospatial Consortium. All rights reserved.