Search in sources :

Example 1 with AbstractDatum

use of org.apache.sis.referencing.datum.AbstractDatum in project sis by apache.

the class AbstractIdentifiedObjectTest method testAsSubtype.

/**
 * Tests {@link AbstractIdentifiedObject#getIdentifier()} with a sub-type of {@code AbstractIdentifiedObject}.
 * The use of a subtype will allow {@code getIdentifier()} to build a URN and {@code getId()} to know what to
 * insert between {@code "epsg-"} and the code.
 */
@Test
@DependsOnMethod("testWithManyIdentifiers")
public void testAsSubtype() {
    final ReferenceIdentifier identifier = new NamedIdentifier(EPSG, "7019");
    final Set<ReferenceIdentifier> identifiers = Collections.singleton(identifier);
    final AbstractIdentifiedObject object = new AbstractDatum(properties(identifiers));
    final ReferenceIdentifier gmlId = validate(object, identifiers, "epsg-datum-7019");
    assertNotNull("gmlId", gmlId);
    assertEquals("gmlId.codespace", "EPSG", gmlId.getCodeSpace());
    assertEquals("gmlId.code", "7019", gmlId.getCode());
}
Also used : AbstractDatum(org.apache.sis.referencing.datum.AbstractDatum) ReferenceIdentifier(org.opengis.referencing.ReferenceIdentifier) Test(org.junit.Test) DependsOnMethod(org.apache.sis.test.DependsOnMethod)

Aggregations

AbstractDatum (org.apache.sis.referencing.datum.AbstractDatum)1 DependsOnMethod (org.apache.sis.test.DependsOnMethod)1 Test (org.junit.Test)1 ReferenceIdentifier (org.opengis.referencing.ReferenceIdentifier)1