sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1707573 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/internal/metadata/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/ sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ sis-metadata/src/ma...
Date Thu, 08 Oct 2015 15:48:59 GMT
Author: desruisseaux
Date: Thu Oct  8 15:48:59 2015
New Revision: 1707573

URL: http://svn.apache.org/viewvc?rev=1707573&view=rev
Log:
Support xlink:href="#foo" in ISO 19139 documents too.

Added:
    sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/
    sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
  (with props)
Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
    sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml
    sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
    sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -18,11 +18,15 @@ package org.apache.sis.internal.metadata
 
 import java.util.Date;
 import org.apache.sis.xml.NilReason;
+import org.apache.sis.xml.IdentifierSpace;
+import org.apache.sis.xml.IdentifiedObject;
 import org.apache.sis.util.Static;
+import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.metadata.InvalidMetadataException;
 import org.apache.sis.internal.jaxb.PrimitiveTypeProperties;
 import org.apache.sis.internal.jaxb.Context;
+import org.apache.sis.internal.util.Utilities;
 
 
 /**
@@ -30,7 +34,7 @@ import org.apache.sis.internal.jaxb.Cont
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3
- * @version 0.6
+ * @version 0.7
  * @module
  */
 public final class MetadataUtilities extends Static {
@@ -170,4 +174,58 @@ public final class MetadataUtilities ext
             return null;
         }
     }
+
+    /**
+     * Returns the {@code gco:id} or {@code gml:id} value to use for the given object.
+     * The returned identifier will be unique in the current XML document.
+     *
+     * @param  object The object for which to get the unique identifier.
+     * @return The unique XML identifier, or {@code null} if none.
+     *
+     * @since 0.7
+     */
+    public static String getObjectID(final IdentifiedObject object) {
+        final Context context = Context.current();
+        String id = Context.getObjectID(context, object);
+        if (id == null) {
+            id = object.getIdentifierMap().getSpecialized(IdentifierSpace.ID);
+            if (id != null) {
+                final StringBuilder buffer = new StringBuilder();
+                if (!Utilities.appendUnicodeIdentifier(buffer, (char) 0, id, ":-", false))
{
+                    return null;
+                }
+                id = buffer.toString();
+                if (!Context.setObjectForID(context, object, id)) {
+                    final int s = buffer.append('-').length();
+                    int n = 0;
+                    do {
+                        if (++n == 100) return null;    //  Arbitrary limit.
+                        id = buffer.append(n).toString();
+                        buffer.setLength(s);
+                    } while (!Context.setObjectForID(context, object, id));
+                }
+            }
+        }
+        return id;
+    }
+
+    /**
+     * Invoked by {@code setID(String)} method implementations for assigning an identifier
to an object
+     * at unmarshalling time.
+     *
+     * @param object The object for which to assign an identifier.
+     * @param id The {@code gco:id} or {@code gml:id} value.
+     *
+     * @since 0.7
+     */
+    public static void setObjectID(final IdentifiedObject object, String id) {
+        id = CharSequences.trimWhitespaces(id);
+        if (id != null && !id.isEmpty()) {
+            object.getIdentifierMap().putSpecialized(IdentifierSpace.ID, id);
+            final Context context = Context.current();
+            if (!Context.setObjectForID(context, object, id)) {
+                Context.warningOccured(context, object.getClass(), "setID", Errors.class,
Errors.Keys.DuplicatedIdentifier_1, id);
+            }
+        }
+    }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -31,9 +31,9 @@ import org.apache.sis.metadata.MetadataS
 import org.apache.sis.metadata.ModifiableMetadata;
 import org.apache.sis.internal.jaxb.IdentifierMapAdapter;
 import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
+import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.internal.util.Utilities;
 import org.apache.sis.util.collection.Containers;
-import org.apache.sis.util.CharSequences;
 
 import static org.apache.sis.util.collection.Containers.isNullOrEmpty;
 
@@ -184,18 +184,15 @@ public class ISOMetadata extends Modifia
     @XmlAttribute  // Defined in "gco" as unqualified attribute.
     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
     private String getID() {
-        return isNullOrEmpty(identifiers) ? null : getIdentifierMap().getSpecialized(IdentifierSpace.ID);
+        return isNullOrEmpty(identifiers) ? null : MetadataUtilities.getObjectID(this);
     }
 
     /**
      * Sets an identifier unique for the XML document.
      * This method is invoked automatically by JAXB and should never be invoked explicitely.
      */
-    private void setID(String id) {
-        id = CharSequences.trimWhitespaces(id);
-        if (id != null && !id.isEmpty()) {
-            getIdentifierMap().putSpecialized(IdentifierSpace.ID, id);
-        }
+    private void setID(final String id) {
+        MetadataUtilities.setObjectID(this, id);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/package-info.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -87,7 +87,7 @@
  * @author  Touraïvane (IRD)
  * @author  Cédric Briançon (Geomatys)
  * @since   0.3
- * @version 0.5
+ * @version 0.7
  * @module
  */
 @XmlSchema(elementFormDefault = XmlNsForm.QUALIFIED, namespace = Namespaces.GMD, xmlns =
{

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultRepresentativeFraction.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -30,12 +30,12 @@ import org.apache.sis.metadata.Unmodifia
 import org.apache.sis.internal.jaxb.ModifiableIdentifierMap;
 import org.apache.sis.internal.jaxb.IdentifierMapAdapter;
 import org.apache.sis.internal.jaxb.gco.GO_Integer64;
+import org.apache.sis.internal.metadata.MetadataUtilities;
 import org.apache.sis.internal.util.CheckedArrayList;
 import org.apache.sis.measure.ValueRange;
 import org.apache.sis.xml.IdentifierMap;
 import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.xml.IdentifiedObject;
-import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Emptiable;
 import org.apache.sis.util.resources.Errors;
@@ -396,7 +396,7 @@ public class DefaultRepresentativeFracti
     @XmlAttribute  // Defined in "gco" as unqualified attribute.
     @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
     private String getID() {
-        return isNullOrEmpty(identifiers) ? null : getIdentifierMap().getSpecialized(IdentifierSpace.ID);
+        return isNullOrEmpty(identifiers) ? null : MetadataUtilities.getObjectID(this);
     }
 
     /**
@@ -405,10 +405,7 @@ public class DefaultRepresentativeFracti
      * @see org.apache.sis.metadata.iso.ISOMetadata#setID(String)
      */
     private void setID(String id) {
-        id = CharSequences.trimWhitespaces(id);
-        if (id != null && !id.isEmpty()) {
-            getIdentifierMap().putSpecialized(IdentifierSpace.ID, id);
-        }
+        MetadataUtilities.setObjectID(this, id);
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -46,17 +46,10 @@ import static org.apache.sis.test.TestUt
 
 
 /**
- * Tests XML (un)marshalling of various metadata objects.
- * For every metadata objects tested by this class, the expected XML representation
- * is provided by {@code *.xml} files in the following directory:
+ * Tests {@link DefaultMetadata}, without Coordinate Reference System (CRS) information.
  *
- * <ul>
- *   <li>{@code "core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso"}</li>
- * </ul>
- *
- * Metadata tested by this class do not include Coordinate Reference System (CRS) information.
A metadata
- * object with CRS information is tested by {@code org.apache.sis.test.integration.DefaultMetadataTest}
- * in the {@code sis-referencing} module.
+ * <p><b>Note:</b> a metadata object with CRS information is tested by
a different
+ * {@code org.apache.sis.test.integration.DefaultMetadataTest} class in the {@code sis-referencing}
module.</p>
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/citation/DefaultCitationTest.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -19,22 +19,30 @@ package org.apache.sis.metadata.iso.cita
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Iterator;
 import java.util.Locale;
+import javax.xml.bind.JAXBException;
 import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.CitationDate;
+import org.opengis.metadata.citation.Contact;
+import org.opengis.metadata.citation.DateType;
+import org.opengis.metadata.citation.Party;
 import org.opengis.metadata.citation.Role;
 import org.opengis.metadata.citation.Responsibility;
 import org.opengis.metadata.citation.PresentationForm;
 import org.apache.sis.internal.util.CollectionsExt;
 import org.apache.sis.xml.IdentifierMap;
+import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.metadata.iso.DefaultIdentifier;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.util.iso.DefaultInternationalString;
-import org.apache.sis.test.TestCase;
+import org.apache.sis.test.TestUtilities;
+import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
 import static org.apache.sis.test.TestUtilities.getSingleton;
-import static org.junit.Assert.*;
+import static org.apache.sis.test.MetadataAssert.*;
 
 
 /**
@@ -45,7 +53,12 @@ import static org.junit.Assert.*;
  * @version 0.7
  * @module
  */
-public final strictfp class DefaultCitationTest extends TestCase {
+public final strictfp class DefaultCitationTest extends XMLTestCase {
+    /**
+     * An XML file in this package containing a citation.
+     */
+    private static final String XML_FILE = "Citation.xml";
+
     /**
      * Creates a citation with an arbitrary title, presentation form and other properties.
      *
@@ -159,4 +172,62 @@ public final strictfp class DefaultCitat
             // This is the expected exception.
         }
     }
+
+    /**
+     * Tests XML marshalling using the format derived form ISO 19115:2003 model.
+     * This method also tests usage of {@code gml:id} and {@code xlink:href}.
+     *
+     * @throws JAXBException if an error occurred during marshalling.
+     *
+     * @since 0.7
+     */
+    @Test
+    public void testMarshalling() throws JAXBException {
+        final DefaultContact contact = new DefaultContact();
+        contact.setContactInstructions(new SimpleInternationalString("Send carrier pigeon."));
+        contact.getIdentifierMap().putSpecialized(IdentifierSpace.ID, "ip-protocol");
+        final DefaultCitation c = new DefaultCitation("Fight against poverty");
+        c.setCitedResponsibleParties(Arrays.asList(
+                new DefaultResponsibility(Role.ORIGINATOR, null, new DefaultIndividual("Maid
Marian", null, contact)),
+                new DefaultResponsibility(Role.FUNDER,     null, new DefaultIndividual("Robin
Hood",  null, contact))
+        ));
+        c.getDates().add(new DefaultCitationDate(TestUtilities.date("2015-10-17 00:00:00"),
DateType.ADOPTED));
+        assertMarshalEqualsFile(XML_FILE, c, "xlmns:*", "xsi:schemaLocation");
+    }
+
+    /**
+     * Tests XML unmarshalling using the format derived form ISO 19115:2003 model.
+     * This method also tests usage of {@code gml:id} and {@code xlink:href}.
+     *
+     * @throws JAXBException if an error occurred during unmarshalling.
+     *
+     * @since 0.7
+     */
+    @Test
+    public void testUnmarshalling() throws JAXBException {
+        final DefaultCitation c = unmarshalFile(DefaultCitation.class, XML_FILE);
+        assertTitleEquals("title", "Fight against poverty", c);
+
+        final CitationDate date = getSingleton(c.getDates());
+        assertEquals("date", date.getDate(), TestUtilities.date("2015-10-17 00:00:00"));
+        assertEquals("dateType", date.getDateType(), DateType.ADOPTED);
+
+        final Iterator<Responsibility> it = c.getCitedResponsibleParties().iterator();
+        final Contact contact = assertResponsibilityEquals(Role.ORIGINATOR, "Maid Marian",
it.next());
+        assertEquals("Contact instruction", "Send carrier pigeon.", contact.getContactInstructions().toString());
+
+        // Thanks to xlink:href, the Contact shall be the same instance than above.
+        assertSame("contact", contact, assertResponsibilityEquals(Role.FUNDER, "Robin Hood",
it.next()));
+        assertFalse(it.hasNext());
+    }
+
+    /**
+     * Asserts that the given responsibility has the expected properties, then returns its
contact info.
+     */
+    private static Contact assertResponsibilityEquals(final Role role, final String name,
final Responsibility actual) {
+        assertEquals("role", role, actual.getRole());
+        final Party p = getSingleton(actual.getParties());
+        assertEquals("name", name, p.getName().toString());
+        return getSingleton(p.getContactInfo());
+    }
 }

Modified: sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultGeographicBoundingBoxTest.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -62,6 +62,7 @@ public final strictfp class DefaultGeogr
     /**
      * Tests construction with an invalid range of latitudes.
      */
+    @SuppressWarnings("ResultOfObjectAllocationIgnored")
     @Test(expected = IllegalArgumentException.class)
     public void testInvalidLatitudeRange() {
         new DefaultGeographicBoundingBox(-1, +1, 12, 10);

Added: sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml?rev=1707573&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
(added)
+++ sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
Thu Oct  8 15:48:59 2015
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  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:CI_Citation
+    xmlns:gco          = "http://www.isotc211.org/2005/gco"
+    xmlns:gmd          = "http://www.isotc211.org/2005/gmd"
+    xmlns:xsi          = "http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:xlink        = "http://www.w3.org/1999/xlink"
+    xsi:schemaLocation = "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd">
+
+  <gmd:title>
+    <gco:CharacterString>Fight against poverty</gco:CharacterString>
+  </gmd:title>
+  <gmd:date>
+    <gmd:CI_Date>
+      <gmd:date>
+        <!-- International Day for the Eradication of Poverty -->
+        <gco:DateTime>2015-10-17T02:00:00+02:00</gco:DateTime>
+      </gmd:date>
+      <gmd:dateType>
+        <gmd:CI_DateTypeCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode"
+                             codeListValue="adopted">Adopted</gmd:CI_DateTypeCode>
+      </gmd:dateType>
+    </gmd:CI_Date>
+  </gmd:date>
+  <gmd:citedResponsibleParty>
+    <gmd:CI_ResponsibleParty>
+      <gmd:individualName>
+        <gco:CharacterString>Maid Marian</gco:CharacterString>
+      </gmd:individualName>
+      <gmd:contactInfo>
+        <gmd:CI_Contact id="ip-protocol">
+          <gmd:contactInstructions>
+            <gco:CharacterString>Send carrier pigeon.</gco:CharacterString>
+          </gmd:contactInstructions>
+        </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="originator">Originator</gmd:CI_RoleCode>
+      </gmd:role>
+    </gmd:CI_ResponsibleParty>
+  </gmd:citedResponsibleParty>
+  <gmd:citedResponsibleParty>
+    <gmd:CI_ResponsibleParty>
+      <gmd:individualName>
+        <gco:CharacterString>Robin Hood</gco:CharacterString>
+      </gmd:individualName>
+      <gmd:contactInfo xlink:href="#ip-protocol"/>
+      <gmd:role>
+        <gmd:CI_RoleCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode"
+                         codeListValue="funder">Funder</gmd:CI_RoleCode>
+      </gmd:role>
+    </gmd:CI_ResponsibleParty>
+  </gmd:citedResponsibleParty>
+</gmd:CI_Citation>

Propchange: sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml
Thu Oct  8 15:48:59 2015
@@ -25,9 +25,10 @@
     xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation = "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd">
 
-  <!-- As of February 2011, there is not yet any XSD schema for the "gmi" namespace on
the
-       OGC web site. Consequently the validation of this file does not work fully yet. -->
-
+  <!--
+    As of February 2011, there is not yet any XSD schema for the "gmi" namespace on the
+    OGC web site. Consequently the validation of this file does not work fully yet.
+  -->
   <gmd:description>
     <gco:CharacterString>Some process step.</gco:CharacterString>
   </gmd:description>

Modified: sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml
(original)
+++ sis/branches/JDK8/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml
Thu Oct  8 15:48:59 2015
@@ -24,10 +24,11 @@
     xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation = "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd">
 
-  <!-- The <nameOfMeasure> element below is the main purpose of MetadataMarshallingTest.testPositionalAccuracy().
-       The <result> element was added only in order to allow validation of this XML
file, with the addition of an
-       opportunist check of xsi:type declaration. -->
-
+  <!--
+    The <nameOfMeasure> element below is the main purpose of MetadataMarshallingTest.testPositionalAccuracy().
+    The <result> element was added only in order to allow validation of this XML file,
with the addition of an
+    opportunist check of xsi:type declaration.
+  -->
   <gmd:nameOfMeasure xsi:type="gmd:PT_FreeText_PropertyType">
     <gco:CharacterString>Quantitative quality measure focusing on the effective class
percent regarded to the total surface size</gco:CharacterString>
     <gmd:PT_FreeText>
@@ -37,8 +38,10 @@
     </gmd:PT_FreeText>
   </gmd:nameOfMeasure>
   <gmd:result>
-    <!-- The xsi:type declaration below is useless, but we put it
-         in order to test that it does not break unmarshalling. -->
+    <!--
+      The xsi:type declaration below is useless, but we put it
+      in order to test that it does not break unmarshalling.
+    -->
     <gmd:DQ_ConformanceResult xsi:type="gmd:DQ_ConformanceResult_Type">
       <gmd:specification>
         <gmd:CI_Citation>

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/test/integration/DefaultMetadataTest.java
[UTF-8] Thu Oct  8 15:48:59 2015
@@ -20,6 +20,7 @@ import java.net.URI;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Locale;
+import java.util.Collections;
 import java.io.StringWriter;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
@@ -54,6 +55,7 @@ import org.apache.sis.util.iso.SimpleInt
 import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.xml.MarshallerPool;
+import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.test.TestUtilities;
 import org.apache.sis.test.XMLComparator;
 import org.apache.sis.test.XMLTestCase;
@@ -75,7 +77,7 @@ import java.nio.charset.StandardCharsets
  * @author  Guilhem Legal (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.5
- * @version 0.5
+ * @version 0.7
  * @module
  *
  * @see org.apache.sis.metadata.iso.DefaultMetadataTest
@@ -121,6 +123,7 @@ public strictfp class DefaultMetadataTes
             final DefaultOnlineResource online = new DefaultOnlineResource(URI.create("http://www.ifremer.fr/sismer/"));
             online.setProtocol("http");
             final DefaultContact contact = new DefaultContact(online);
+            contact.getIdentifierMap().putSpecialized(IdentifierSpace.ID, "IFREMER");
             contact.setPhones(Arrays.asList(
                     new DefaultTelephone("+33 (0)2 xx.xx.xx.x6", TelephoneType.VOICE),
                     new DefaultTelephone("+33 (0)2 xx.xx.xx.x4", TelephoneType.FACSIMILE)
@@ -132,7 +135,7 @@ public strictfp class DefaultMetadataTes
             address.setCountry(country);
             address.setElectronicMailAddresses(singleton("xx@xx.fr"));
             contact.setAddresses(singleton(address));
-            author.setParties(Arrays.asList(
+            author.setParties(Collections.singleton(
                     new DefaultOrganisation("Marine institutes", null, null, contact)
             ));
             metadata.setContacts(singleton(author));
@@ -162,7 +165,7 @@ public strictfp class DefaultMetadataTes
                 address.setPostalCode("13288");
                 address.setCountry(country);
                 contact.setAddresses(singleton(address));
-                originator.setParties(Arrays.asList(
+                originator.setParties(Collections.singleton(
                         new DefaultOrganisation("Oceanology laboratory", null, null, contact)
                 ));
                 citation.setCitedResponsibleParties(singleton(originator));
@@ -199,7 +202,7 @@ public strictfp class DefaultMetadataTes
             {
                 final DefaultBrowseGraphic g = new DefaultBrowseGraphic(URI.create("file:///thumbnail.png"));
                 g.setFileDescription(new SimpleInternationalString("Arbitrary thumbnail for
this test only."));
-                identification.setGraphicOverviews(Arrays.asList(g));
+                identification.setGraphicOverviews(Collections.singleton(g));
             }
             /*
              * Data indentification / Resource constraint.

Modified: sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml?rev=1707573&r1=1707572&r2=1707573&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
(original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/org/apache/sis/test/integration/Metadata.xml
Thu Oct  8 15:48:59 2015
@@ -49,7 +49,7 @@
         <gco:CharacterString>Marine institutes</gco:CharacterString>
       </gmd:organisationName>
       <gmd:contactInfo>
-        <gmd:CI_Contact>
+        <gmd:CI_Contact id="IFREMER">
           <gmd:phone>
             <gmd:CI_Telephone>
               <gmd:voice>
@@ -254,49 +254,7 @@
           <gmd:organisationName>
             <gco:CharacterString>Marine institutes</gco:CharacterString>
           </gmd:organisationName>
-          <gmd:contactInfo>
-            <gmd:CI_Contact>
-              <gmd:phone>
-                <gmd:CI_Telephone>
-                  <gmd:voice>
-                    <gco:CharacterString>+33 (0)2 xx.xx.xx.x6</gco:CharacterString>
-                  </gmd:voice>
-                  <gmd:facsimile>
-                    <gco:CharacterString>+33 (0)2 xx.xx.xx.x4</gco:CharacterString>
-                  </gmd:facsimile>
-                </gmd:CI_Telephone>
-              </gmd:phone>
-              <gmd:address>
-                <gmd:CI_Address>
-                  <gmd:deliveryPoint>
-                    <gco:CharacterString>Brest institute</gco:CharacterString>
-                  </gmd:deliveryPoint>
-                  <gmd:city>
-                    <gco:CharacterString>Plouzane</gco:CharacterString>
-                  </gmd:city>
-                  <gmd:postalCode>
-                    <gco:CharacterString>29280</gco:CharacterString>
-                  </gmd:postalCode>
-                  <gmd:country>
-                    <gmx:Anchor xlink:href="SDN:C320:2:FR">France</gmx:Anchor>
-                  </gmd:country>
-                  <gmd:electronicMailAddress>
-                    <gco:CharacterString>xx@xx.fr</gco:CharacterString>
-                  </gmd:electronicMailAddress>
-                </gmd:CI_Address>
-              </gmd:address>
-              <gmd:onlineResource>
-                <gmd:CI_OnlineResource>
-                  <gmd:linkage>
-                    <gmd:URL>http://www.ifremer.fr/sismer/</gmd:URL>
-                  </gmd:linkage>
-                  <gmd:protocol>
-                    <gco:CharacterString>http</gco:CharacterString>
-                  </gmd:protocol>
-                </gmd:CI_OnlineResource>
-              </gmd:onlineResource>
-            </gmd:CI_Contact>
-          </gmd:contactInfo>
+          <gmd:contactInfo xlink:href="#IFREMER"/>
           <gmd:role>
             <gmd:CI_RoleCode codeListValue="custodian" codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode">Custodian</gmd:CI_RoleCode>
           </gmd:role>
@@ -482,49 +440,7 @@
               <gmd:organisationName>
                 <gco:CharacterString>Marine institutes</gco:CharacterString>
               </gmd:organisationName>
-              <gmd:contactInfo>
-                <gmd:CI_Contact>
-                  <gmd:phone>
-                    <gmd:CI_Telephone>
-                      <gmd:voice>
-                        <gco:CharacterString>+33 (0)2 xx.xx.xx.x6</gco:CharacterString>
-                      </gmd:voice>
-                      <gmd:facsimile>
-                        <gco:CharacterString>+33 (0)2 xx.xx.xx.x4</gco:CharacterString>
-                      </gmd:facsimile>
-                    </gmd:CI_Telephone>
-                  </gmd:phone>
-                  <gmd:address>
-                    <gmd:CI_Address>
-                      <gmd:deliveryPoint>
-                        <gco:CharacterString>Brest institute</gco:CharacterString>
-                      </gmd:deliveryPoint>
-                      <gmd:city>
-                        <gco:CharacterString>Plouzane</gco:CharacterString>
-                      </gmd:city>
-                      <gmd:postalCode>
-                        <gco:CharacterString>29280</gco:CharacterString>
-                      </gmd:postalCode>
-                      <gmd:country>
-                        <gmx:Anchor xlink:href="SDN:C320:2:FR">France</gmx:Anchor>
-                      </gmd:country>
-                      <gmd:electronicMailAddress>
-                        <gco:CharacterString>xx@xx.fr</gco:CharacterString>
-                      </gmd:electronicMailAddress>
-                    </gmd:CI_Address>
-                  </gmd:address>
-                  <gmd:onlineResource>
-                    <gmd:CI_OnlineResource>
-                      <gmd:linkage>
-                        <gmd:URL>http://www.ifremer.fr/sismer/</gmd:URL>
-                      </gmd:linkage>
-                      <gmd:protocol>
-                        <gco:CharacterString>http</gco:CharacterString>
-                      </gmd:protocol>
-                    </gmd:CI_OnlineResource>
-                  </gmd:onlineResource>
-                </gmd:CI_Contact>
-              </gmd:contactInfo>
+              <gmd:contactInfo xlink:href="#IFREMER"/>
               <gmd:role>
                 <gmd:CI_RoleCode codeListValue="distributor" codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode">Distributor</gmd:CI_RoleCode>
               </gmd:role>



Mime
View raw message