Package org.opengis.util

Examples of org.opengis.util.InternationalString


     * This is validation code to be shared with {@link PropertyAccessorTest#testInformation()}.
     */
    static void validatePresentationForm(final ExtendedElementInformation information) {
        assertParentIsCitation(information);
        assertEquals("presentationForm", information.getName());
        final InternationalString definition = information.getDefinition();
        assertEquals("Mode in which the resource is represented.", definition.toString(Locale.ENGLISH));
        // Test other locale here, if any.

        assertInstanceOf("Specific to SIS implementation.", CheckedContainer.class, information);
        assertEquals(PresentationForm.class, ((CheckedContainer<?>) information).getElementType());
        assertEquals(Datatype.CODE_LIST, information.getDataType());
View Full Code Here


    public void testGetDomainValue() throws NoSuchMethodException {
        final ExtendedElementInformation information = new PropertyInformation<Double>(HardCodedCitations.ISO_19115,
                "maxRelativeHumidity", EnvironmentalRecord.class.getMethod("getMaxRelativeHumidity"), Double.class,
                DefaultEnvironmentalRecord.class.getMethod("getMaxRelativeHumidity").getAnnotation(ValueRange.class));

        final InternationalString domainValue = information.getDomainValue();
        assertNotNull(domainValue);
        assertEquals("[0.0 … 100.0]", domainValue.toString());
        assertEquals("[0 … 100]", domainValue.toString(Locale.ENGLISH));
        assertEquals("[0 … 100]", domainValue.toString(Locale.FRENCH));
        assertInstanceOf("Specific to SIS implementation.", Range.class, domainValue);
        assertEquals("getMinValue()", Double.valueOf0), ((Range) domainValue).getMinValue());
        assertEquals("getMaxValue()", Double.valueOf(100), ((Range) domainValue).getMaxValue());
    }
View Full Code Here

     * Returns the text to display as column header.
     *
     * @return The text to display as column header.
     */
    public synchronized InternationalString getHeader() {
        final InternationalString i18n = Types.toInternationalString(header);
        header = i18n;
        return i18n;
    }
View Full Code Here

    @Test
    @DependsOnMethod("testSet")
    public void testSetNull() {
        final DefaultCitation  instance = new DefaultCitation("Some title");
        final PropertyAccessor accessor = createPropertyAccessor();
        final InternationalString title = instance.getTitle();
        final int index = accessor.indexOf("title", true);

        assertEquals("Some title", title.toString()); // Sanity check before to continue.
        assertNull("title", accessor.set(index, instance, null, RETURN_NULL));
        assertNull("title", instance.getTitle());

        instance.setTitle(title);
        assertSame("title", title, accessor.set(index, instance, null, RETURN_PREVIOUS));
View Full Code Here

     * when adding elements in a collection, with or without conversion of type.
     */
    private static void testSetIntoCollection(final boolean conversion) {
        final String              text1    = "An other title";
        final String              text2    = "Yet an other title";
        final InternationalString title1   = new SimpleInternationalString(text1);
        final InternationalString title2   = new SimpleInternationalString(text2);
        final DefaultCitation     instance = new DefaultCitation("Ignored title");
        final PropertyAccessor    accessor = createPropertyAccessor();
        final int                 index    = accessor.indexOf("alternateTitles", true);

        // Insert the first value. Old collection shall be empty.
View Full Code Here

        final PropertyAccessor accessor = createPropertyAccessor();
        final int              baseCode = Citation.class.hashCode();
        int hashCode = accessor.hashCode(instance);
        assertEquals("Empty metadata.", baseCode, hashCode);

        final InternationalString title = new SimpleInternationalString("Some title");
        instance.setTitle(title);
        hashCode = accessor.hashCode(instance);
        assertEquals("Metadata with a single value.", baseCode + title.hashCode(), hashCode);

        final InternationalString alternateTitle = new SimpleInternationalString("An other title");
        instance.setAlternateTitles(singleton(alternateTitle));
        hashCode = accessor.hashCode(instance);
        assertEquals("Metadata with two values.", baseCode + title.hashCode() + Arrays.asList(alternateTitle).hashCode(), hashCode);
    }
View Full Code Here

     * @see FreeTextMarshallingTest
     */
    @Test
    public void testXML() throws JAXBException {
        final AbstractElement metadata = unmarshalFile(AbstractElement.class, XML_FILE);
        final InternationalString nameOfMeasure = getSingleton(metadata.getNamesOfMeasure());
        /*
         * Programmatic verification of the text group.
         */
        assertEquals("Quantitative quality measure focusing on the effective class percent "
                + "regarded to the total surface size", nameOfMeasure.toString(Locale.ENGLISH));
        assertEquals("Mesure qualité quantitative de type pourcentage de représentation de la "
                + "classe par rapport à la surface totale", nameOfMeasure.toString(Locale.FRENCH));
        /*
         * Opportunist test. While it was not the purpose of this test, the above metadata
         * needs to contain a "result" element in order to pass XML validation test.
         */
        assertInstanceOf("Wrong value for <gmd:result>", DefaultConformanceResult.class,
View Full Code Here

        /**
         * Returns the text to display as column header.
         */
        @Override
        public synchronized InternationalString getHeader() {
            InternationalString i18n = (InternationalString) header;
            if (i18n == null) {
                header = i18n = Vocabulary.formatInternational(resourceKey);
            }
            return i18n;
        }
View Full Code Here

     * {@link DefaultGeorectified#setCheckPointAvailable(boolean)}.
     */
    @Test
    public void testCheckPointAvailable() {
        final DefaultGeorectified metadata = new DefaultGeorectified();
        final InternationalString description = new SimpleInternationalString("A check point description.");
        assertFalse("checkPointAvailability", metadata.isCheckPointAvailable());

        // Setting the description shall set automatically the availability.
        metadata.setCheckPointDescription(description);
        assertTrue("checkPointAvailability", metadata.isCheckPointAvailable());
View Full Code Here

     * Tests {@link SpecialCases#information(int)}.
     */
    @Test
    public void testPropertyInformation() {
        final ExtendedElementInformation info = accessor.information(accessor.indexOf("westBoundLongitude", true));
        final InternationalString domain = info.getDomainValue();
        assertInstanceOf("Expected numerical information about range.", NumberRange.class, domain);
        final NumberRange<?> range = (NumberRange) domain;
        assertEquals(-180, range.getMinDouble(), STRICT);
        assertEquals(+180, range.getMaxDouble(), STRICT);
    }
View Full Code Here

TOP

Related Classes of org.opengis.util.InternationalString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.