Object
IntegrityTest
Series2000<T>
- Type Parameters:
T
- the type of objects to test.
- Direct Known Subclasses:
Test2201
,Test2202
,Test2203
,Test2204
,Test2205
,Test2206
,Test2207
,Test2208
,Test2209
,Test2210
,Test2211
Base class for tests of EPSG definitions (2000 series).
Those tests verify the correctness of geodetic parameters that are delivered with the software.
The geodetic objects are created using one or many
AuthorityFactory
sub-types.
The comparison to be taken as truth is the EPSG Dataset.- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionString[]
The expected aliases of theT
instance to test, or an empty array if none.int
The EPSG code of theT
instance to test.protected boolean
true
if theIdentifiedObject
instances created indirectly by the factories are expected to have correct identification information.protected boolean
true
if the factory support creation of deprecated objects.protected boolean
true
if the tested factories support operation version.protected boolean
true
if the tested factories support aliases.protected boolean
true
if the tested factories support identifiers.protected boolean
true
if the tested factories support standard names.The name of theT
instance to test, as used in the EPSG dataset. -
Method Summary
Modifier and TypeMethodDescriptionabstract T
Returns the instance to be tested.protected String
getVerifiableName
(IdentifiedObject object) Returns a name of the given object that can be compared against the expected name.
-
Field Details
-
code
public int codeThe EPSG code of theT
instance to test. This field is set by all test methods before to create and verify theT
instance. This code can be compared to the identifiers returned byIdentifiedObject.getIdentifiers()
. -
name
The name of theT
instance to test, as used in the EPSG dataset. This field is set by all test methods before to create and verify theT
instance. This name will be compared to the value returned byIdentifiedObject.getName()
, unlessisStandardNameSupported
isfalse
. -
aliases
The expected aliases of theT
instance to test, or an empty array if none. This field is set by all test methods before to create and verify theT
instance. Those aliases will be compared to the values returned byIdentifiedObject.getAlias()
, unlessisStandardAliasSupported
isfalse
. -
isStandardIdentifierSupported
protected boolean isStandardIdentifierSupportedtrue
if the tested factories support identifiers. Iftrue
(the default), then the test methods will ensure that the identified objects created by the factories declare the authority code used for fetching the object. Iffalse
, then the identifiers are ignored. -
isStandardNameSupported
protected boolean isStandardNameSupportedtrue
if the tested factories support standard names. Iftrue
(the default), then the test methods will ensure that the identified objects created by the factories declare the same name than the GIGS tests. Iffalse
, then the names are ignored. -
isStandardAliasSupported
protected boolean isStandardAliasSupportedtrue
if the tested factories support aliases. Iftrue
(the default), then the test methods will ensure that the identified objects created by the factories declare at least all the aliases enumerated in the GIGS tests - additional aliases, if any, are ignored. Iffalse
, then the aliases are ignored. -
isDependencyIdentificationSupported
protected boolean isDependencyIdentificationSupportedtrue
if theIdentifiedObject
instances created indirectly by the factories are expected to have correct identification information. For example, when testing aCoordinateReferenceSystem
(CRS) object, the CRS authority code will be verified unconditionally but the authority codes of associated objects (GeodeticDatum
orCoordinateSystem
) will be verified only if this flag istrue
. -
isDeprecatedObjectCreationSupported
protected boolean isDeprecatedObjectCreationSupportedtrue
if the factory support creation of deprecated objects. -
isOperationVersionSupported
protected boolean isOperationVersionSupportedtrue
if the tested factories support operation version. Iftrue
(the default), then the test methods will ensure that the operations created by the factories declare the expected operation version. Iffalse
, then the operation version is ignored.This flag is significant only for tests on coordinate transformations.
-
-
Method Details
-
getIdentifiedObject
Returns the instance to be tested. When this method is invoked for the first time, it creates the instance to test by invoking acreateXXX(String)
method on the user-specifiedAuthorityFactory
with the currentcode
value in argument. The created object is then cached and returned in subsequent invocations of this method.Usually, each test method creates exactly one object. But a few (relatively rare) tests may create more than one object. In such case, the instance returned by this method may vary.
- Returns:
- the instance to test.
- Throws:
FactoryException
- if an error occurred while creating the identified object.
-
getVerifiableName
Returns a name of the given object that can be compared against the expected name. The current implementation returnsobject.getName().getCode()
converted to ASCII characters on a best effort basis (e.g. "é" is replaced by "e"), ornull
if the given object, its name or its code is null.Subclasses can override this method when testing an
AuthorityFactory
implementation which is known to use slightly different name than the one used in the EPSG database, or if the implementation stores the EPSG name as an alias instead of as the primary name.Example: if an implementation replaces all spaces by underscores, then a subclass testing that implementation could override this method as below:Note that if the object names are too different for being compared, then subclasses can also disable name comparisons by setting@Override protected String getVerifiableName(IdentifiedObject object) { return super.getVerifiableName().replace(' ', '_'); }
isStandardNameSupported
tofalse
.- Parameters:
object
- the object from which to get a name than can be verified against the expected name.- Returns:
- the name of the given object, eventually modified in order to match the expected name.
- See Also:
-