sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/01: Merge branch 'geoapi-3.1'
Date Wed, 11 Sep 2019 12:08:30 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sis.git

commit a888fcdd1b884aeec5f28dc9beb5cb9ab8a9fc6d
Merge: 6b6cc17 b403553
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Sep 11 14:08:15 2019 +0200

    Merge branch 'geoapi-3.1'

 .../apache/sis/console/ResourcesDownloader.java    |   2 +-
 .../java/org/apache/sis/internal/jaxb/Context.java |   2 +-
 .../jaxb/gco/InternationalStringAdapter.java       |   2 +-
 .../apache/sis/internal/jaxb/gco/PropertyType.java |   2 +-
 .../sis/internal/jaxb/gco/StringAdapter.java       |   2 +-
 .../sis/internal/jaxb/geometry/package-info.java   |   2 +-
 .../sis/internal/jaxb/gmi/LE_ProcessStep.java      |   2 +-
 .../apache/sis/internal/jaxb/gmi/LE_Source.java    |   2 +-
 .../org/apache/sis/internal/jaxb/gmi/MI_Band.java  |   2 +-
 .../internal/jaxb/gmi/MI_CoverageDescription.java  |   2 +-
 .../sis/internal/jaxb/gmi/MI_Georectified.java     |   2 +-
 .../sis/internal/jaxb/gmi/MI_Georeferenceable.java |   2 +-
 .../sis/internal/jaxb/gmi/MI_ImageDescription.java |   2 +-
 .../apache/sis/internal/jaxb/gmi/MI_Metadata.java  |   2 +-
 .../sis/internal/jaxb/metadata/CI_Address.java     |   2 +-
 .../sis/internal/jaxb/metadata/CI_Citation.java    |   2 +-
 .../sis/internal/jaxb/metadata/CI_Contact.java     |   2 +-
 .../apache/sis/internal/jaxb/metadata/CI_Date.java |   2 +-
 .../internal/jaxb/metadata/CI_OnlineResource.java  |   2 +-
 .../sis/internal/jaxb/metadata/CI_Party.java       |   2 +-
 .../internal/jaxb/metadata/CI_Responsibility.java  |   2 +-
 .../jaxb/metadata/CI_ResponsibleParty.java         |   2 +-
 .../sis/internal/jaxb/metadata/CI_Series.java      |   2 +-
 .../sis/internal/jaxb/metadata/CI_Telephone.java   |   2 +-
 .../sis/internal/jaxb/metadata/DQ_DataQuality.java |   2 +-
 .../sis/internal/jaxb/metadata/DQ_Element.java     |   2 +-
 .../jaxb/metadata/DQ_PositionalAccuracy.java       |   2 +-
 .../sis/internal/jaxb/metadata/DQ_Result.java      |   2 +-
 .../sis/internal/jaxb/metadata/EX_Extent.java      |   2 +-
 .../jaxb/metadata/EX_GeographicExtent.java         |   2 +-
 .../internal/jaxb/metadata/EX_TemporalExtent.java  |   2 +-
 .../internal/jaxb/metadata/EX_VerticalExtent.java  |   2 +-
 .../sis/internal/jaxb/metadata/LE_Algorithm.java   |   2 +-
 .../jaxb/metadata/LE_NominalResolution.java        |   2 +-
 .../jaxb/metadata/LE_ProcessStepReport.java        |   2 +-
 .../sis/internal/jaxb/metadata/LE_Processing.java  |   2 +-
 .../sis/internal/jaxb/metadata/LI_Lineage.java     |   2 +-
 .../sis/internal/jaxb/metadata/LI_ProcessStep.java |   2 +-
 .../sis/internal/jaxb/metadata/LI_Source.java      |   2 +-
 .../jaxb/metadata/MD_AggregateInformation.java     |   2 +-
 .../metadata/MD_ApplicationSchemaInformation.java  |   2 +-
 .../internal/jaxb/metadata/MD_AttributeGroup.java  |   2 +-
 .../internal/jaxb/metadata/MD_BrowseGraphic.java   |   2 +-
 .../sis/internal/jaxb/metadata/MD_Constraints.java |   2 +-
 .../jaxb/metadata/MD_ContentInformation.java       |   2 +-
 .../jaxb/metadata/MD_DataIdentification.java       |   2 +-
 .../jaxb/metadata/MD_DigitalTransferOptions.java   |   2 +-
 .../sis/internal/jaxb/metadata/MD_Dimension.java   |   2 +-
 .../internal/jaxb/metadata/MD_Distribution.java    |   2 +-
 .../sis/internal/jaxb/metadata/MD_Distributor.java |   2 +-
 .../metadata/MD_ExtendedElementInformation.java    |   2 +-
 .../internal/jaxb/metadata/MD_FeatureTypeInfo.java |   2 +-
 .../sis/internal/jaxb/metadata/MD_Format.java      |   2 +-
 .../jaxb/metadata/MD_GeometricObjects.java         |   2 +-
 .../internal/jaxb/metadata/MD_Identification.java  |   2 +-
 .../sis/internal/jaxb/metadata/MD_Identifier.java  |   2 +-
 .../internal/jaxb/metadata/MD_KeywordClass.java    |   2 +-
 .../sis/internal/jaxb/metadata/MD_Keywords.java    |   2 +-
 .../jaxb/metadata/MD_MaintenanceInformation.java   |   2 +-
 .../sis/internal/jaxb/metadata/MD_Medium.java      |   2 +-
 .../sis/internal/jaxb/metadata/MD_Metadata.java    |   2 +-
 .../metadata/MD_MetadataExtensionInformation.java  |   2 +-
 .../internal/jaxb/metadata/MD_MetadataScope.java   |   2 +-
 .../metadata/MD_PortrayalCatalogueReference.java   |   2 +-
 .../internal/jaxb/metadata/MD_RangeDimension.java  |   2 +-
 .../internal/jaxb/metadata/MD_Releasability.java   |   2 +-
 .../jaxb/metadata/MD_RepresentativeFraction.java   |   2 +-
 .../sis/internal/jaxb/metadata/MD_Resolution.java  |   2 +-
 .../sis/internal/jaxb/metadata/MD_Scope.java       |   2 +-
 .../jaxb/metadata/MD_ScopeDescription.java         |   2 +-
 .../jaxb/metadata/MD_SpatialRepresentation.java    |   2 +-
 .../jaxb/metadata/MD_StandardOrderProcess.java     |   2 +-
 .../sis/internal/jaxb/metadata/MD_Usage.java       |   2 +-
 .../jaxb/metadata/MI_AcquisitionInformation.java   |   2 +-
 .../jaxb/metadata/MI_EnvironmentalRecord.java      |   2 +-
 .../sis/internal/jaxb/metadata/MI_Event.java       |   2 +-
 .../apache/sis/internal/jaxb/metadata/MI_GCP.java  |   2 +-
 .../jaxb/metadata/MI_GeolocationInformation.java   |   2 +-
 .../sis/internal/jaxb/metadata/MI_Instrument.java  |   2 +-
 .../sis/internal/jaxb/metadata/MI_Objective.java   |   2 +-
 .../sis/internal/jaxb/metadata/MI_Operation.java   |   2 +-
 .../apache/sis/internal/jaxb/metadata/MI_Plan.java |   2 +-
 .../sis/internal/jaxb/metadata/MI_Platform.java    |   2 +-
 .../internal/jaxb/metadata/MI_PlatformPass.java    |   2 +-
 .../jaxb/metadata/MI_RangeElementDescription.java  |   2 +-
 .../internal/jaxb/metadata/MI_RequestedDate.java   |   2 +-
 .../sis/internal/jaxb/metadata/MI_Requirement.java |   2 +-
 .../sis/internal/jaxb/metadata/MX_DataFile.java    |   2 +-
 .../internal/jaxb/metadata/RS_ReferenceSystem.java |  22 +-
 .../internal/jaxb/metadata/SV_CoupledResource.java |   2 +-
 .../jaxb/metadata/SV_OperationChainMetadata.java   |   2 +-
 .../jaxb/metadata/SV_OperationMetadata.java        |   2 +-
 .../sis/internal/jaxb/metadata/SV_Parameter.java   |   2 +-
 .../sis/internal/jaxb/metadata/package-info.java   |   2 +-
 .../metadata/replace/ReferenceSystemMetadata.java  |  12 +-
 .../metadata/iso/extent/DefaultVerticalExtent.java |   2 +-
 .../sis/internal/jaxb/cat/EnumMarshallingTest.java |   2 +-
 .../sis/metadata/iso/CustomMetadataTest.java       |   2 +-
 .../internal/jaxb/referencing/CC_Conversion.java   |   2 +-
 .../jaxb/referencing/CC_CoordinateOperation.java   |   2 +-
 .../referencing/CC_GeneralOperationParameter.java  |   2 +-
 .../jaxb/referencing/CC_GeneralParameterValue.java |   2 +-
 .../jaxb/referencing/CC_OperationMethod.java       |   2 +-
 .../jaxb/referencing/CC_OperationParameter.java    |   2 +-
 .../referencing/CC_OperationParameterGroup.java    |   2 +-
 .../internal/jaxb/referencing/CD_Ellipsoid.java    |   2 +-
 .../jaxb/referencing/CD_EngineeringDatum.java      |   2 +-
 .../jaxb/referencing/CD_GeodeticDatum.java         |   2 +-
 .../internal/jaxb/referencing/CD_ImageDatum.java   |   2 +-
 .../jaxb/referencing/CD_ParametricDatum.java       |   2 +-
 .../jaxb/referencing/CD_PrimeMeridian.java         |   2 +-
 .../jaxb/referencing/CD_TemporalDatum.java         |   2 +-
 .../jaxb/referencing/CD_VerticalDatum.java         |   2 +-
 .../sis/internal/jaxb/referencing/CS_AffineCS.java |   2 +-
 .../internal/jaxb/referencing/CS_CartesianCS.java  |   2 +-
 .../jaxb/referencing/CS_CoordinateSystem.java      |   2 +-
 .../jaxb/referencing/CS_CoordinateSystemAxis.java  |   2 +-
 .../jaxb/referencing/CS_CylindricalCS.java         |   2 +-
 .../jaxb/referencing/CS_EllipsoidalCS.java         |   2 +-
 .../sis/internal/jaxb/referencing/CS_LinearCS.java |   2 +-
 .../internal/jaxb/referencing/CS_ParametricCS.java |   2 +-
 .../sis/internal/jaxb/referencing/CS_PolarCS.java  |   2 +-
 .../internal/jaxb/referencing/CS_SphericalCS.java  |   2 +-
 .../sis/internal/jaxb/referencing/CS_TimeCS.java   |   2 +-
 .../jaxb/referencing/CS_UserDefinedCS.java         |   2 +-
 .../internal/jaxb/referencing/CS_VerticalCS.java   |   2 +-
 .../sis/internal/jaxb/referencing/SC_CRS.java      |   2 +-
 .../internal/jaxb/referencing/SC_SingleCRS.java    |   2 +-
 .../internal/jaxb/referencing/SC_VerticalCRS.java  |   2 +-
 .../internal/jaxb/referencing/package-info.java    |   2 +-
 .../sis/referencing/crs/SC_GeographicCRS.java      |   2 +-
 .../referencing/datum/DefaultPrimeMeridian.java    |   2 +-
 .../referencing/datum/DefaultEllipsoidTest.java    |   4 +-
 .../apache/sis/test/integration/MetadataTest.java  | 242 ++++++---------------
 .../sis/test/integration/MetadataVerticalTest.java | 211 ++++++++++++++++++
 .../sis/test/suite/ReferencingTestSuite.java       |   1 +
 .../org/apache/sis/test/integration/Metadata.xml   |  63 ++++--
 .../sis/storage/earthobservation/LandsatTest.txt   |   2 +-
 .../sis/internal/storage/xml/MimeTypeDetector.java |   2 +-
 139 files changed, 477 insertions(+), 342 deletions(-)

diff --cc core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java
index c424692,458f7e5..1099417
--- a/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataTest.java
@@@ -78,7 -68,7 +68,6 @@@ import static java.util.Collections.sin
  import static java.util.Collections.singletonMap;
  
  // Test dependencies
--
  import org.apache.sis.test.LoggingWatcher;
  import org.apache.sis.test.TestUtilities;
  import org.apache.sis.test.xml.DocumentComparator;
@@@ -89,10 -79,7 +78,9 @@@ import org.junit.Rule
  import org.junit.Test;
  
  import static org.apache.sis.test.Assert.*;
- import static org.apache.sis.test.TestUtilities.getSingleton;
  
 +import org.apache.sis.internal.geoapi.evolution.UnsupportedCodeList;
 +
  
  /**
   * Tests XML (un)marshalling of a metadata object containing various elements
@@@ -148,21 -135,9 +136,21 @@@ public final strictfp class MetadataTes
      }
  
      /**
 +     * Creates a telephone number of the given type.
 +     *
 +     * @param type Either {@code "VOICE"}, {@code "FACSIMILE"} or {@code "SMS"}.
 +     */
 +    private static DefaultTelephone telephone(final String number, final String type) {
 +        final DefaultTelephone tel = new DefaultTelephone();
 +        tel.setNumber(number);
 +        tel.setNumberType(UnsupportedCodeList.valueOf(type));
 +        return tel;
 +    }
 +
 +    /**
-      * Programmatically creates the metadata to marshall, or to compare against the unmarshalled
metadata.
+      * Programmatically creates the metadata to marshal, or to compare against the unmarshalled
metadata.
       *
-      * @return the hard-coded representation of {@code "Metadata.xml"} content.
+      * @return the hard-coded representation of {@value #XML_FILE} content.
       */
      private DefaultMetadata createHardCoded() {
          final DefaultMetadata metadata = new DefaultMetadata();
@@@ -272,9 -247,9 +260,9 @@@
               */
              {
                  @SuppressWarnings("deprecation")
 -                final DefaultAssociatedResource aggregateInfo = new DefaultAggregateInformation();
 +                final DefaultAggregateInformation aggregateInfo = new DefaultAggregateInformation();
-                 final DefaultCitation name = new DefaultCitation("MEDIPROD VI");
-                 name.setAlternateTitles(singleton(new SimpleInternationalString("90008411")));
+                 final DefaultCitation name = new DefaultCitation("Some oceanographic campaign");
+                 name.setAlternateTitles(singleton(new SimpleInternationalString("Pseudo
group of data")));
                  name.setDates(singleton(new DefaultCitationDate(TestUtilities.date("1990-06-04
22:00:00"), DateType.REVISION)));
                  aggregateInfo.setName(name);
                  aggregateInfo.setInitiativeType(InitiativeType.CAMPAIGN);
@@@ -420,11 -404,10 +417,11 @@@
           * by the anchor version so we can compare the XML with the "Metadata.xml" file
content.
           */
          final StringBuffer xml = writer.getBuffer();
-         replace(xml, "<gcol:CharacterString>Common Data Index record</gcol:CharacterString>",
-                      "<gmx:Anchor xlink:href=\"SDN:L231:3:CDI\">Common Data Index
record</gmx:Anchor>");
-         replace(xml, "<gcol:CharacterString>EPSG:4326</gcol:CharacterString>",
-                      "<gmx:Anchor xlink:href=\"SDN:L101:2:4326\">EPSG:4326</gmx:Anchor>");
+         replace(xml, "<gcol:CharacterString>Pseudo Common Data Index record</gcol:CharacterString>",
+                      "<gmx:Anchor xlink:href=\"SDN:L231:3:CDI\">Pseudo Common Data
Index record</gmx:Anchor>");
+         replace(xml, "<gcol:CharacterString>4326</gcol:CharacterString>",
+                      "<gmx:Anchor xlink:href=\"SDN:L101:2:4326\">4326</gmx:Anchor>");
 +        replace(xml, "License", "Licence");
          /*
           * The <gmd:EX_TemporalExtent> block can not be marshalled yet, since it requires
the sis-temporal module.
           * We need to instruct the XML comparator to ignore this block during the comparison.
We also ignore for
diff --cc core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataVerticalTest.java
index 0000000,7178e51..38c4e99
mode 000000,100644..100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataVerticalTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/test/integration/MetadataVerticalTest.java
@@@ -1,0 -1,214 +1,211 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to You under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  *     http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ package org.apache.sis.test.integration;
+ 
+ import java.net.URI;
+ import java.util.Locale;
 -import java.nio.charset.StandardCharsets;
+ import javax.xml.bind.JAXBException;
+ 
+ import org.opengis.metadata.*;
+ import org.opengis.metadata.citation.*;
+ import org.opengis.metadata.extent.Extent;
+ import org.opengis.metadata.extent.GeographicBoundingBox;
+ import org.opengis.metadata.extent.VerticalExtent;
+ import org.opengis.metadata.spatial.GeometricObjectType;
+ import org.opengis.metadata.spatial.SpatialRepresentation;
+ import org.opengis.metadata.spatial.VectorSpatialRepresentation;
++import org.opengis.metadata.identification.CharacterSet;
+ import org.opengis.metadata.identification.DataIdentification;
+ import org.opengis.referencing.IdentifiedObject;
+ import org.opengis.referencing.cs.AxisDirection;
+ import org.opengis.referencing.cs.CoordinateSystemAxis;
+ import org.opengis.referencing.cs.VerticalCS;
+ import org.opengis.referencing.crs.VerticalCRS;
+ import org.opengis.referencing.datum.VerticalDatum;
+ import org.opengis.referencing.datum.VerticalDatumType;
+ 
+ import org.apache.sis.internal.system.Loggers;
+ import org.apache.sis.xml.NilObject;
+ import org.apache.sis.xml.NilReason;
+ 
+ // Test dependencies
+ import org.apache.sis.test.LoggingWatcher;
+ import org.apache.sis.test.xml.TestCase;
+ import org.apache.sis.test.DependsOn;
+ import org.junit.After;
+ import org.junit.Rule;
+ import org.junit.Test;
+ 
+ import static org.apache.sis.test.Assert.*;
+ import static org.apache.sis.test.TestUtilities.getSingleton;
+ 
+ 
+ /**
+  * Tests XML (un)marshalling of a metadata object containing a vertical extent
+  * together with its vertical CRS description.
+  *
+  * @author  Guilhem Legal (Geomatys)
+  * @author  Martin Desruisseaux (Geomatys)
+  * @version 1.0
+  *
+  * @see org.apache.sis.metadata.iso.DefaultMetadataTest
+  *
+  * @since 0.5
+  * @module
+  */
+ @DependsOn({
+     org.apache.sis.referencing.datum.DefaultVerticalDatumTest.class
+ })
+ public strictfp class MetadataVerticalTest extends TestCase {
+     /**
+      * The resource file which contains an XML representation
+      * of a {@link Metadata} object with a {@link VerticalCRS}.
+      */
+     private static final String XML_FILE = "Metadata with vertical CRS.xml";
+ 
+     /**
+      * A JUnit {@link Rule} for listening to log events. This field is public because JUnit
requires us to
+      * do so, but should be considered as an implementation details (it should have been
a private field).
+      */
+     @Rule
+     public final LoggingWatcher loggings = new LoggingWatcher(Loggers.XML);
+ 
+     /**
+      * Verifies that no unexpected warning has been emitted in any test defined in this
class.
+      */
+     @After
+     public void assertNoUnexpectedLog() {
+         loggings.skipNextLogIfContains("sis-temporal");
+         loggings.assertNoUnexpectedLog();
+     }
+ 
+     /**
+      * Tests the (un)marshalling of a metadata with a vertical CRS.
+      *
+      * @throws JAXBException if the (un)marshalling process fails.
+      */
+     @Test
+     public void testMetadataWithVerticalCRS() throws JAXBException {
+         final Metadata metadata = unmarshalFile(Metadata.class, XML_FILE);
 -        assertEquals("fileIdentifier", "20090901",                     metadata.getMetadataIdentifier().getCode());
 -        assertEquals("language",       Locale.ENGLISH,                 getSingleton(metadata.getLocalesAndCharsets().keySet()));
 -        assertEquals("characterSet",   StandardCharsets.UTF_8,         getSingleton(metadata.getLocalesAndCharsets().values()));
 -        assertEquals("dateStamp",      xmlDate("2014-01-04 00:00:00"), getSingleton(metadata.getDateInfo()).getDate());
++        assertEquals("fileIdentifier", "20090901",                     metadata.getFileIdentifier());
++        assertEquals("language",       Locale.ENGLISH,                 metadata.getLanguage());
++        assertEquals("characterSet",   CharacterSet.UTF_8,             metadata.getCharacterSet());
++        assertEquals("dateStamp",      xmlDate("2014-01-04 00:00:00"), metadata.getDateStamp());
+         /*
+          * <gmd:contact>
+          *   <gmd:CI_ResponsibleParty>
+          *     …
+          *   </gmd:CI_ResponsibleParty>
+          * </gmd:contact>
+          */
 -        final Responsibility contact        = getSingleton(metadata   .getContacts());
 -        final Party          party          = getSingleton(contact    .getParties());
 -        final Contact        contactInfo    = getSingleton(party      .getContactInfo());
 -        final OnlineResource onlineResource = getSingleton(contactInfo.getOnlineResources());
 -        assertInstanceOf("party", Organisation.class, party);
++        final ResponsibleParty contact = getSingleton(metadata.getContacts());
++        final OnlineResource onlineResource = contact.getContactInfo().getOnlineResource();
+         assertNotNull("onlineResource", onlineResource);
 -        assertEquals("organisationName", "Apache SIS", party.getName().toString());
++        assertEquals("organisationName", "Apache SIS", contact.getOrganisationName().toString());
+         assertEquals("linkage", URI.create("http://sis.apache.org"), onlineResource.getLinkage());
+         assertEquals("function", OnLineFunction.INFORMATION, onlineResource.getFunction());
+         assertEquals("role", Role.PRINCIPAL_INVESTIGATOR, contact.getRole());
+         /*
+          * <gmd:spatialRepresentationInfo>
+          *   <gmd:MD_VectorSpatialRepresentation>
+          *     …
+          *   </gmd:MD_VectorSpatialRepresentation>
+          * </gmd:spatialRepresentationInfo>
+          */
+         final SpatialRepresentation spatial = getSingleton(metadata.getSpatialRepresentationInfo());
+         assertInstanceOf("spatialRepresentationInfo", VectorSpatialRepresentation.class,
spatial);
+         assertEquals("geometricObjectType", GeometricObjectType.POINT, getSingleton(
+                 ((VectorSpatialRepresentation) spatial).getGeometricObjects()).getGeometricObjectType());
+         /*
+          * <gmd:referenceSystemInfo>
+          *   <gmd:MD_ReferenceSystem>
+          *     …
+          *   </gmd:MD_ReferenceSystem>
+          * </gmd:referenceSystemInfo>
+          */
+         assertIdentifierEquals("referenceSystemInfo", null, "EPSG", null, "World Geodetic
System 84",
+                 getSingleton(metadata.getReferenceSystemInfo()).getName());
+         /*
+          * <gmd:identificationInfo>
+          *   <gmd:MD_DataIdentification>
+          *     …
+          */
+         final DataIdentification identification = (DataIdentification) getSingleton(metadata.getIdentificationInfo());
+         final Citation citation = identification.getCitation();
+         assertInstanceOf("citation", NilObject.class, citation);
+         assertEquals("nilReason", NilReason.MISSING, ((NilObject) citation).getNilReason());
+         assertEquals("abstract", "SIS test", identification.getAbstract().toString());
+         assertEquals("language", Locale.ENGLISH, getSingleton(identification.getLanguages()));
+         /*
+          * <gmd:geographicElement>
+          *   <gmd:EX_GeographicBoundingBox>
+          *     …
+          *   </gmd:EX_GeographicBoundingBox>
+          * </gmd:geographicElement>
+          */
+         final Extent extent = getSingleton(identification.getExtents());
+         final GeographicBoundingBox bbox = (GeographicBoundingBox) getSingleton(extent.getGeographicElements());
+         assertEquals("extentTypeCode", Boolean.TRUE, bbox.getInclusion());
+         assertEquals("westBoundLongitude",  4.55, bbox.getWestBoundLongitude(), STRICT);
+         assertEquals("eastBoundLongitude",  4.55, bbox.getEastBoundLongitude(), STRICT);
+         assertEquals("southBoundLatitude", 44.22, bbox.getSouthBoundLatitude(), STRICT);
+         assertEquals("northBoundLatitude", 44.22, bbox.getNorthBoundLatitude(), STRICT);
+         /*
+          * <gmd:verticalElement>
+          *   <gmd:EX_VerticalExtent>
+          *     …
+          *   </gmd:EX_VerticalExtent>
+          * </gmd:verticalElement>
+          */
+         final VerticalExtent ve = getSingleton(extent.getVerticalElements());
+         assertEquals("minimumValue",   0.1, ve.getMinimumValue(), STRICT);
+         assertEquals("maximumValue", 10000, ve.getMaximumValue(), STRICT);
+         final VerticalCRS crs = ve.getVerticalCRS();
+         verifyIdentifiers("test1", crs);
+         assertEquals("scope", "World", crs.getScope().toString());
+         final VerticalDatum datum = crs.getDatum();
+         verifyIdentifiers("test2", datum);
+         assertEquals("scope", "World", datum.getScope().toString());
+         assertEquals("vertDatumType", VerticalDatumType.DEPTH, datum.getVerticalDatumType());
// Inferred from the name.
+         final VerticalCS cs = crs.getCoordinateSystem();
+         verifyIdentifiers("test3", cs);
+         final CoordinateSystemAxis axis = cs.getAxis(0);
+         verifyIdentifiers("test4", axis);
+         assertEquals("axisAbbrev", "d", axis.getAbbreviation());
+         assertEquals("axisDirection", AxisDirection.DOWN, axis.getDirection());
+         /*
+          *     …
+          *   </gmd:MD_DataIdentification>
+          * </gmd:identificationInfo>
+          *
+          * Now marshal the object and compare with the original file.
+          */
+         assertMarshalEqualsFile(XML_FILE, metadata, VERSION_2007, "xmlns:*", "xsi:schemaLocation");
+     }
+ 
+     /**
+      * Verifies the name and identifier for the given object.
+      *
+      * @param  code    the expected identifier code.
+      * @param  object  the object to verify.
+      */
+     private static void verifyIdentifiers(final String code, final IdentifiedObject object)
{
+         assertIdentifierEquals("identifier", "Apache Spatial Information System", "SIS",
+                 null, code, getSingleton(object.getIdentifiers()));
+         assertIdentifierEquals("name", null, null, null, "Depth", object.getName());
+     }
+ }


Mime
View raw message