sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1555451 - in /sis/branches/JDK7/core/sis-referencing/src: main/java/org/apache/sis/internal/jaxb/referencing/ main/java/org/apache/sis/referencing/ main/java/org/apache/sis/referencing/crs/ main/resources/META-INF/services/ test/java/org/a...
Date Sun, 05 Jan 2014 03:55:56 GMT
Author: desruisseaux
Date: Sun Jan  5 03:55:56 2014
New Revision: 1555451

URL: http://svn.apache.org/r1555451
Log:
Added missing adapter for allowing <gml:verticalCRS> inside ISO 19139 metadata, and
added tests.

Added:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
  (with props)
    sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
  (with props)
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
  (with props)
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
  (with props)
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
  (with props)
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/
    sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml   (with props)
Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java

Added: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
(added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
Sun Jan  5 03:55:56 2014
@@ -0,0 +1,90 @@
+/*
+ * 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.internal.jaxb.referencing;
+
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import org.opengis.referencing.crs.VerticalCRS;
+import org.apache.sis.internal.jaxb.AdapterReplacement;
+import org.apache.sis.referencing.crs.DefaultVerticalCRS;
+
+
+/**
+ * JAXB adapter for {@link VerticalCRS}, in order to integrate the value in an element
+ * complying with OGC/ISO standard. Note that the CRS is formatted using the GML schema,
+ * not the ISO 19139 one.
+ *
+ * @author  Guilhem Legal (Geomatys)
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4 (derived from geotk-3.00)
+ * @version 0.4
+ * @module
+ */
+public final class SC_VerticalCRS extends org.apache.sis.internal.jaxb.gml.SC_VerticalCRS
implements AdapterReplacement {
+    /**
+     * Empty constructor for JAXB only.
+     */
+    public SC_VerticalCRS() {
+    }
+
+    /**
+     * Wraps a Vertical CRS value in a {@code <gml:VerticalCRS>} element at marshalling-time.
+     *
+     * @param crs The value to marshall.
+     */
+    private SC_VerticalCRS(final VerticalCRS crs) {
+        super(crs);
+    }
+
+    /**
+     * Replaces the {@code sis-metadata} adapter by this adapter.
+     */
+    @Override
+    public void register(final Marshaller marshaller) {
+        marshaller.setAdapter(org.apache.sis.internal.jaxb.gml.SC_VerticalCRS.class, this);
+    }
+
+    /**
+     * Replaces the {@code sis-metadata} adapter by this adapter.
+     */
+    @Override
+    public void register(final Unmarshaller unmarshaller) {
+        unmarshaller.setAdapter(org.apache.sis.internal.jaxb.gml.SC_VerticalCRS.class, this);
+    }
+
+    /**
+     * Returns the Vertical CRS value wrapped by a {@code <gml:VerticalCRS>} element.
+     *
+     * @param value The value to marshal.
+     * @return The wrapper for the metadata value.
+     */
+    @Override
+    protected org.apache.sis.internal.jaxb.gml.SC_VerticalCRS wrap(final VerticalCRS value)
{
+        return new SC_VerticalCRS(value);
+    }
+
+    /**
+     * Returns the {@link DefaultVerticalCRS} created from the metadata value.
+     * This method is systematically called at marshalling-time by JAXB.
+     *
+     * @return The CRS to be marshalled.
+     */
+    @Override
+    public Object getElement() {
+        return DefaultVerticalCRS.castOrCopy(metadata);
+    }
+}

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/SC_VerticalCRS.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java?rev=1555451&r1=1555450&r2=1555451&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/CRS.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -81,7 +81,7 @@ public final class CRS extends Static {
      * {@example Apache SIS allows 4-dimensional (<var>x</var>,<var>y</var>,<var>z</var>,<var>t</var>)
      * coordinate reference system to be built in two different ways as shown below:
      *
-     * <table class="compact">
+     * <p><table class="compact">
      * <tr><th>Hierarchical structure</th><th>Flat list</th></tr>
      * <tr><td><blockquote>
      *   <code>CompoundCRS</code> — (<var>x</var>, <var>y</var>,
<var>z</var>, <var>t</var>)<br>
@@ -95,7 +95,7 @@ public final class CRS extends Static {
      *   <code>  ├─VerticalCRS</code> — (<var>z</var>)<br>
      *   <code>  └─TemporalCRS</code> — (<var>t</var>)
      * </blockquote>
-     * </td></tr></table>
+     * </td></tr></table></p>
      *
      * This method guaranteed that the returned list is a flat one as shown on the right
side.
      * Note that such flat lists are the only one allowed by ISO/OGC standards for compound
CRS.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1555451&r1=1555450&r2=1555451&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -47,7 +47,7 @@ import static org.apache.sis.util.Utilit
  * This class is often used for defining 4-dimensional (<var>x</var>,<var>y</var>,<var>z</var>,<var>t</var>)
  * coordinate reference systems as an aggregation of simpler CRS. Below is two examples of
such aggregations:
  *
- * <table class="compact">
+ * <p><table class="compact">
  * <tr><th>Flat list</th><th>Hierarchical structure</th></tr>
  * <tr><td><blockquote>
  *   <code>CompoundCRS</code> — (<var>x</var>, <var>y</var>,
<var>z</var>, <var>t</var>)<br>
@@ -61,7 +61,7 @@ import static org.apache.sis.util.Utilit
  *   <code>  │   └─VerticalCRS</code> — (<var>z</var>)<br>
  *   <code>  └─TemporalCRS</code> — (<var>t</var>)
  * </blockquote></td></tr>
- * </table>
+ * </table></p>
  *
  * Strictly speaking, only the flat list on the left side is allowed by OGC/ISO specifications.
  * However Apache SIS relaxes this rule by allowing hierarchies as shown on the right side.
This

Added: sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
(added)
+++ sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -0,0 +1,2 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.
+org.apache.sis.internal.jaxb.referencing.SC_VerticalCRS

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.AdapterReplacement
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration?rev=1555451&r1=1555450&r2=1555451&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/resources/META-INF/services/org.apache.sis.internal.jaxb.TypeRegistration
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -1 +1,2 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.
 org.apache.sis.internal.referencing.ReferencingTypes

Added: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
(added)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -0,0 +1,76 @@
+/*
+ * 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.internal.jaxb.referencing;
+
+import java.util.Collections;
+import javax.measure.unit.SI;
+import javax.xml.bind.JAXBException;
+import org.apache.sis.referencing.datum.DefaultEllipsoid;
+import org.apache.sis.test.XMLTestCase;
+import org.junit.Test;
+
+import static org.apache.sis.test.Assert.*;
+
+
+/**
+ * Tests {@link SecondDefiningParameter}.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4 (derived from geotk-3.06)
+ * @version 0.4
+ * @module
+ */
+public final strictfp class SecondDefiningParameterTest extends XMLTestCase {
+    /**
+     * The XML to be used for testing purpose.
+     */
+    private static final String XML =
+            "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
+            "<gml:SecondDefiningParameter xmlns:gml=\"http://www.opengis.net/gml/3.2\">\n"
+
+            "  <gml:semiMinorAxis uom=\"urn:ogc:def:uom:EPSG::9001\">6371000.0</gml:semiMinorAxis>\n"
+
+            "</gml:SecondDefiningParameter>";
+
+    /**
+     * Generates a XML tree using the annotations on the {@link SecondDefiningParameter}
class.
+     *
+     * @throws JAXBException If an error occurred during the marshalling process.
+     */
+    @Test
+    public void testMarshalling() throws JAXBException {
+        final DefaultEllipsoid ellipsoid = DefaultEllipsoid.createEllipsoid(Collections.singletonMap(
+                DefaultEllipsoid.NAME_KEY, "Sphere"), 6371000, 6371000, SI.METRE);
+        final SecondDefiningParameter sdp = new SecondDefiningParameter(ellipsoid, false);
+        assertXmlEquals(
+                "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
+                "<gml:SecondDefiningParameter xmlns:gml=\"http://www.opengis.net/gml/3.2\">\n"
+
+                "  <gml:semiMinorAxis uom=\"urn:ogc:def:uom:EPSG::9001\">6371000.0</gml:semiMinorAxis>\n"
+
+                "</gml:SecondDefiningParameter>",
+                marshal(sdp), "xmlns:*", "xsi:schemaLocation");
+    }
+
+    /**
+     * Creates a {@link SecondDefiningParameter} from a XML tree.
+     *
+     * @throws JAXBException If an error occurred during the unmarshalling process.
+     */
+    @Test
+    public void testUnmarshalling() throws JAXBException {
+        final SecondDefiningParameter sdp = unmarshal(SecondDefiningParameter.class, XML);
+        assertEquals(6371000.0, sdp.measure.value, 0);
+        assertEquals(SI.METRE,  sdp.measure.unit);
+    }
+}

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/jaxb/referencing/SecondDefiningParameterTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java?rev=1555451&r1=1555450&r2=1555451&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/datum/DefaultEllipsoidTest.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -41,7 +41,10 @@ import static org.apache.sis.referencing
  * @version 0.4
  * @module
  */
-@DependsOn(org.apache.sis.internal.referencing.FormulasTest.class)
+@DependsOn({
+    org.apache.sis.internal.referencing.FormulasTest.class,
+    org.apache.sis.internal.jaxb.referencing.SecondDefiningParameterTest.class
+})
 public final strictfp class DefaultEllipsoidTest extends XMLTestCase {
     /**
      * An XML file in this package containing an ellipsoid definition.

Added: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
(added)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -0,0 +1,186 @@
+/*
+ * 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 javax.xml.bind.JAXBException;
+import org.opengis.metadata.Metadata;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.metadata.citation.OnLineFunction;
+import org.opengis.metadata.citation.OnlineResource;
+import org.opengis.metadata.citation.ResponsibleParty;
+import org.opengis.metadata.citation.Role;
+import org.opengis.metadata.extent.Extent;
+import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.opengis.metadata.extent.VerticalExtent;
+import org.opengis.metadata.identification.CharacterSet;
+import org.opengis.metadata.identification.DataIdentification;
+import org.opengis.metadata.spatial.GeometricObjectType;
+import org.opengis.metadata.spatial.SpatialRepresentation;
+import org.opengis.metadata.spatial.VectorSpatialRepresentation;
+import org.opengis.referencing.IdentifiedObject;
+import org.opengis.referencing.crs.VerticalCRS;
+import org.opengis.referencing.cs.VerticalCS;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
+import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.datum.VerticalDatum;
+import org.opengis.referencing.datum.VerticalDatumType;
+import org.apache.sis.xml.NilObject;
+import org.apache.sis.xml.NilReason;
+import org.apache.sis.test.XMLTestCase;
+import org.junit.Test;
+
+import static org.apache.sis.test.Assert.*;
+import static org.apache.sis.test.TestUtilities.getSingleton;
+
+
+/**
+ * Tests XML (un)marshalling of referencing object inside metadata.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4
+ * @version 0.4
+ * @module
+ */
+public final strictfp class ReferencingInMetadataTest extends XMLTestCase {
+    /**
+     * Tolerance threshold for strict floating point comparisons.
+     */
+    private static final double STRICT = 0;
+
+    /**
+     * The resource file which contains an XML representation
+     * of a {@link Metadata} object with a {@link VerticalCRS}.
+     */
+    private static final String VERTICAL_CRS_XML = "Metadata with vertical CRS.xml";
+
+    /**
+     * 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, VERTICAL_CRS_XML);
+        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 ResponsibleParty contact = getSingleton(metadata.getContacts());
+        final OnlineResource onlineResource = contact.getContactInfo().getOnlineResource();
+        assertNotNull("onlineResource", onlineResource);
+        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, ignoring gml:id for
now.
+         */
+        assertMarshalEqualsFile(VERTICAL_CRS_XML, metadata, "xmlns:*", "xsi:schemaLocation",
"gml:id");
+    }
+
+    /**
+     * 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", "SIS", "SIS", null, code, getSingleton(object.getIdentifiers()));
+        assertIdentifierEquals("name", null, null, null, "Depth", object.getName());
+    }
+}

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ReferencingInMetadataTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
(added)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -0,0 +1,27 @@
+/*
+ * 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.
+ */
+
+
+/**
+ * Tests the integration between two ore more SIS modules.
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.4
+ * @version 0.4
+ * @module
+ */
+package org.apache.sis.test.integration;

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/integration/package-info.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1555451&r1=1555450&r2=1555451&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
[UTF-8] Sun Jan  5 03:55:56 2014
@@ -49,6 +49,7 @@ import org.junit.BeforeClass;
     org.apache.sis.io.wkt.SymbolsTest.class,
     org.apache.sis.io.wkt.FormatterTest.class,
     org.apache.sis.internal.jaxb.referencing.CodeTest.class,
+    org.apache.sis.internal.jaxb.referencing.SecondDefiningParameterTest.class,
     org.apache.sis.referencing.IdentifiedObjectsTest.class,
     org.apache.sis.referencing.NamedIdentifierTest.class,
     org.apache.sis.referencing.AbstractIdentifiedObjectTest.class,
@@ -76,7 +77,9 @@ import org.junit.BeforeClass;
     org.apache.sis.geometry.GeneralEnvelopeTest.class,
     org.apache.sis.geometry.SubEnvelopeTest.class,
     org.apache.sis.geometry.ImmutableEnvelopeTest.class,
-    org.apache.sis.geometry.Envelope2DTest.class
+    org.apache.sis.geometry.Envelope2DTest.class,
+
+    org.apache.sis.test.integration.ReferencingInMetadataTest.class
 })
 public final strictfp class ReferencingTestSuite extends TestSuite {
     /**

Added: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata%20with%20vertical%20CRS.xml?rev=1555451&view=auto
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml (added)
+++ sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml Sun Jan  5 03:55:56 2014
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+
+<gmd:MD_Metadata
+        xmlns:gco = "http://www.isotc211.org/2005/gco"
+        xmlns:gmd = "http://www.isotc211.org/2005/gmd"
+        xmlns:gml = "http://www.opengis.net/gml/3.2"
+        xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
+        xsi:schemaLocation = "http://www.opengis.net/gml/3.2   http://schemas.opengis.net/gml/3.2.1/datums.xsd
+                              http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd">
+  <gmd:fileIdentifier>
+    <gco:CharacterString>20090901</gco:CharacterString>
+  </gmd:fileIdentifier>
+  <gmd:language>
+    <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="eng">English</gmd:LanguageCode>
+  </gmd:language>
+  <gmd:characterSet>
+    <gmd:MD_CharacterSetCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
codeListValue="utf8">UTF-8</gmd:MD_CharacterSetCode>
+  </gmd:characterSet>
+  <gmd:contact>
+    <gmd:CI_ResponsibleParty>
+      <gmd:organisationName>
+        <gco:CharacterString>Apache SIS</gco:CharacterString>
+      </gmd:organisationName>
+      <gmd:contactInfo>
+        <gmd:CI_Contact>
+          <gmd:onlineResource>
+            <gmd:CI_OnlineResource>
+              <gmd:linkage>
+                <gmd:URL>http://sis.apache.org</gmd:URL>
+              </gmd:linkage>
+              <gmd:function>
+                <gmd:CI_OnLineFunctionCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_OnLineFunctionCode"
codeListValue="information" codeSpace="eng">Information</gmd:CI_OnLineFunctionCode>
+              </gmd:function>
+            </gmd:CI_OnlineResource>
+          </gmd:onlineResource>
+        </gmd:CI_Contact>
+      </gmd:contactInfo>
+      <gmd:role>
+        <gmd:CI_RoleCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode"
codeListValue="principalInvestigator">Principal investigator</gmd:CI_RoleCode>
+      </gmd:role>
+    </gmd:CI_ResponsibleParty>
+  </gmd:contact>
+  <gmd:dateStamp>
+   <gco:Date>2014-01-04</gco:Date>
+  </gmd:dateStamp>
+  <gmd:spatialRepresentationInfo>
+    <gmd:MD_VectorSpatialRepresentation>
+      <gmd:geometricObjects>
+        <gmd:MD_GeometricObjects>
+          <gmd:geometricObjectType>
+            <gmd:MD_GeometricObjectTypeCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#MD_GeometricObjectTypeCode"
codeListValue="point">Point</gmd:MD_GeometricObjectTypeCode>
+          </gmd:geometricObjectType>
+        </gmd:MD_GeometricObjects>
+      </gmd:geometricObjects>
+    </gmd:MD_VectorSpatialRepresentation>
+  </gmd:spatialRepresentationInfo>
+  <gmd:referenceSystemInfo>
+    <gmd:MD_ReferenceSystem>
+      <gmd:referenceSystemIdentifier>
+        <gmd:RS_Identifier>
+          <gmd:code>
+            <gco:CharacterString>World Geodetic System 84</gco:CharacterString>
+          </gmd:code>
+          <gmd:codeSpace>
+            <gco:CharacterString>EPSG</gco:CharacterString>
+          </gmd:codeSpace>
+        </gmd:RS_Identifier>
+      </gmd:referenceSystemIdentifier>
+    </gmd:MD_ReferenceSystem>
+  </gmd:referenceSystemInfo>
+  <gmd:identificationInfo>
+    <gmd:MD_DataIdentification>
+      <gmd:citation gco:nilReason="missing"/>
+      <gmd:abstract>
+        <gco:CharacterString>SIS test</gco:CharacterString>
+      </gmd:abstract>
+      <gmd:language>
+        <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="eng">English</gmd:LanguageCode>
+      </gmd:language>
+      <gmd:extent>
+        <gmd:EX_Extent>
+          <gmd:geographicElement>
+            <gmd:EX_GeographicBoundingBox>
+              <gmd:extentTypeCode>     <gco:Boolean> true</gco:Boolean>
</gmd:extentTypeCode>
+              <gmd:westBoundLongitude> <gco:Decimal> 4.55</gco:Decimal>
</gmd:westBoundLongitude>
+              <gmd:eastBoundLongitude> <gco:Decimal> 4.55</gco:Decimal>
</gmd:eastBoundLongitude>
+              <gmd:southBoundLatitude> <gco:Decimal>44.22</gco:Decimal>
</gmd:southBoundLatitude>
+              <gmd:northBoundLatitude> <gco:Decimal>44.22</gco:Decimal>
</gmd:northBoundLatitude>
+            </gmd:EX_GeographicBoundingBox>
+          </gmd:geographicElement>
+          <gmd:verticalElement>
+            <gmd:EX_VerticalExtent>
+              <gmd:minimumValue> <gco:Real>  0.1</gco:Real> </gmd:minimumValue>
+              <gmd:maximumValue> <gco:Real>10000</gco:Real> </gmd:maximumValue>
+              <gmd:verticalCRS>
+                <gml:VerticalCRS gml:id="crs-depth">
+                  <gml:identifier codeSpace="SIS">urn:ogc:def:crs:SIS::test1</gml:identifier>
+                  <gml:name>Depth</gml:name>
+                  <gml:scope>World</gml:scope>
+                  <gml:verticalCS>
+                    <gml:VerticalCS gml:id="cs-depth">
+                      <gml:identifier codeSpace="SIS">urn:ogc:def:cs:SIS::test3</gml:identifier>
+                      <gml:name>Depth</gml:name>
+                      <gml:axis>
+                        <gml:CoordinateSystemAxis uom="urn:ogc:def:uom:EPSG::9001" gml:id="axis-depth">
+                          <gml:identifier codeSpace="SIS">urn:ogc:def:axis:SIS::test4</gml:identifier>
+                          <gml:name>Depth</gml:name>
+                          <gml:axisAbbrev>d</gml:axisAbbrev>
+                          <gml:axisDirection codeSpace="EPSG">down</gml:axisDirection>
+                        </gml:CoordinateSystemAxis>
+                      </gml:axis>
+                    </gml:VerticalCS>
+                  </gml:verticalCS>
+                  <gml:verticalDatum>
+                    <gml:VerticalDatum gml:id="datum-depth">
+                      <gml:identifier codeSpace="SIS">urn:ogc:def:datum:SIS::test2</gml:identifier>
+                      <gml:name>Depth</gml:name>
+                      <gml:scope>World</gml:scope>
+                    </gml:VerticalDatum>
+                  </gml:verticalDatum>
+                </gml:VerticalCRS>
+              </gmd:verticalCRS>
+            </gmd:EX_VerticalExtent>
+          </gmd:verticalElement>
+        </gmd:EX_Extent>
+      </gmd:extent>
+    </gmd:MD_DataIdentification>
+  </gmd:identificationInfo>
+</gmd:MD_Metadata>

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata
with vertical CRS.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message