use of org.opengis.metadata.constraint.LegalConstraints 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