Class ObjectFactoryTest

Direct Known Subclasses:
ReferencingTest

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

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.ObjectFactoryTest;

@RunWith(JUnit4.class)
public class MyTest extends ObjectFactoryTest {
    public MyTest() {
        super(new MyDatumFactory(), new MyCSFactory(), new MyCRSFactory(), new MyOpFactory());
    }
}
Since:
2.3
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • factories

      public static List<Factory[]> factories()
      Returns a default set of factories to use for running the tests. Those factories are given in arguments to the constructor when this test class is instantiated directly by JUnit (for example as a suite element), instead of subclassed by the implementer. The factories are fetched as documented in the TestCase.factories(Class[]) javadoc.
      Returns:
      the default set of arguments to be given to the ObjectFactoryTest constructor.
      Since:
      3.1
    • testWGS84

      public void testWGS84() throws FactoryException
      Tests the creation of the EPSG:4326 GeographicCRS. This method wraps the object factories in an PseudoEpsgFactory instance, then delegates to the AuthorityFactoryTest.testWGS84() method.
      Throws:
      FactoryException - if a factory fails to create a referencing object.
    • testWGS84_3D

      public void testWGS84_3D() throws FactoryException
      Tests the creation of the WGS84 CRS with ellipsoidal height, and verifies that the axes are in the given (latitude, longitude, height) order.
      Throws:
      FactoryException - if a factory fails to create a referencing object.
    • testGeocentric

      public void testGeocentric() throws FactoryException
      Tests the creation of a geocentric CRS.
      Throws:
      FactoryException - if a factory fails to create a referencing object.
    • testProjected3D

      @Deprecated public void testProjected3D() throws FactoryException
      Deprecated.
      Renamed testProjectedWithGeoidalHeight() for making clearer that this is not a projected CRS associated to a 3D coordinate system.
      Tests the creation of a projected CRS with vertical height.
      Throws:
      FactoryException - if a factory fails to create a referencing object.
    • testProjectedWithGeoidalHeight

      public void testProjectedWithGeoidalHeight() throws FactoryException
      Tests the creation of a compound CRS made of a projected CRS with a gravity-related height.
      Throws:
      FactoryException - if a factory fails to create a referencing object.