Package org.iogp.gigs

Class Series2000<T>

Object
IntegrityTest
Series2000<T>
Type Parameters:
T - the type of objects to test.
Direct Known Subclasses:
Test2201, Test2202, Test2203, Test2204, Test2205, Test2206, Test2207, Test2208, Test2209, Test2210, Test2211

public abstract class Series2000<T> extends IntegrityTest
Base class for tests of EPSG definitions (2000 series). Those tests verify the correctness of geodetic parameters that are delivered with the software. The geodetic objects are created using one or many AuthorityFactory sub-types. The comparison to be taken as truth is the EPSG Dataset.
Since:
1.0
  • Field Details

    • code

      public int code
      The EPSG code of the T instance to test. This field is set by all test methods before to create and verify the T instance. This code can be compared to the identifiers returned by IdentifiedObject.getIdentifiers().
    • name

      public String name
      The name of the T instance to test, as used in the EPSG dataset. This field is set by all test methods before to create and verify the T instance. This name will be compared to the value returned by IdentifiedObject.getName(), unless isStandardNameSupported is false.
    • aliases

      public String[] aliases
      The expected aliases of the T instance to test, or an empty array if none. This field is set by all test methods before to create and verify the T instance. Those aliases will be compared to the values returned by IdentifiedObject.getAlias(), unless isStandardAliasSupported is false.
    • isStandardIdentifierSupported

      protected boolean isStandardIdentifierSupported
      true if the tested factories support identifiers. If true (the default), then the test methods will ensure that the identified objects created by the factories declare the authority code used for fetching the object. If false, then the identifiers are ignored.
    • isStandardNameSupported

      protected boolean isStandardNameSupported
      true if the tested factories support standard names. If true (the default), then the test methods will ensure that the identified objects created by the factories declare the same name than the GIGS tests. If false, then the names are ignored.
    • isStandardAliasSupported

      protected boolean isStandardAliasSupported
      true if the tested factories support aliases. If true (the default), then the test methods will ensure that the identified objects created by the factories declare at least all the aliases enumerated in the GIGS tests - additional aliases, if any, are ignored. If false, then the aliases are ignored.
    • isDependencyIdentificationSupported

      protected boolean isDependencyIdentificationSupported
      true if the IdentifiedObject instances created indirectly by the factories are expected to have correct identification information. For example, when testing a CoordinateReferenceSystem (CRS) object, the CRS authority code will be verified unconditionally but the authority codes of associated objects (GeodeticDatum or CoordinateSystem) will be verified only if this flag is true.
    • isDeprecatedObjectCreationSupported

      protected boolean isDeprecatedObjectCreationSupported
      true if the factory support creation of deprecated objects.
    • isOperationVersionSupported

      protected boolean isOperationVersionSupported
      true if the tested factories support operation version. If true (the default), then the test methods will ensure that the operations created by the factories declare the expected operation version. If false, then the operation version is ignored.

      This flag is significant only for tests on coordinate transformations.

  • Method Details

    • getIdentifiedObject

      public abstract T getIdentifiedObject() throws FactoryException
      Returns the instance to be tested. When this method is invoked for the first time, it creates the instance to test by invoking a createXXX(String) method on the user-specified AuthorityFactory with the current code value in argument. The created object is then cached and returned in subsequent invocations of this method.

      Usually, each test method creates exactly one object. But a few (relatively rare) tests may create more than one object. In such case, the instance returned by this method may vary.

      Returns:
      the instance to test.
      Throws:
      FactoryException - if an error occurred while creating the identified object.
    • getVerifiableName

      protected String getVerifiableName(IdentifiedObject object)
      Returns a name of the given object that can be compared against the expected name. The current implementation returns object.getName().getCode() converted to ASCII characters on a best effort basis (e.g. "é" is replaced by "e"), or null if the given object, its name or its code is null.

      Subclasses can override this method when testing an AuthorityFactory implementation which is known to use slightly different name than the one used in the EPSG database, or if the implementation stores the EPSG name as an alias instead of as the primary name.

      Example: if an implementation replaces all spaces by underscores, then a subclass testing that implementation could override this method as below:
          @Override
          protected String getVerifiableName(IdentifiedObject object) {
              return super.getVerifiableName().replace(' ', '_');
          }
      
      Note that if the object names are too different for being compared, then subclasses can also disable name comparisons by setting isStandardNameSupported to false.
      Parameters:
      object - the object from which to get a name than can be verified against the expected name.
      Returns:
      the name of the given object, eventually modified in order to match the expected name.
      See Also: