sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1821118 - in /sis/branches/ISO-19115-3/core: sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/ sis-metadata/src/test/resources/org/apache/sis/internal/ sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/ sis-metadata/...
Date Sun, 14 Jan 2018 21:52:33 GMT
Author: desruisseaux
Date: Sun Jan 14 21:52:33 2018
New Revision: 1821118

URL: http://svn.apache.org/viewvc?rev=1821118&view=rev
Log:
Upgrade PT_Locale and Debug PT_LocaleTest.

Added:
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales
(legacy).xml
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales.xml
Modified:
    sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
    sis/branches/ISO-19115-3/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
    sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
    sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
    sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java

Modified: sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java?rev=1821118&r1=1821117&r2=1821118&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/java/org/apache/sis/internal/jaxb/code/PT_LocaleTest.java
[UTF-8] Sun Jan 14 21:52:33 2018
@@ -19,9 +19,9 @@ package org.apache.sis.internal.jaxb.cod
 import java.util.Arrays;
 import java.util.Locale;
 import javax.xml.bind.JAXBException;
+import org.apache.sis.util.Version;
 import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.internal.jaxb.Schemas;
-import org.apache.sis.xml.Namespaces;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 import org.apache.sis.test.XMLTestCase;
 import org.junit.Test;
 
@@ -32,28 +32,13 @@ import static org.apache.sis.test.Assert
  * Tests the XML marshaling of {@link PT_Locale}.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.4
+ * @author  Cullen Rombach (Image Matters)
+ * @version 1.0
  * @since   0.4
  * @module
  */
 public final strictfp class PT_LocaleTest extends XMLTestCase {
     /**
-     * The path to the {@code gmxCodelists.xml} path.
-     */
-    private static final String CODELISTS_PATH = Schemas.METADATA_ROOT + Schemas.CODELISTS_PATH;
-
-    /**
-     * The {@code <gmd:characterEncoding>} element to be repeated for every locale.
This element is not
-     * of interest for this test. In current Apache SIS implementation, it is totally redundant
with the
-     * encoding declared in the XML header. Unfortunately those elements are mandatory according
OGC/ISO
-     * schemas, so we have to carry their weight.
-     */
-    private static final String ENCODING =
-            "      <gmd:characterEncoding>\n" +
-            "        <gmd:MD_CharacterSetCode codeList=\"" + CODELISTS_PATH + "#MD_CharacterSetCode\"
codeListValue=\"utf8\">UTF-8</gmd:MD_CharacterSetCode>\n" +
-            "      </gmd:characterEncoding>\n";
-
-    /**
      * The locales to use for the tests. For better test coverage we need at least:
      *
      * <ul>
@@ -66,51 +51,19 @@ public final strictfp class PT_LocaleTes
     };
 
     /**
-     * XML representation of the {@link #LOCALES} list.
+     * Tests marshalling of a few locales using the specified version of metadata schema.
+     *
+     * @param filename      name of the file containing expected result.
+     * @param ignoredNodes  the fully-qualified names of the nodes to ignore.
      */
-    private static final String XML =
-            "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
-            "  <gmd:language>\n" +
-            "    <gmd:LanguageCode codeList=\"http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode\"
codeListValue=\"eng\" codeSpace=\"eng\">English</gmd:LanguageCode>\n" +
-            "  </gmd:language>\n" +
-            "  <gmd:locale>\n" +
-            "    <gmd:PT_Locale>\n" +
-            "      <gmd:languageCode>\n" +
-            "        <gmd:LanguageCode codeList=\"" + CODELISTS_PATH + "#LanguageCode\"
codeListValue=\"jpn\" codeSpace=\"eng\">Japanese</gmd:LanguageCode>\n" +
-            "      </gmd:languageCode>\n" + ENCODING +
-            "    </gmd:PT_Locale>\n" +
-            "  </gmd:locale>\n" +
-            "  <gmd:locale>\n" +
-            "    <gmd:PT_Locale>\n" +
-            "      <gmd:languageCode>\n" +
-            "        <gmd:LanguageCode codeList=\"" + CODELISTS_PATH + "#LanguageCode\"
codeListValue=\"eng\" codeSpace=\"eng\">English</gmd:LanguageCode>\n" +
-            "      </gmd:languageCode>\n" +
-            "      <gmd:country>\n" +
-            "        <gmd:Country codeList=\"" + CODELISTS_PATH + "#Country\" codeListValue=\"CA\"
codeSpace=\"eng\">Canada</gmd:Country>\n" +
-            "      </gmd:country>\n" + ENCODING +
-            "    </gmd:PT_Locale>\n" +
-            "  </gmd:locale>\n" +
-            "  <gmd:locale>\n" +
-            "    <gmd:PT_Locale>\n" +
-            "      <gmd:languageCode>\n" +
-            "        <gmd:LanguageCode codeList=\"" + CODELISTS_PATH + "#LanguageCode\"
codeListValue=\"fra\" codeSpace=\"eng\">French</gmd:LanguageCode>\n" +
-            "      </gmd:languageCode>\n" +
-            "      <gmd:country>\n" +
-            "        <gmd:Country codeList=\"" + CODELISTS_PATH + "#Country\" codeListValue=\"FR\"
codeSpace=\"eng\">France</gmd:Country>\n" +
-            "      </gmd:country>\n" + ENCODING +
-            "    </gmd:PT_Locale>\n" +
-            "  </gmd:locale>\n" +
-            "  <gmd:locale>\n" +
-            "    <gmd:PT_Locale>\n" +
-            "      <gmd:languageCode>\n" +
-            "        <gmd:LanguageCode codeList=\"" + CODELISTS_PATH + "#LanguageCode\"
codeListValue=\"fra\" codeSpace=\"eng\">French</gmd:LanguageCode>\n" +
-            "      </gmd:languageCode>\n" +
-            "      <gmd:country>\n" +
-            "        <gmd:Country codeList=\"" + CODELISTS_PATH + "#Country\" codeListValue=\"CA\"
codeSpace=\"eng\">Canada</gmd:Country>\n" +
-            "      </gmd:country>\n" + ENCODING +
-            "    </gmd:PT_Locale>\n" +
-            "  </gmd:locale>\n" +
-            "</gmd:MD_Metadata>";
+    private void marshalAndCompare(final String filename, final Version version, final String...
ignoredNodes)
+            throws JAXBException
+    {
+        final DefaultMetadata metadata = new DefaultMetadata();
+        metadata.setLanguages(Arrays.asList(LOCALES));
+        assertMarshalEqualsFile(filename, metadata, version, STRICT, ignoredNodes,
+                new String[] {"xlmns:*", "xsi:*"});
+    }
 
     /**
      * Tests marshalling of a few locales.
@@ -119,9 +72,19 @@ public final strictfp class PT_LocaleTes
      */
     @Test
     public void testMarshalling() throws JAXBException {
-        final DefaultMetadata metadata = new DefaultMetadata();
-        metadata.setLanguages(Arrays.asList(LOCALES));
-        assertXmlEquals(XML, marshal(metadata), "xlmns:*");
+        marshalAndCompare("Locales.xml", LegacyNamespaces.ISO_19115_3,
+                          "mdb:contact", "mdb:dateInfo", "mdb:identificationInfo");
+    }
+
+    /**
+     * Tests marshalling to legacy ISO 19139:2007 schema.
+     *
+     * @throws JAXBException if an error occurred during (un)marshalling.
+     */
+    @Test
+    public void testMarshallingLegacy() throws JAXBException {
+        marshalAndCompare("Locales (legacy).xml", LegacyNamespaces.ISO_19139,
+                          "gmd:contact", "gmd:dateStamp", "gmd:identificationInfo");
     }
 
     /**
@@ -131,7 +94,18 @@ public final strictfp class PT_LocaleTes
      */
     @Test
     public void testUnmarshalling() throws JAXBException {
-        final DefaultMetadata metadata = unmarshal(DefaultMetadata.class, XML);
+        final DefaultMetadata metadata = unmarshalFile(DefaultMetadata.class, "Locales.xml");
+        assertArrayEquals(LOCALES, metadata.getLanguages().toArray());
+    }
+
+    /**
+     * Tests unmarshalling from legacy ISO 19139:2007 schema.
+     *
+     * @throws JAXBException if an error occurred during (un)marshalling.
+     */
+    @Test
+    public void testUnmarshallingLegacy() throws JAXBException {
+        final DefaultMetadata metadata = unmarshalFile(DefaultMetadata.class, "Locales (legacy).xml");
         assertArrayEquals(LOCALES, metadata.getLanguages().toArray());
     }
 }

Added: sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales
(legacy).xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales%20%28legacy%29.xml?rev=1821118&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales
(legacy).xml (added)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales
(legacy).xml Sun Jan 14 21:52:33 2018
@@ -0,0 +1,87 @@
+<?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:MD_Metadata
+    xmlns:gmd = "http://www.isotc211.org/2005/gmd"
+    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">
+
+  <gmd:language>
+    <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="eng" codeSpace="eng">English</gmd:LanguageCode>
+  </gmd:language>
+
+  <!-- Following empty elements are mandatory according ISO 19115, but ignored for this
test. -->
+  <gmd:contact/>
+  <gmd:dateStamp/>
+
+  <gmd:locale>
+    <gmd:PT_Locale>
+      <gmd:languageCode>
+        <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="jpn" codeSpace="eng">Japanese</gmd:LanguageCode>
+      </gmd:languageCode>
+      <gmd:characterEncoding>
+        <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:characterEncoding>
+    </gmd:PT_Locale>
+  </gmd:locale>
+  <gmd:locale>
+    <gmd:PT_Locale>
+      <gmd:languageCode>
+        <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="eng" codeSpace="eng">English</gmd:LanguageCode>
+      </gmd:languageCode>
+      <gmd:country>
+        <gmd:Country codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#Country"
codeListValue="CA" codeSpace="eng">Canada</gmd:Country>
+      </gmd:country>
+      <gmd:characterEncoding>
+        <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:characterEncoding>
+    </gmd:PT_Locale>
+  </gmd:locale>
+  <gmd:locale>
+    <gmd:PT_Locale>
+      <gmd:languageCode>
+        <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="fra" codeSpace="eng">French</gmd:LanguageCode>
+      </gmd:languageCode>
+      <gmd:country>
+        <gmd:Country codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#Country"
codeListValue="FR" codeSpace="eng">France</gmd:Country>
+      </gmd:country>
+      <gmd:characterEncoding>
+        <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:characterEncoding>
+    </gmd:PT_Locale>
+  </gmd:locale>
+  <gmd:locale>
+    <gmd:PT_Locale>
+      <gmd:languageCode>
+        <gmd:LanguageCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#LanguageCode"
codeListValue="fra" codeSpace="eng">French</gmd:LanguageCode>
+      </gmd:languageCode>
+      <gmd:country>
+        <gmd:Country codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#Country"
codeListValue="CA" codeSpace="eng">Canada</gmd:Country>
+      </gmd:country>
+      <gmd:characterEncoding>
+        <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:characterEncoding>
+    </gmd:PT_Locale>
+  </gmd:locale>
+
+  <!-- Following empty element is mandatory according ISO 19115, but ignored for this
test. -->
+  <gmd:identificationInfo/>
+
+</gmd:MD_Metadata>

Added: sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales.xml
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales.xml?rev=1821118&view=auto
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales.xml
(added)
+++ sis/branches/ISO-19115-3/core/sis-metadata/src/test/resources/org/apache/sis/internal/jaxb/code/Locales.xml
Sun Jan 14 21:52:33 2018
@@ -0,0 +1,101 @@
+<?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.
+-->
+
+<mdb:MD_Metadata
+    xmlns:mdb = "http://standards.iso.org/iso/19115/-3/mdb/1.0"
+    xmlns:lan = "http://standards.iso.org/iso/19115/-3/lan/1.0"
+    xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation = "http://standards.iso.org/iso/19115/-3/mdb/1.0
+                          http://standards.iso.org/iso/19115/-3/mdb/1.0/mdb.xsd">
+
+  <mdb:defaultLocale>
+    <lan:PT_Locale>
+      <lan:language>
+        <lan:LanguageCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
codeListValue="eng" codeSpace="eng">English</lan:LanguageCode>
+      </lan:language>
+      <lan:characterEncoding>
+        <lan:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_CharacterSetCode"
codeListValue="utf8" codeSpace="eng">UTF-8</lan:MD_CharacterSetCode>
+      </lan:characterEncoding>
+      <!--
+        Above <gmd:characterEncoding> element is repeated for every locale. This element
is ignored
+        by Apache SIS since it is considered redundant with the encoding declared in the
XML header.
+        But those elements are mandatory according OGC/ISO schemas, so we have to carry their
weight.
+      -->
+    </lan:PT_Locale>
+  </mdb:defaultLocale>
+
+  <!-- Following empty elements are mandatory according ISO 19115, but ignored for this
test. -->
+  <mdb:contact/>
+  <mdb:dateInfo/>
+
+  <mdb:otherLocale>
+    <lan:PT_Locale>
+      <lan:language>
+        <lan:LanguageCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
codeListValue="jpn" codeSpace="eng">Japanese</lan:LanguageCode>
+      </lan:language>
+      <lan:characterEncoding>
+        <lan:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_CharacterSetCode"
codeListValue="utf8" codeSpace="eng">UTF-8</lan:MD_CharacterSetCode>
+      </lan:characterEncoding>
+    </lan:PT_Locale>
+  </mdb:otherLocale>
+  <mdb:otherLocale>
+    <lan:PT_Locale>
+      <lan:language>
+        <lan:LanguageCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
codeListValue="eng" codeSpace="eng">English</lan:LanguageCode>
+      </lan:language>
+      <lan:country>
+        <lan:CountryCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#Country"
codeListValue="CA" codeSpace="eng">Canada</lan:CountryCode>
+      </lan:country>
+      <lan:characterEncoding>
+        <lan:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_CharacterSetCode"
codeListValue="utf8" codeSpace="eng">UTF-8</lan:MD_CharacterSetCode>
+      </lan:characterEncoding>
+    </lan:PT_Locale>
+  </mdb:otherLocale>
+  <mdb:otherLocale>
+    <lan:PT_Locale>
+      <lan:language>
+        <lan:LanguageCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
codeListValue="fra" codeSpace="eng">French</lan:LanguageCode>
+      </lan:language>
+      <lan:country>
+        <lan:CountryCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#Country"
codeListValue="FR" codeSpace="eng">France</lan:CountryCode>
+      </lan:country>
+      <lan:characterEncoding>
+        <lan:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_CharacterSetCode"
codeListValue="utf8" codeSpace="eng">UTF-8</lan:MD_CharacterSetCode>
+      </lan:characterEncoding>
+    </lan:PT_Locale>
+  </mdb:otherLocale>
+  <mdb:otherLocale>
+    <lan:PT_Locale>
+      <lan:language>
+        <lan:LanguageCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#LanguageCode"
codeListValue="fra" codeSpace="eng">French</lan:LanguageCode>
+      </lan:language>
+      <lan:country>
+        <lan:CountryCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#Country"
codeListValue="CA" codeSpace="eng">Canada</lan:CountryCode>
+      </lan:country>
+      <lan:characterEncoding>
+        <lan:MD_CharacterSetCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#MD_CharacterSetCode"
codeListValue="utf8" codeSpace="eng">UTF-8</lan:MD_CharacterSetCode>
+      </lan:characterEncoding>
+    </lan:PT_Locale>
+  </mdb:otherLocale>
+
+  <!-- Following empty element is mandatory according ISO 19115, but ignored for this
test. -->
+  <mdb:identificationInfo/>
+
+</mdb:MD_Metadata>

Modified: sis/branches/ISO-19115-3/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1821118&r1=1821117&r2=1821118&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
[UTF-8] Sun Jan 14 21:52:33 2018
@@ -486,7 +486,7 @@ public final strictfp class DefaultProje
          * Test marshalling and compare with the original file. The comparison ignores the
<gml:name> nodes because the
          * marshalled CRS contains many operation method and parameter aliases which were
not in the original XML file.
          */
-        assertMarshalEqualsFile(XML_FILE, crs, STRICT, new String[] {"gml:name"},
+        assertMarshalEqualsFile(XML_FILE, crs, null, STRICT, new String[] {"gml:name"},
                 new String[] {"xmlns:*", "xsi:schemaLocation", "gml:id"});
     }
 

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt?rev=1821118&r1=1821117&r2=1821118&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/main/resources/org/apache/sis/xml/NamespaceContent.txt
[UTF-8] Sun Jan 14 21:52:33 2018
@@ -174,8 +174,6 @@ http://standards.iso.org/iso/19115/-3/ge
     minimumValue
     verticalCRS
 http://standards.iso.org/iso/19115/-3/lan/1.0
-  Country
-    <type>
   CountryCode
     <type>
   LanguageCode
@@ -189,7 +187,6 @@ http://standards.iso.org/iso/19115/-3/la
     characterEncoding
     country
     language
-    languageCode
   textGroup
     <type>
 http://standards.iso.org/iso/19115/-3/mac/1.0
@@ -369,21 +366,13 @@ http://standards.iso.org/iso/19115/-3/md
     <type>
     alternativeMetadataReference
     applicationSchemaInfo
-    characterSet
     contact
     contentInfo
     dataQualityInfo
-    dataSetURI
     dateInfo
-    dateStamp
     defaultLocale
     distributionInfo
-    fileIdentifier
-    hierarchyLevel
-    hierarchyLevelName
     identificationInfo
-    language
-    locale
     metadataConstraints
     metadataExtensionInfo
     metadataIdentifier
@@ -392,10 +381,7 @@ http://standards.iso.org/iso/19115/-3/md
     metadataProfile
     metadataScope
     metadataStandard
-    metadataStandardName
-    metadataStandardVersion
     otherLocale
-    parentIdentifier
     parentMetadata
     portrayalCatalogueInfo
     referenceSystemInfo

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java?rev=1821118&r1=1821117&r2=1821118&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLComparator.java
[UTF-8] Sun Jan 14 21:52:33 2018
@@ -43,6 +43,7 @@ import org.w3c.dom.Text;
 import org.xml.sax.SAXException;
 import org.apache.sis.xml.Namespaces;
 import org.apache.sis.util.ArgumentChecks;
+import org.apache.sis.internal.jaxb.LegacyNamespaces;
 
 import static java.lang.StrictMath.*;
 import static org.opengis.test.Assert.*;
@@ -70,7 +71,7 @@ import static org.apache.sis.util.CharSe
  * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @author  Guilhem Legal (Geomatys)
- * @version 0.4
+ * @version 1.0
  *
  * @see XMLTestCase
  * @see Assert#assertXmlEquals(Object, Object, String[])
@@ -91,11 +92,12 @@ public strictfp class XMLComparator {
         map.put("xmlns", "http://www.w3.org/2000/xmlns");           // No trailing slash.
         map.put("xlink", Namespaces.XLINK);
         map.put("xsi",   Namespaces.XSI);
-        map.put("gml",   Namespaces.GML);
-        map.put("gmd",   Namespaces.GMD);
-        map.put("gmx",   Namespaces.GMX);
-        map.put("gmi",   Namespaces.GMI);
         map.put("gco",   Namespaces.GCO);
+        map.put("mdb",   Namespaces.MDB);
+        map.put("gml",   Namespaces.GML);
+        map.put("gmd",   LegacyNamespaces.GMD);
+        map.put("gmx",   LegacyNamespaces.GMX);
+        map.put("gmi",   LegacyNamespaces.GMI);
     }
 
     /**

Modified: sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java?rev=1821118&r1=1821117&r2=1821118&view=diff
==============================================================================
--- sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
[UTF-8] (original)
+++ sis/branches/ISO-19115-3/core/sis-utility/src/test/java/org/apache/sis/test/XMLTestCase.java
[UTF-8] Sun Jan 14 21:52:33 2018
@@ -207,7 +207,7 @@ public abstract strictfp class XMLTestCa
      *
      * @param  filename           the name of the XML file in the package of the final subclass
of {@code this}.
      * @param  object             the object to marshal.
-     * @param  metadataVersion    whether to marshall legacy 19139:2007 or newer ISO 19115-3
document.
+     * @param  metadataVersion    whether to marshal legacy 19139:2007 or newer ISO 19115-3
document. Can be {@code null}.
      * @param  ignoredAttributes  the fully-qualified names of attributes to ignore
      *                            (typically {@code "xmlns:*"} and {@code "xsi:schemaLocation"}).
      * @throws JAXBException if an error occurred during marshalling.
@@ -226,6 +226,7 @@ public abstract strictfp class XMLTestCa
      *
      * @param  filename           the name of the XML file in the package of the final subclass
of {@code this}.
      * @param  object             the object to marshal.
+     * @param  metadataVersion    whether to marshal legacy 19139:2007 or newer ISO 19115-3
document. Can be {@code null}.
      * @param  tolerance          the tolerance threshold for comparison of numerical values.
      * @param  ignoredNodes       the fully-qualified names of the nodes to ignore, or {@code
null} if none.
      * @param  ignoredAttributes  the fully-qualified names of attributes to ignore
@@ -234,12 +235,12 @@ public abstract strictfp class XMLTestCa
      *
      * @see #unmarshalFile(Class, String)
      *
-     * @since 0.7
+     * @since 1.0
      */
-    protected final void assertMarshalEqualsFile(final String filename, final Object object,
+    protected final void assertMarshalEqualsFile(final String filename, final Object object,
final Version metadataVersion,
             final double tolerance, final String[] ignoredNodes, final String[] ignoredAttributes)
throws JAXBException
     {
-        assertXmlEquals(getResource(filename), marshal(object), tolerance, ignoredNodes,
ignoredAttributes);
+        assertXmlEquals(getResource(filename), marshal(object, metadataVersion), tolerance,
ignoredNodes, ignoredAttributes);
     }
 
     /**
@@ -265,7 +266,7 @@ public abstract strictfp class XMLTestCa
      * The XML schema identified by the given version is used.
      *
      * @param  object           the object to marshal.
-     * @param  metadataVersion  whether to marshall legacy 19139:2007 or newer ISO 19115-3
document.
+     * @param  metadataVersion  whether to marshal legacy 19139:2007 or newer ISO 19115-3
document. Can be {@code null}.
      * @return the marshalled object.
      * @throws JAXBException if an error occurred while marshalling the object.
      *



Mime
View raw message