*
* @throws JAXBException if the (un)marshalling process fails.
*/
@Test
public void testMetadataWithVerticalCRS() throws JAXBException {
final Metadata metadata = unmarshalFile(Metadata.class, VERTICAL_CRS_XML);
assertEquals("fileIdentifier", "20090901", metadata.getFileIdentifier());
assertEquals("language", Locale.ENGLISH, metadata.getLanguage());
assertEquals("characterSet", CharacterSet.UTF_8, metadata.getCharacterSet());
assertEquals("dateStamp", xmlDate("2014-01-04 00:00:00"), metadata.getDateStamp());
/*
* <gmd:contact>
* <gmd:CI_ResponsibleParty>
* …
* </gmd:CI_ResponsibleParty>
* </gmd:contact>
*/
final ResponsibleParty contact = getSingleton(metadata.getContacts());
final OnlineResource onlineResource = contact.getContactInfo().getOnlineResource();
assertNotNull("onlineResource", onlineResource);
assertEquals("organisationName", "Apache SIS", contact.getOrganisationName().toString());
assertEquals("linkage", URI.create("http://sis.apache.org"), onlineResource.getLinkage());
assertEquals("function", OnLineFunction.INFORMATION, onlineResource.getFunction());
assertEquals("role", Role.PRINCIPAL_INVESTIGATOR, contact.getRole());
/*
* <gmd:spatialRepresentationInfo>
* <gmd:MD_VectorSpatialRepresentation>
* …
* </gmd:MD_VectorSpatialRepresentation>
* </gmd:spatialRepresentationInfo>
*/
final SpatialRepresentation spatial = getSingleton(metadata.getSpatialRepresentationInfo());
assertInstanceOf("spatialRepresentationInfo", VectorSpatialRepresentation.class, spatial);
assertEquals("geometricObjectType", GeometricObjectType.POINT, getSingleton(
((VectorSpatialRepresentation) spatial).getGeometricObjects()).getGeometricObjectType());
/*
* <gmd:referenceSystemInfo>
* <gmd:MD_ReferenceSystem>
* …
* </gmd:MD_ReferenceSystem>
* </gmd:referenceSystemInfo>
*/
assertIdentifierEquals("referenceSystemInfo", null, "EPSG", null, "World Geodetic System 84",
getSingleton(metadata.getReferenceSystemInfo()).getName());
/*
* <gmd:identificationInfo>
* <gmd:MD_DataIdentification>
* …
*/
final DataIdentification identification = (DataIdentification) getSingleton(metadata.getIdentificationInfo());
final Citation citation = identification.getCitation();
assertInstanceOf("citation", NilObject.class, citation);
assertEquals("nilReason", NilReason.MISSING, ((NilObject) citation).getNilReason());
assertEquals("abstract", "SIS test", identification.getAbstract().toString());
assertEquals("language", Locale.ENGLISH, getSingleton(identification.getLanguages()));