Class AuthorityFactoryTest

Object
TestCase
ReferencingTestCase
AuthorityFactoryTest

public class AuthorityFactoryTest extends ReferencingTestCase
Tests the creation of referencing objects from the authority factories given at construction time.

Many ProjectedCRS instances tested in this class use the same projections than the MathTransform instances tested in ParameterizedTransformTest. However, the latter test class expects (λ,φ) input coordinates in degrees and (x,y) output coordinates in metres, while this AuthorityFactoryTest class expects input and output coordinates in CRS-dependent units and axis order.

Usage example:

in order to specify their factories and run the tests in a JUnit framework, implementers can define a subclass in their own test suite as in the example below:
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.opengis.test.referencing.AuthorityFactoryTest;

@RunWith(JUnit4.class)
public class MyTest extends AuthorityFactoryTest {
    public MyTest() {
        super(new MyCRSAuthorityFactory(), new MyCSAuthorityFactory(), new MyDatumAuthorityFactory());
    }
}
Since:
2.3
See Also:
  • Field Details

    • crsAuthorityFactory

      protected final CRSAuthorityFactory crsAuthorityFactory
      Factory to use for building CoordinateReferenceSystem instances, or null if none.
    • csAuthorityFactory

      protected final CSAuthorityFactory csAuthorityFactory
      Factory to use for building CoordinateSystem instances, or null if none.
    • datumAuthorityFactory

      protected final DatumAuthorityFactory datumAuthorityFactory
      Factory to use for building Datum instances, or null if none.
    • object

      protected IdentifiedObject object
      The identified object (typically a CoordinateReferenceSystem) being tested. Every test methods in this class will set this field to a non-null value. Implementers can use this value for their own assertions after any test has been run.
      Since:
      3.1
    • swapλφ

      protected boolean swapλφ
      true if the longitude and latitude axes shall be swapped. This flag applies only to geographic coordinates.

      Default value: true, since the majority of GeographicCRS defined in the EPSG database uses the (φλ) axis order.

      Since:
      3.1
    • swapxy

      protected boolean swapxy
      true if the easting and northing axes shall be swapped. This flag applies only to projected coordinates.

      Default value: false, since the majority of ProjectedCRS defined in the EPSG database uses the (x,y) axis order.

      Since:
      3.1
    • primeMeridian

      protected double primeMeridian
      The expected prime meridian of the CRS being tested, in decimal degrees from Greenwich.

      Default value: 0.0.

      Since:
      3.1
    • toAngularUnit

      protected double toAngularUnit
      Conversion factor from degrees to the CRS-specific angular units. This value is different than one when the latitude or longitude angles need to be converted from degrees before to run a test.

      Default value: 1.0.

      Since:
      3.1
    • toLinearUnit

      protected double toLinearUnit
      Conversion factor from metres to the CRS-specific linear units. This value is different than one when the easting or northing values need to be converted from metres before to run a test.

      Default value: 1.0.

      Since:
      3.1
    • isAxisSwappingSupported

      protected boolean isAxisSwappingSupported
      true if crsAuthorityFactory and csAuthorityFactory supports the creation of coordinate system with (y,x) axis order. If this field is set to false, then the tests that would normally expect (y,x) axis order or South Oriented CRS will rather use the (x,y) axis order and North Oriented CRS in their test.
      Since:
      3.1
  • Constructor Details

  • Method Details