use of org.apache.sis.metadata.iso.constraint.DefaultConstraints in project sis by apache.
the class DefaultDataIdentificationTest method create.
/**
* Creates the instance to test.
*/
private static DefaultDataIdentification create() {
/*
* Citation
* ├─Title……………………………………………………………………………… Sea Surface Temperature Analysis Model
* ├─Date
* │ ├─Date……………………………………………………………………… Sep 22, 2005 00:00:00 AM
* │ └─Date type………………………………………………………… Creation
* └─Identifier
* └─Code……………………………………………………………………… NCEP/SST/Global_5x2p5deg/SST_Global_5x2p5deg_20050922_0000.nc
*/
final DefaultCitation citation = new DefaultCitation("Sea Surface Temperature Analysis Model");
citation.setDates(singleton(new DefaultCitationDate(TestUtilities.date("2005-09-22 00:00:00"), DateType.CREATION)));
citation.setIdentifiers(singleton(new DefaultIdentifier("SST_Global.nc")));
/*
* Descriptive keywords
* ├─Keyword………………………………………………………………………… EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature
* ├─Type………………………………………………………………………………… Theme
* └─Thesaurus name
* └─Title…………………………………………………………………… GCMD Science Keywords
*/
final DefaultKeywords keywords = new DefaultKeywords("EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature");
keywords.setType(KeywordType.THEME);
keywords.setThesaurusName(new DefaultCitation("GCMD Science Keywords"));
/*
* Identification info
* ├─(above objects)
* ├─Abstract………………………………………………………………………………… NCEP SST Global 5.0 x 2.5 degree model data
* ├─Descriptive keywords
* │ ├─Keyword………………………………………………………………………… EARTH SCIENCE > Oceans > Ocean Temperature > Sea Surface Temperature
* │ ├─Type………………………………………………………………………………… Theme
* │ └─Thesaurus name
* │ └─Title…………………………………………………………………… GCMD Science Keywords
* ├─Resource constraints
* │ └─Use limitation……………………………………………………… Freely available
* ├─Spatial representation type……………………………… Grid
* ├─Language (1 of 2)………………………………………………………… en_US
* ├─Language (2 of 2)………………………………………………………… en
* ├─Character set…………………………………………………………………… US-ASCII
* └─Extent
* └─Geographic element
* ├─West bound longitude…………………………… 180°W
* ├─East bound longitude…………………………… 180°E
* ├─South bound latitude…………………………… 90°S
* ├─North bound latitude…………………………… 90°N
* └─Extent type code……………………………………… true
*/
final DefaultDataIdentification info = new DefaultDataIdentification(citation, "NCEP SST Global 5.0 x 2.5 degree model data", null, null);
info.setSpatialRepresentationTypes(singleton(SpatialRepresentationType.GRID));
info.setDescriptiveKeywords(singleton(keywords));
info.setResourceConstraints(singleton(new DefaultConstraints("Freely available")));
info.setExtents(singleton(Extents.WORLD));
info.setLanguages(asList(LOCALES));
info.setCharacterSets(singleton(CharacterSet.US_ASCII));
return info;
}
use of org.apache.sis.metadata.iso.constraint.DefaultConstraints in project sis by apache.
the class FrenchProfileTest method testConstraintsToAFNOR.
/**
* Tests {@link FrenchProfile#toAFNOR(Object)} with {@link Constraints},
* {@link LegalConstraints} and {@link SecurityConstraints} objects.
*/
@Test
public void testConstraintsToAFNOR() {
Constraints std, fra;
std = new DefaultConstraints("Some constraints.");
fra = (Constraints) FrenchProfile.toAFNOR(std);
assertNotSame("Expected a copy.", std, fra);
assertSame("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
assertEquals("Some constraints.", getSingleton(fra.getUseLimitations()).toString());
std = new DefaultLegalConstraints("Some legal constraints.");
fra = (LegalConstraints) FrenchProfile.toAFNOR(std);
assertNotSame("Expected a copy.", std, fra);
assertSame("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
assertEquals("Some legal constraints.", getSingleton(fra.getUseLimitations()).toString());
std = new DefaultSecurityConstraints("Some security constraints.");
fra = (SecurityConstraints) FrenchProfile.toAFNOR(std);
assertNotSame("Expected a copy.", std, fra);
assertSame("Already an AFNOR instance.", fra, FrenchProfile.toAFNOR(fra));
assertEquals("Some security constraints.", getSingleton(fra.getUseLimitations()).toString());
}
Aggregations