Search in sources :

Example 1 with LegalConstraints

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());
}
Also used : DefaultSecurityConstraints(org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints) DefaultConstraints(org.apache.sis.metadata.iso.constraint.DefaultConstraints) SecurityConstraints(org.opengis.metadata.constraint.SecurityConstraints) DefaultLegalConstraints(org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints) LegalConstraints(org.opengis.metadata.constraint.LegalConstraints) Constraints(org.opengis.metadata.constraint.Constraints) DefaultLegalConstraints(org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints) DefaultSecurityConstraints(org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints) DefaultConstraints(org.apache.sis.metadata.iso.constraint.DefaultConstraints) Test(org.junit.Test)

Aggregations

DefaultConstraints (org.apache.sis.metadata.iso.constraint.DefaultConstraints)1 DefaultLegalConstraints (org.apache.sis.metadata.iso.constraint.DefaultLegalConstraints)1 DefaultSecurityConstraints (org.apache.sis.metadata.iso.constraint.DefaultSecurityConstraints)1 Test (org.junit.Test)1 Constraints (org.opengis.metadata.constraint.Constraints)1 LegalConstraints (org.opengis.metadata.constraint.LegalConstraints)1 SecurityConstraints (org.opengis.metadata.constraint.SecurityConstraints)1