use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.
the class DefaultProcessStepTest method roundtrip.
/**
* Tests (un)marshalling in the given version.
*/
private void roundtrip(final String filename, final Version version) throws JAXBException {
final DefaultProcessing processing = new DefaultProcessing();
final DefaultProcessStep processStep = new DefaultProcessStep("Some process step.");
processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
processing.setIdentifier(new DefaultIdentifier("P4"));
processStep.setProcessingInformation(processing);
/*
* XML marshalling, and compare with the content of "ProcessStep.xml" file.
*/
assertMarshalEqualsFile(filename, processStep, version, "xmlns:*", "xsi:schemaLocation");
/*
* XML unmarshalling: ensure that we didn't lost any information.
* Note that since the XML uses the <gmi:…> namespace, we got an instance of LE_ProcessStep, which
* in SIS implementation does not carry any useful information; it is just a consequence of the way
* namespaces are managed. We will convert to the parent DefaultProcessStep type before comparison.
*/
DefaultProcessStep step = unmarshalFile(DefaultProcessStep.class, filename);
assertInstanceOf("The unmarshalled object is expected to be in GMI namespace.", LE_ProcessStep.class, step);
step = new DefaultProcessStep(step);
assertEquals(processStep, step);
}
use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.
the class MergerTest method createSample2.
/**
* Creates a metadata sample with content information of different kind in a different order
* than the one created by {@link #createSample1()}.
*/
private static DefaultMetadata createSample2() {
final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
final DefaultImageDescription image = new DefaultImageDescription();
final DefaultMetadata metadata = new DefaultMetadata();
image.setProcessingLevelCode(new DefaultIdentifier("Level 2"));
metadata.getContentInfo().add(image);
features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("GPX file")));
features.setIncludedWithDataset(Boolean.TRUE);
metadata.getContentInfo().add(features);
metadata.getLanguages().add(Locale.FRENCH);
return metadata;
}
use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.
the class MergerTest method createSample1.
/**
* Creates a metadata sample with 3 content information of different kind.
*/
private static DefaultMetadata createSample1() {
final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
final DefaultCoverageDescription coverage = new DefaultCoverageDescription();
final DefaultImageDescription image = new DefaultImageDescription();
final DefaultMetadata metadata = new DefaultMetadata();
features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("Shapefile")));
features.setIncludedWithDataset(Boolean.TRUE);
metadata.getContentInfo().add(features);
coverage.setProcessingLevelCode(new DefaultIdentifier("Level 1"));
metadata.getContentInfo().add(coverage);
image.setImagingCondition(ImagingCondition.CLOUD);
image.setCloudCoverPercentage(0.8);
metadata.getContentInfo().add(image);
metadata.getLanguages().add(Locale.JAPANESE);
metadata.getCharacterSets().add(StandardCharsets.UTF_16);
return metadata;
}
Aggregations