Interface ImplementationDetails


  • public interface ImplementationDetails
    Provides optional information about the implementation being tested. Implementors can provide an instance of this interface in their test packages and declare their instance in the META-INF/services/org.opengis.test.ImplementationDetails file. GeoAPI will iterate over every ImplementationDetails found on the classpath when needed:
    • Before each execution of a configurable TestCase, in order to check which tests (if any) should be disabled.
    • Before each execution of a TestCase performing numerical calculation, in order to determine if a specific implementation needs to relax the tolerance threshold.
    If no instance of ImplementationDetails is registered, then GeoAPI assumes that all tests are enabled with their default tolerance threshold. This is equivalent to using an ImplementationDetails instance where every methods return null.
    Since:
    3.1
    • Method Summary

      Modifier and Type Method Description
      Configuration configuration​(Factory... factories)
      Returns the set of tests that should be disabled, or null if none.
      ToleranceModifier tolerance​(MathTransform transform)
      Returns an object for modifying the tolerance thresholds when testing the given math transform, or null if no change is needed.
    • Method Detail

      • configuration

        Configuration configuration​(Factory... factories)
        Returns the set of tests that should be disabled, or null if none. If non-null, then the returned map can contain some Configuration.Key associated to the Boolean.FALSE value. Example:
        @Override
        public Configuration configuration(Factory... factories) {
            Configuration config = new Configuration();
            config.unsupported(Configuration.Key.isDerivativeSupported, Configuration.Key.isNonSquareMatrixSupported);
            return config;
        }
        If more than one ImplementationDetails is found on the classpath, then a logical AND is performed on the boolean values returned by all ImplementationDetails.configuration(…) calls.

        This method is invoked often (typically one or two time before every single test method), so implementors may want to cache their configuration map.

        Parameters:
        factories - the factories to be tested.
        Returns:
        the collection of tests to disable for the given factories, or null if none.
        See Also:
        TestCase.configuration()
      • tolerance

        ToleranceModifier tolerance​(MathTransform transform)
        Returns an object for modifying the tolerance thresholds when testing the given math transform, or null if no change is needed. This method should return a non-null value only if the implementation being tested does not have the accuracy expected by the TestCase. In such case, the object returned by this method can be used for relaxing the tolerance threshold.

        If more than one ImplementationDetails return a non-null value, then the threshold used by GeoAPI will be the maximal value returned by all ToleranceModifier objects.

        Parameters:
        transform - the transform being tested.
        Returns:
        an object for modifying the tolerance thresholds, or null if no change is needed.