org.opengis.test.referencing
Class ObjectFactoryTest

Show UML class diagram
Object
  extended by TestCase
      extended by ObjectFactoryTest
Direct Known Subclasses:
ReferencingTest

public class ObjectFactoryTest
extends TestCase

Tests the creation of referencing objects from the object factories given at construction time.

In order to specify their factories and run the tests in a JUnit framework, implementors can define a subclass as 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());
    }
}
Alternatively this test class can also be used directly in the TestSuite, which combine every tests defined in the GeoAPI conformance module.

Since:
2.3
See Also:
AuthorityFactoryTest, TestSuite

Field Summary
protected  CoordinateOperationFactory copFactory
          Factory to use for building Conversion instances, or null if none.
protected  CRSFactory crsFactory
          Factory to use for building CoordinateReferenceSystem instances, or null if none.
protected  CSFactory csFactory
          Factory to use for building CoordinateSystem instances, or null if none.
protected  DatumFactory datumFactory
          Factory to use for building Datum instances, or null if none.
 
Fields inherited from class TestCase
configurationTip, listener, NO_FACTORY, validators
 
Constructor Summary
ObjectFactoryTest(DatumFactory datumFactory, CSFactory csFactory, CRSFactory crsFactory, CoordinateOperationFactory copFactory)
          Creates a new test using the given factories.
 
Method Summary
static List<Factory[]> factories()
          Returns a default set of factories to use for running the tests.
 void testGeocentric()
          Tests the creation of a geocentric CRS.
 void testProjected3D()
          Tests the creation of a projected CRS with vertical height.
 void testWGS84_3D()
          Tests the creation of the WGS84 CRS, and verifies that the axes are in the given (longitude, latitude) order.
 void testWGS84()
          Tests the creation of the EPSG:4326 GeographicCRS.
 
Methods inherited from class TestCase
addTestListener, configuration, factories, factories, getEnabledFlags, removeTestListener
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datumFactory

protected final DatumFactory datumFactory
Factory to use for building Datum instances, or null if none.


csFactory

protected final CSFactory csFactory
Factory to use for building CoordinateSystem instances, or null if none.


crsFactory

protected final CRSFactory crsFactory
Factory to use for building CoordinateReferenceSystem instances, or null if none.


copFactory

protected final CoordinateOperationFactory copFactory
Factory to use for building Conversion instances, or null if none.

Constructor Detail

ObjectFactoryTest

public ObjectFactoryTest(DatumFactory datumFactory,
                         CSFactory csFactory,
                         CRSFactory crsFactory,
                         CoordinateOperationFactory copFactory)
Creates a new test using the given factories. If a given factory is null, then the tests which depend on it will be skipped.

Parameters:
datumFactory - Factory for creating Datum instances.
csFactory - Factory for creating CoordinateSystem instances.
crsFactory - Factory for creating CoordinateReferenceSystem instances.
copFactory - Factory for creating Conversion instances.
Method Detail

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 than subclassed by the implementor. 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, and verifies that the axes are in the given (longitude, latitude) 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

public void testProjected3D()
                     throws FactoryException
Tests the creation of a projected CRS with vertical height.

Throws:
FactoryException - if a factory fails to create a referencing object.


Copyright © 1994-2013 Open Geospatial Consortium. All Rights Reserved.