use of org.opengis.metadata.maintenance.MaintenanceInformation in project sis by apache.
the class CustomMetadataTest method testSubtypeAttributes.
/**
* Tests that the attributes defined in subtypes are also marshalled.
*
* @throws JAXBException if an error occurred during (un)marshalling.
*
* @see <a href="http://jira.geotoolkit.org/browse/GEOTK-108">GEOTK-108</a>
*/
@Test
public void testSubtypeAttributes() throws JAXBException {
final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class);
final DataIdentification identification = new DataIdentification() {
@Override
public InternationalString getAbstract() {
Map<Locale, String> names = new HashMap<>();
names.put(Locale.ENGLISH, "Description");
return factory.createInternationalString(names);
}
@Override
public InternationalString getEnvironmentDescription() {
Map<Locale, String> names = new HashMap<>();
names.put(Locale.ENGLISH, "Environment");
return factory.createInternationalString(names);
}
@Override
public InternationalString getSupplementalInformation() {
return null;
}
@Override
public Citation getCitation() {
return null;
}
@Override
public InternationalString getPurpose() {
return null;
}
@Override
public Collection<SpatialRepresentationType> getSpatialRepresentationTypes() {
return null;
}
@Override
public Collection<Resolution> getSpatialResolutions() {
return null;
}
@Override
public Collection<Locale> getLanguages() {
return null;
}
@Override
public Collection<CharacterSet> getCharacterSets() {
return null;
}
@Override
public Collection<TopicCategory> getTopicCategories() {
return null;
}
@Override
public Collection<Extent> getExtents() {
return null;
}
@Override
public Collection<String> getCredits() {
return null;
}
@Override
public Collection<Progress> getStatus() {
return null;
}
@Override
public Collection<ResponsibleParty> getPointOfContacts() {
return null;
}
@Override
public Collection<MaintenanceInformation> getResourceMaintenances() {
return null;
}
@Override
public Collection<BrowseGraphic> getGraphicOverviews() {
return null;
}
@Override
public Collection<Format> getResourceFormats() {
return null;
}
@Override
public Collection<Keywords> getDescriptiveKeywords() {
return null;
}
@Override
public Collection<Usage> getResourceSpecificUsages() {
return null;
}
@Override
public Collection<Constraints> getResourceConstraints() {
return null;
}
@Deprecated
@Override
public Collection<AggregateInformation> getAggregationInfo() {
return null;
}
};
final DefaultMetadata data = new DefaultMetadata();
data.setIdentificationInfo(singleton(identification));
final String xml = XML.marshal(data);
/*
* A few simple checks.
*/
assertTrue("Missing Identification attribute.", xml.contains("Description"));
assertTrue("Missing DataIdentification attribute.", xml.contains("Environment"));
}
Aggregations