Package org.opengis.test.referencing
Class ObjectFactoryTest
- Object
-
- TestCase
-
- ReferencingTestCase
-
- 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, implementors 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:
AuthorityFactoryTest
,TestSuite
-
-
Field Summary
Fields Modifier and Type Field Description protected CoordinateOperationFactory
copFactory
Factory to use for buildingConversion
instances, ornull
if none.protected CRSFactory
crsFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.protected CSFactory
csFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.protected DatumFactory
datumFactory
Factory to use for buildingDatum
instances, ornull
if none.-
Fields inherited from class TestCase
configurationTip, listener, units, validators
-
-
Constructor Summary
Constructors Constructor Description ObjectFactoryTest(DatumFactory datumFactory, CSFactory csFactory, CRSFactory crsFactory, CoordinateOperationFactory copFactory)
Creates a new test using the given factories.
-
Method Summary
Modifier and Type Method Description 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()
Deprecated.RenamedtestProjectedWithGeoidalHeight()
for making clearer that this is not a projected CRS associated to a 3D coordinate system.void
testProjectedWithGeoidalHeight()
Tests the creation of a compound CRS made of a projected CRS with a gravity-related height.void
testWGS84()
Tests the creation of the EPSG:4326GeographicCRS
.void
testWGS84_3D()
Tests the creation of the WGS84 CRS with ellipsoidal height, and verifies that the axes are in the given (latitude, longitude, height) order.-
Methods inherited from class ReferencingTestCase
verifyCoordinateSystem, verifyFlattenedSphere, verifyGeographicExtent, verifyIdentification, verifyParameter, verifyPrimeMeridian, verifyTimeExtent, verifyVerticalExtent
-
Methods inherited from class TestCase
configuration, factories, factories, getEnabledFlags
-
-
-
-
Field Detail
-
datumFactory
protected final DatumFactory datumFactory
Factory to use for buildingDatum
instances, ornull
if none.
-
csFactory
protected final CSFactory csFactory
Factory to use for buildingCoordinateSystem
instances, ornull
if none.
-
crsFactory
protected final CRSFactory crsFactory
Factory to use for buildingCoordinateReferenceSystem
instances, ornull
if none.
-
copFactory
protected final CoordinateOperationFactory copFactory
Factory to use for buildingConversion
instances, ornull
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 isnull
, then the tests which depend on it will be skipped.- Parameters:
datumFactory
- factory for creatingDatum
instances.csFactory
- factory for creatingCoordinateSystem
instances.crsFactory
- factory for creatingCoordinateReferenceSystem
instances.copFactory
- factory for creatingConversion
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 theTestCase.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:4326GeographicCRS
. This method wraps the object factories in anPseudoEpsgFactory
instance, then delegates to theAuthorityFactoryTest.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.RenamedtestProjectedWithGeoidalHeight()
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.
-
-