sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1550841 - in /sis/branches/JDK7: application/sis-console/src/test/java/org/apache/sis/console/ core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/ core/sis-build-helper/src/site/apt/ core/sis-metadata/src/test/java/org/apac...
Date Fri, 13 Dec 2013 21:57:35 GMT
Author: desruisseaux
Date: Fri Dec 13 21:57:35 2013
New Revision: 1550841

URL: http://svn.apache.org/r1550841
Log:
Reorganized the metadata XML (un)marshalling tests in order to put them closer to the implementation classes used for the tests.
The initial intend of previous layout was to keep together the XML tests. However this appears to be confusing (the test classes
were not directly related to any SIS implementation classes) and not always practical since XML bindings with JAXB are sometime
closely related to package-privated methods. The sis-referencing module was testing XML close to the implementation classes for
this reason. This commit makes the sis-metadata module consistent with the sis-referencing module in this regard.

Added:
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/CustomMetadataTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java
      - copied, changed from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/extent/
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/extent/Extent.xml
      - copied unchanged from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/xml/Extent.xml
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/lineage/ProcessStep.xml
      - copied unchanged from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/xml/ProcessStep.xml
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/quality/PositionalAccuracy.xml
      - copied unchanged from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/xml/PositionalAccuracy.xml
Removed:
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/CustomMetadataTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/resources/org/apache/sis/xml/
Modified:
    sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MimeTypeSCTest.java
    sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java
    sis/branches/JDK7/core/sis-build-helper/src/site/apt/index.apt
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
    sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
    sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java

Modified: sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MimeTypeSCTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MimeTypeSCTest.java?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MimeTypeSCTest.java [UTF-8] (original)
+++ sis/branches/JDK7/application/sis-console/src/test/java/org/apache/sis/console/MimeTypeSCTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -17,7 +17,7 @@
 package org.apache.sis.console;
 
 import java.net.URL;
-import org.apache.sis.xml.MetadataMarshallingTest;
+import org.apache.sis.metadata.iso.extent.DefaultExtentTest;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -42,11 +42,11 @@ public final strictfp class MimeTypeSCTe
      */
     @Test
     public void testWithMetadataXML() throws Exception {
-        final URL url = MetadataMarshallingTest.class.getResource("Extent.xml");
+        final URL url = DefaultExtentTest.getResource("Extent.xml");
         assertNotNull("Extent.xml", url);
         final MimeTypeSC test = new MimeTypeSC(0, SubCommand.TEST, url.toString());
         test.run();
         final String output = test.outputBuffer.toString().trim();
-        assertTrue(output, output.endsWith("org/apache/sis/xml/Extent.xml: application/vnd.iso.19139+xml"));
+        assertTrue(output, output.endsWith("org/apache/sis/metadata/iso/extent/Extent.xml: application/vnd.iso.19139+xml"));
     }
 }

Modified: sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-build-helper/src/main/java/org/apache/sis/internal/taglet/SourceRepositoryURL.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -24,12 +24,13 @@ import com.sun.tools.doclets.formats.htm
 
 /**
  * The <code>@scmUrl</code> tag for inserting a URL to a file in the source code repository.
- * This tag shall contain a keyword, for example <code>{@scmUrl gmd-data}</code>.
+ * This tag shall contain a keyword, for example <code>{@scmUrl metadata}</code>.
  * Valid keywords are:
  *
  * <table class="sis>
- *   <tr><th>Keyword</th>   <th>path</th></tr>
- *   <tr><td>gmd-data</td>  <td>core/sis-metadata/src/test/resources/org/apache/sis/xml</td></tr>
+ *   <tr><th>Keyword</th>     <th>path</th></tr>
+ *   <tr><td>metadata</td>    <td>core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso</td></tr>
+ *   <tr><td>referencing</td> <td>core/sis-referencing/src/test/resources/org/apache/sis/referencing</td></tr>
  * </table>
  *
  * The URL never contain trailing <code>'/'</code> character.
@@ -78,8 +79,12 @@ public final class SourceRepositoryURL e
         final StringBuilder url = new StringBuilder("http://svn.apache.org/repos/asf/sis/branches/JDK7");
         final String keyword = tag.text();
         switch (keyword) {
-            case "gmd-data": {
-                url.append("/core/sis-metadata/src/test/resources/org/apache/sis/xml");
+            case "metadata": {
+                url.append("/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso");
+                break;
+            }
+            case "referencing": {
+                url.append("/core/sis-referencing/src/test/resources/org/apache/sis/referencing");
                 break;
             }
             default: {

Modified: sis/branches/JDK7/core/sis-build-helper/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-build-helper/src/site/apt/index.apt?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-build-helper/src/site/apt/index.apt [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-build-helper/src/site/apt/index.apt [UTF-8] Fri Dec 13 21:57:35 2013
@@ -51,7 +51,7 @@ Building Apache SIS
 |                      | <<<java>>>, <<<xml>>>, <<<sql>>>, <<<wkt>>>, <<<text>>>, <<<math>>> or <<<shell>>>.       |
 *----------------------+-------------------------------------------------------------------------------------------+
 | <<<\{@scmUrl\}>>>    | An inline taglet for a URL to the source code repository. The only word inside the taglet |
-|                      | shall be <<<gmd-data>>>.                                                                  |
+|                      | shall be <<<metadata>>> or <<<referencing>>>.                                             |
 *----------------------+-------------------------------------------------------------------------------------------+
 | <<<\{@section\}>>>   | An inline taglet for the title of a new section in the javadoc.                           |
 *----------------------+-------------------------------------------------------------------------------------------+

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/AllMetadataTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -39,12 +39,7 @@ import static org.junit.Assert.*;
  * @version 0.3
  * @module
  */
-@DependsOn({
-    org.apache.sis.metadata.PropertyAccessorTest.class,
-    org.apache.sis.metadata.iso.citation.DefaultCitationTest.class,
-    org.apache.sis.metadata.iso.citation.DefaultCitationDateTest.class,
-    org.apache.sis.metadata.iso.quality.AbstractElementTest.class
-})
+@DependsOn(org.apache.sis.metadata.PropertyAccessorTest.class)
 public final strictfp class AllMetadataTest extends MetadataTestCase {
     /**
      * A JUnit {@linkplain Rule rule} for listening to log events. This field is public

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/CustomMetadataTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/CustomMetadataTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/CustomMetadataTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/CustomMetadataTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso;
 
 import java.util.Map;
 import java.util.HashMap;
@@ -35,8 +35,8 @@ import org.opengis.metadata.maintenance.
 import org.opengis.metadata.spatial.SpatialRepresentationType;
 import org.opengis.util.InternationalString;
 import org.apache.sis.internal.system.DefaultFactories;
-import org.apache.sis.metadata.iso.DefaultMetadata;
 import org.apache.sis.test.XMLTestCase;
+import org.apache.sis.xml.XML;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -50,7 +50,7 @@ import static org.junit.Assert.*;
  * @author  Damiano Albani (for code snippet on the mailing list)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.14)
- * @version 0.3
+ * @version 0.4
  * @module
  */
 public final strictfp class CustomMetadataTest extends XMLTestCase {

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/DefaultMetadataTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,35 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso;
 
-import java.util.Locale;
-import java.net.URL;
-import java.io.IOException;
 import javax.xml.bind.JAXBException;
-import org.opengis.util.InternationalString;
-import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.metadata.iso.extent.DefaultExtent;
-import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
-import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessStep;
-import org.apache.sis.metadata.iso.quality.AbstractElement;
-import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
 import org.apache.sis.test.XMLTestCase;
-import org.apache.sis.test.DependsOn;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.xml.XML;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.test.TestUtilities.date;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
  * 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 <a href="{@scmUrl gmd-data}/">here</a>.
+ * is provided by {@code *.xml} files <a href="{@scmUrl metadata}/">here</a>.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -50,28 +36,13 @@ import static org.apache.sis.test.TestUt
  * @version 0.4
  * @module
  */
-@DependsOn(FreeTextMarshallingTest.class)
-public final strictfp class MetadataMarshallingTest extends XMLTestCase {
+public final strictfp class DefaultMetadataTest extends XMLTestCase {
     /**
-     * Returns the URL to the XML file of the given name.
-     *
-     * @param  filename The name of the XML file.
-     * @return The URL to the given XML file.
-     */
-    private static URL getResource(final String filename) {
-        final URL resource = MetadataMarshallingTest.class.getResource(filename);
-        assertNotNull(filename, resource);
-        return resource;
-    }
-
-    /**
-     * Tests a collection that contains no element.
+     * Tests unmarshalling of a metadata having a collection that contains no element.
      * This was used to cause a {@code NullPointerException} prior SIS-139 fix.
      *
      * @throws JAXBException If an error occurred during the during unmarshalling processes.
      *
-     * @since 0.4
-     *
      * @see <a href="https://issues.apache.org/jira/browse/SIS-139">SIS-139</a>
      */
     @Test
@@ -83,104 +54,4 @@ public final strictfp class MetadataMars
         final DefaultMetadata metadata = (DefaultMetadata) XML.unmarshal(xml);
         assertTrue(metadata.getContacts().isEmpty());
     }
-
-    /**
-     * Tests the (un)marshalling of a text group with a default {@code <gco:CharacterString>} element.
-     * This test is somewhat a duplicate of {@link FreeTextMarshallingTest}, but the context is more
-     * elaborated.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/PositionalAccuracy.xml">PositionalAccuracy.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-107">GEOTK-107</a>
-     * @see FreeTextMarshallingTest
-     */
-    @Test
-    public void testPositionalAccuracy() throws IOException, JAXBException {
-        final URL    resource = getResource("PositionalAccuracy.xml");
-        final Object metadata = XML.unmarshal(resource);
-        assertInstanceOf("PositionalAccuracy.xml", AbstractElement.class, metadata);
-        final InternationalString nameOfMeasure = getSingleton(((AbstractElement) metadata).getNamesOfMeasure());
-        /*
-         * Programmatic verification of the text group.
-         */
-        assertEquals("Quantitative quality measure focusing on the effective class percent "
-                + "regarded to the total surface size", nameOfMeasure.toString(Locale.ENGLISH));
-        assertEquals("Mesure qualité quantitative de type pourcentage de représentation de la "
-                + "classe par rapport à la surface totale", nameOfMeasure.toString(Locale.FRENCH));
-        /*
-         * Opportunist test. While it was not the purpose of this test, the above metadata
-         * needs to contain a "result" element in order to pass XML validation test.
-         */
-        assertInstanceOf("Wrong value for <gmd:result>", DefaultConformanceResult.class,
-                getSingleton(((AbstractElement) metadata).getResults()));
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertXmlEquals(resource, marshal(metadata), "xmlns:*", "xsi:schemaLocation", "xsi:type");
-    }
-
-    /**
-     * Tests the (un)marshalling of a metadata mixing elements from ISO 19115 and ISO 19115-2 standards.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/ProcessStep.xml">ProcessStep.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     */
-    @Test
-    public void testProcessStep() throws IOException, JAXBException {
-        final DefaultProcessing  processing   = new DefaultProcessing();
-        final DefaultProcessStep processStep  = new DefaultProcessStep("Some process step.");
-        processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
-        processStep.setProcessingInformation(processing);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(processStep);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("ProcessStep.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(processStep, unmarshal(DefaultProcessStep.class, xml));
-    }
-
-    /**
-     * Tests the (un)marshalling of a {@code <gmd:EX_Extent>} object.
-     * This test opportunistically tests setting {@code "gml:id"} value.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/Extent.xml">Extent.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @since 0.4
-     */
-    @Test
-    public void testExtent() throws IOException, JAXBException {
-        final DefaultGeographicBoundingBox bbox = new DefaultGeographicBoundingBox(-99, -79, 14.9844, 31);
-        bbox.getIdentifierMap().put(IdentifierSpace.ID, "bbox");
-        final DefaultTemporalExtent temporal = new DefaultTemporalExtent();
-        if (PENDING_FUTURE_SIS_VERSION) {
-            // This block needs sis-temporal module.
-            temporal.setBounds(date("2010-01-27 13:26:10"), date("2010-08-27 13:26:10"));
-        }
-        final DefaultExtent extent = new DefaultExtent(null, bbox, null, temporal);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(extent);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("Extent.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(extent, unmarshal(DefaultExtent.class, xml));
-    }
 }

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/extent/DefaultExtentTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,35 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso.extent;
 
-import java.util.Locale;
 import java.net.URL;
 import java.io.IOException;
 import javax.xml.bind.JAXBException;
-import org.opengis.util.InternationalString;
-import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.metadata.iso.extent.DefaultExtent;
-import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
-import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessStep;
-import org.apache.sis.metadata.iso.quality.AbstractElement;
-import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
+import org.apache.sis.xml.IdentifierSpace;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
 import static org.apache.sis.test.TestUtilities.date;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
- * 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 <a href="{@scmUrl gmd-data}/">here</a>.
+ * Tests {@link DefaultExtent}.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -50,120 +37,33 @@ import static org.apache.sis.test.TestUt
  * @version 0.4
  * @module
  */
-@DependsOn(FreeTextMarshallingTest.class)
-public final strictfp class MetadataMarshallingTest extends XMLTestCase {
+@DependsOn(DefaultGeographicBoundingBoxTest.class)
+public final strictfp class DefaultExtentTest extends XMLTestCase {
     /**
      * Returns the URL to the XML file of the given name.
+     * The argument shall be one of the files listed <a href="{@scmUrl metadata}/extent/">here</a>.
      *
      * @param  filename The name of the XML file.
      * @return The URL to the given XML file.
      */
-    private static URL getResource(final String filename) {
-        final URL resource = MetadataMarshallingTest.class.getResource(filename);
+    public static URL getResource(final String filename) {
+        final URL resource = DefaultExtentTest.class.getResource(filename);
         assertNotNull(filename, resource);
         return resource;
     }
 
     /**
-     * Tests a collection that contains no element.
-     * This was used to cause a {@code NullPointerException} prior SIS-139 fix.
-     *
-     * @throws JAXBException If an error occurred during the during unmarshalling processes.
-     *
-     * @since 0.4
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-139">SIS-139</a>
-     */
-    @Test
-    public void testEmptyCollection() throws JAXBException {
-        final String xml =
-                "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
-                "  <gmd:contact/>\n" +
-                "</gmd:MD_Metadata>";
-        final DefaultMetadata metadata = (DefaultMetadata) XML.unmarshal(xml);
-        assertTrue(metadata.getContacts().isEmpty());
-    }
-
-    /**
-     * Tests the (un)marshalling of a text group with a default {@code <gco:CharacterString>} element.
-     * This test is somewhat a duplicate of {@link FreeTextMarshallingTest}, but the context is more
-     * elaborated.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/PositionalAccuracy.xml">PositionalAccuracy.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-107">GEOTK-107</a>
-     * @see FreeTextMarshallingTest
-     */
-    @Test
-    public void testPositionalAccuracy() throws IOException, JAXBException {
-        final URL    resource = getResource("PositionalAccuracy.xml");
-        final Object metadata = XML.unmarshal(resource);
-        assertInstanceOf("PositionalAccuracy.xml", AbstractElement.class, metadata);
-        final InternationalString nameOfMeasure = getSingleton(((AbstractElement) metadata).getNamesOfMeasure());
-        /*
-         * Programmatic verification of the text group.
-         */
-        assertEquals("Quantitative quality measure focusing on the effective class percent "
-                + "regarded to the total surface size", nameOfMeasure.toString(Locale.ENGLISH));
-        assertEquals("Mesure qualité quantitative de type pourcentage de représentation de la "
-                + "classe par rapport à la surface totale", nameOfMeasure.toString(Locale.FRENCH));
-        /*
-         * Opportunist test. While it was not the purpose of this test, the above metadata
-         * needs to contain a "result" element in order to pass XML validation test.
-         */
-        assertInstanceOf("Wrong value for <gmd:result>", DefaultConformanceResult.class,
-                getSingleton(((AbstractElement) metadata).getResults()));
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertXmlEquals(resource, marshal(metadata), "xmlns:*", "xsi:schemaLocation", "xsi:type");
-    }
-
-    /**
-     * Tests the (un)marshalling of a metadata mixing elements from ISO 19115 and ISO 19115-2 standards.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/ProcessStep.xml">ProcessStep.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     */
-    @Test
-    public void testProcessStep() throws IOException, JAXBException {
-        final DefaultProcessing  processing   = new DefaultProcessing();
-        final DefaultProcessStep processStep  = new DefaultProcessStep("Some process step.");
-        processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
-        processStep.setProcessingInformation(processing);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(processStep);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("ProcessStep.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(processStep, unmarshal(DefaultProcessStep.class, xml));
-    }
-
-    /**
      * Tests the (un)marshalling of a {@code <gmd:EX_Extent>} object.
      * This test opportunistically tests setting {@code "gml:id"} value.
      *
      * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/Extent.xml">Extent.xml</a></p>
+     * <a href="{@scmUrl metadata}/extent/Extent.xml">Extent.xml</a></p>
      *
      * @throws IOException   If an error occurred while reading the XML file.
      * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @since 0.4
      */
     @Test
-    public void testExtent() throws IOException, JAXBException {
+    public void testXML() throws IOException, JAXBException {
         final DefaultGeographicBoundingBox bbox = new DefaultGeographicBoundingBox(-99, -79, 14.9844, 31);
         bbox.getIdentifierMap().put(IdentifierSpace.ID, "bbox");
         final DefaultTemporalExtent temporal = new DefaultTemporalExtent();

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ImageryMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,30 +14,30 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso.lineage;
 
 import java.util.Arrays;
 import javax.xml.bind.JAXBException;
 import org.apache.sis.util.iso.SimpleInternationalString;
 import org.apache.sis.metadata.iso.DefaultIdentifier;
-import org.apache.sis.metadata.iso.lineage.DefaultSource;
-import org.apache.sis.metadata.iso.lineage.DefaultLineage;
 import org.apache.sis.test.XMLTestCase;
+import org.apache.sis.xml.Namespaces;
+import org.apache.sis.xml.XML;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
 
 
 /**
- * Tests the XML marshalling of objects in the {@code "gmi"} namespace that
- * GeoAPI merged with the object of same name in the {@code "gmd"} namespace.
+ * Tests {@link DefaultLineage}. This include testing the XML marshalling of objects in the
+ * {@code "gmi"} namespace that GeoAPI merged with the object of same name in the {@code "gmd"} namespace.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.17)
- * @version 0.3
+ * @version 0.4
  * @module
  */
-public final strictfp class ImageryMarshallingTest extends XMLTestCase {
+public final strictfp class DefaultLineageTest extends XMLTestCase {
     /**
      * Tests the marshalling of an {@code "gmd:LI_Source"} element, which shall become
      * {@code "gmi:LE_Source"} when some ISO 19115-2 properties are defined.

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,35 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso.lineage;
 
-import java.util.Locale;
 import java.net.URL;
 import java.io.IOException;
 import javax.xml.bind.JAXBException;
-import org.opengis.util.InternationalString;
 import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.metadata.iso.extent.DefaultExtent;
-import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
-import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessStep;
-import org.apache.sis.metadata.iso.quality.AbstractElement;
-import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
 import org.apache.sis.test.XMLTestCase;
-import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.test.TestUtilities.date;
-import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
- * 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 <a href="{@scmUrl gmd-data}/">here</a>.
+ * Tests {@link DefaultProcessStep}.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -50,8 +35,7 @@ import static org.apache.sis.test.TestUt
  * @version 0.4
  * @module
  */
-@DependsOn(FreeTextMarshallingTest.class)
-public final strictfp class MetadataMarshallingTest extends XMLTestCase {
+public final strictfp class DefaultProcessStepTest extends XMLTestCase {
     /**
      * Returns the URL to the XML file of the given name.
      *
@@ -59,83 +43,24 @@ public final strictfp class MetadataMars
      * @return The URL to the given XML file.
      */
     private static URL getResource(final String filename) {
-        final URL resource = MetadataMarshallingTest.class.getResource(filename);
+        final URL resource = DefaultProcessStepTest.class.getResource(filename);
         assertNotNull(filename, resource);
         return resource;
     }
 
     /**
-     * Tests a collection that contains no element.
-     * This was used to cause a {@code NullPointerException} prior SIS-139 fix.
-     *
-     * @throws JAXBException If an error occurred during the during unmarshalling processes.
-     *
-     * @since 0.4
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-139">SIS-139</a>
-     */
-    @Test
-    public void testEmptyCollection() throws JAXBException {
-        final String xml =
-                "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
-                "  <gmd:contact/>\n" +
-                "</gmd:MD_Metadata>";
-        final DefaultMetadata metadata = (DefaultMetadata) XML.unmarshal(xml);
-        assertTrue(metadata.getContacts().isEmpty());
-    }
-
-    /**
-     * Tests the (un)marshalling of a text group with a default {@code <gco:CharacterString>} element.
-     * This test is somewhat a duplicate of {@link FreeTextMarshallingTest}, but the context is more
-     * elaborated.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/PositionalAccuracy.xml">PositionalAccuracy.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-107">GEOTK-107</a>
-     * @see FreeTextMarshallingTest
-     */
-    @Test
-    public void testPositionalAccuracy() throws IOException, JAXBException {
-        final URL    resource = getResource("PositionalAccuracy.xml");
-        final Object metadata = XML.unmarshal(resource);
-        assertInstanceOf("PositionalAccuracy.xml", AbstractElement.class, metadata);
-        final InternationalString nameOfMeasure = getSingleton(((AbstractElement) metadata).getNamesOfMeasure());
-        /*
-         * Programmatic verification of the text group.
-         */
-        assertEquals("Quantitative quality measure focusing on the effective class percent "
-                + "regarded to the total surface size", nameOfMeasure.toString(Locale.ENGLISH));
-        assertEquals("Mesure qualité quantitative de type pourcentage de représentation de la "
-                + "classe par rapport à la surface totale", nameOfMeasure.toString(Locale.FRENCH));
-        /*
-         * Opportunist test. While it was not the purpose of this test, the above metadata
-         * needs to contain a "result" element in order to pass XML validation test.
-         */
-        assertInstanceOf("Wrong value for <gmd:result>", DefaultConformanceResult.class,
-                getSingleton(((AbstractElement) metadata).getResults()));
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertXmlEquals(resource, marshal(metadata), "xmlns:*", "xsi:schemaLocation", "xsi:type");
-    }
-
-    /**
      * Tests the (un)marshalling of a metadata mixing elements from ISO 19115 and ISO 19115-2 standards.
      *
      * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/ProcessStep.xml">ProcessStep.xml</a></p>
+     * <a href="{@scmUrl metadata}/lineage/ProcessStep.xml">ProcessStep.xml</a></p>
      *
      * @throws IOException   If an error occurred while reading the XML file.
      * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
      */
     @Test
-    public void testProcessStep() throws IOException, JAXBException {
-        final DefaultProcessing  processing   = new DefaultProcessing();
-        final DefaultProcessStep processStep  = new DefaultProcessStep("Some process step.");
+    public void testXML() throws IOException, JAXBException {
+        final DefaultProcessing  processing  = new DefaultProcessing();
+        final DefaultProcessStep processStep = new DefaultProcessStep("Some process step.");
         processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
         processStep.setProcessingInformation(processing);
         /*
@@ -149,38 +74,4 @@ public final strictfp class MetadataMars
          */
         assertEquals(processStep, unmarshal(DefaultProcessStep.class, xml));
     }
-
-    /**
-     * Tests the (un)marshalling of a {@code <gmd:EX_Extent>} object.
-     * This test opportunistically tests setting {@code "gml:id"} value.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/Extent.xml">Extent.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @since 0.4
-     */
-    @Test
-    public void testExtent() throws IOException, JAXBException {
-        final DefaultGeographicBoundingBox bbox = new DefaultGeographicBoundingBox(-99, -79, 14.9844, 31);
-        bbox.getIdentifierMap().put(IdentifierSpace.ID, "bbox");
-        final DefaultTemporalExtent temporal = new DefaultTemporalExtent();
-        if (PENDING_FUTURE_SIS_VERSION) {
-            // This block needs sis-temporal module.
-            temporal.setBounds(date("2010-01-27 13:26:10"), date("2010-08-27 13:26:10"));
-        }
-        final DefaultExtent extent = new DefaultExtent(null, bbox, null, temporal);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(extent);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("Extent.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(extent, unmarshal(DefaultExtent.class, xml));
-    }
 }

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/MetadataMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -14,35 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.sis.xml;
+package org.apache.sis.metadata.iso.quality;
 
 import java.util.Locale;
 import java.net.URL;
 import java.io.IOException;
 import javax.xml.bind.JAXBException;
 import org.opengis.util.InternationalString;
-import org.apache.sis.util.iso.SimpleInternationalString;
-import org.apache.sis.metadata.iso.DefaultMetadata;
-import org.apache.sis.metadata.iso.extent.DefaultExtent;
-import org.apache.sis.metadata.iso.extent.DefaultTemporalExtent;
-import org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessing;
-import org.apache.sis.metadata.iso.lineage.DefaultProcessStep;
-import org.apache.sis.metadata.iso.quality.AbstractElement;
-import org.apache.sis.metadata.iso.quality.DefaultConformanceResult;
+import org.apache.sis.xml.XML;
+import org.apache.sis.xml.FreeTextMarshallingTest;
 import org.apache.sis.test.XMLTestCase;
 import org.apache.sis.test.DependsOn;
 import org.junit.Test;
 
 import static org.apache.sis.test.Assert.*;
-import static org.apache.sis.test.TestUtilities.date;
 import static org.apache.sis.test.TestUtilities.getSingleton;
 
 
 /**
- * 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 <a href="{@scmUrl gmd-data}/">here</a>.
+ * Tests {@link AbstractPositionalAccuracy}.
  *
  * @author  Cédric Briançon (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
@@ -51,7 +41,7 @@ import static org.apache.sis.test.TestUt
  * @module
  */
 @DependsOn(FreeTextMarshallingTest.class)
-public final strictfp class MetadataMarshallingTest extends XMLTestCase {
+public final strictfp class AbstractPositionalAccuracyTest extends XMLTestCase {
     /**
      * Returns the URL to the XML file of the given name.
      *
@@ -59,38 +49,18 @@ public final strictfp class MetadataMars
      * @return The URL to the given XML file.
      */
     private static URL getResource(final String filename) {
-        final URL resource = MetadataMarshallingTest.class.getResource(filename);
+        final URL resource = AbstractPositionalAccuracyTest.class.getResource(filename);
         assertNotNull(filename, resource);
         return resource;
     }
 
     /**
-     * Tests a collection that contains no element.
-     * This was used to cause a {@code NullPointerException} prior SIS-139 fix.
-     *
-     * @throws JAXBException If an error occurred during the during unmarshalling processes.
-     *
-     * @since 0.4
-     *
-     * @see <a href="https://issues.apache.org/jira/browse/SIS-139">SIS-139</a>
-     */
-    @Test
-    public void testEmptyCollection() throws JAXBException {
-        final String xml =
-                "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
-                "  <gmd:contact/>\n" +
-                "</gmd:MD_Metadata>";
-        final DefaultMetadata metadata = (DefaultMetadata) XML.unmarshal(xml);
-        assertTrue(metadata.getContacts().isEmpty());
-    }
-
-    /**
      * Tests the (un)marshalling of a text group with a default {@code <gco:CharacterString>} element.
      * This test is somewhat a duplicate of {@link FreeTextMarshallingTest}, but the context is more
      * elaborated.
      *
      * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/PositionalAccuracy.xml">PositionalAccuracy.xml</a></p>
+     * <a href="{@scmUrl metadata}/quality/PositionalAccuracy.xml">PositionalAccuracy.xml</a></p>
      *
      * @throws IOException   If an error occurred while reading the XML file.
      * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
@@ -99,7 +69,7 @@ public final strictfp class MetadataMars
      * @see FreeTextMarshallingTest
      */
     @Test
-    public void testPositionalAccuracy() throws IOException, JAXBException {
+    public void testXML() throws IOException, JAXBException {
         final URL    resource = getResource("PositionalAccuracy.xml");
         final Object metadata = XML.unmarshal(resource);
         assertInstanceOf("PositionalAccuracy.xml", AbstractElement.class, metadata);
@@ -122,65 +92,4 @@ public final strictfp class MetadataMars
          */
         assertXmlEquals(resource, marshal(metadata), "xmlns:*", "xsi:schemaLocation", "xsi:type");
     }
-
-    /**
-     * Tests the (un)marshalling of a metadata mixing elements from ISO 19115 and ISO 19115-2 standards.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/ProcessStep.xml">ProcessStep.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     */
-    @Test
-    public void testProcessStep() throws IOException, JAXBException {
-        final DefaultProcessing  processing   = new DefaultProcessing();
-        final DefaultProcessStep processStep  = new DefaultProcessStep("Some process step.");
-        processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
-        processStep.setProcessingInformation(processing);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(processStep);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("ProcessStep.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(processStep, unmarshal(DefaultProcessStep.class, xml));
-    }
-
-    /**
-     * Tests the (un)marshalling of a {@code <gmd:EX_Extent>} object.
-     * This test opportunistically tests setting {@code "gml:id"} value.
-     *
-     * <p><b>XML test file:</b>
-     * <a href="{@scmUrl gmd-data}/Extent.xml">Extent.xml</a></p>
-     *
-     * @throws IOException   If an error occurred while reading the XML file.
-     * @throws JAXBException If an error occurred during the during marshalling / unmarshalling processes.
-     *
-     * @since 0.4
-     */
-    @Test
-    public void testExtent() throws IOException, JAXBException {
-        final DefaultGeographicBoundingBox bbox = new DefaultGeographicBoundingBox(-99, -79, 14.9844, 31);
-        bbox.getIdentifierMap().put(IdentifierSpace.ID, "bbox");
-        final DefaultTemporalExtent temporal = new DefaultTemporalExtent();
-        if (PENDING_FUTURE_SIS_VERSION) {
-            // This block needs sis-temporal module.
-            temporal.setBounds(date("2010-01-27 13:26:10"), date("2010-08-27 13:26:10"));
-        }
-        final DefaultExtent extent = new DefaultExtent(null, bbox, null, temporal);
-        /*
-         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
-         */
-        final String xml = marshal(extent);
-        assertTrue(xml.startsWith("<?xml"));
-        assertXmlEquals(getResource("Extent.xml"), xml, "xmlns:*", "xsi:schemaLocation");
-        /*
-         * Final comparison: ensure that we didn't lost any information.
-         */
-        assertEquals(extent, unmarshal(DefaultExtent.class, xml));
-    }
 }

Modified: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -55,13 +55,15 @@ import org.junit.BeforeClass;
     org.apache.sis.xml.FreeTextMarshallingTest.class,
     org.apache.sis.xml.NilReasonMarshallingTest.class,
     org.apache.sis.xml.AnchorMarshallingTest.class,
-    org.apache.sis.xml.ObjectReferenceMarshallingTest.class,
+    org.apache.sis.xml.UUIDMarshallingTest.class,
+    org.apache.sis.xml.XLinkMarshallingTest.class,
 
     // ISO implementations.
     org.apache.sis.metadata.iso.citation.DefaultCitationDateTest.class,
     org.apache.sis.metadata.iso.citation.DefaultCitationTest.class,
     org.apache.sis.metadata.iso.maintenance.DefaultScopeDescriptionTest.class,
     org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBoxTest.class,
+    org.apache.sis.metadata.iso.extent.DefaultExtentTest.class,
     org.apache.sis.metadata.iso.extent.ExtentsTest.class,
     org.apache.sis.metadata.iso.spatial.DefaultGeorectifiedTest.class,
     org.apache.sis.metadata.iso.identification.DefaultKeywordsTest.class,
@@ -70,13 +72,13 @@ import org.junit.BeforeClass;
     org.apache.sis.metadata.iso.identification.DefaultBrowseGraphicTest.class,
     org.apache.sis.metadata.iso.identification.DefaultDataIdentificationTest.class,
     org.apache.sis.metadata.iso.quality.AbstractElementTest.class,
+    org.apache.sis.metadata.iso.quality.AbstractPositionalAccuracyTest.class,
+    org.apache.sis.metadata.iso.lineage.DefaultLineageTest.class,
+    org.apache.sis.metadata.iso.lineage.DefaultProcessStepTest.class,
     org.apache.sis.metadata.iso.ImmutableIdentifierTest.class,
-    org.apache.sis.metadata.iso.AllMetadataTest.class,
-
-    // XML marshalling (integration tests).
-    org.apache.sis.xml.CustomMetadataTest.class,
-    org.apache.sis.xml.ImageryMarshallingTest.class,
-    org.apache.sis.xml.MetadataMarshallingTest.class
+    org.apache.sis.metadata.iso.DefaultMetadataTest.class,
+    org.apache.sis.metadata.iso.CustomMetadataTest.class,
+    org.apache.sis.metadata.iso.AllMetadataTest.class
 })
 public final strictfp class MetadataTestSuite extends TestSuite {
     /**

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -29,17 +29,17 @@ import static org.apache.sis.test.Assert
 
 
 /**
- * Tests the XML marshalling of object having {@code xlink} or {@code uuid} attributes.
+ * Tests the XML marshalling of object having {@code uuid} or {@code uuidref} attributes.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.3 (derived from geotk-3.18)
- * @version 0.3
+ * @version 0.4
  * @module
  *
  * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-165">GEOTK-165</a>
  */
 @DependsOn(NilReasonMarshallingTest.class)
-public final strictfp class ObjectReferenceMarshallingTest extends XMLTestCase {
+public final strictfp class UUIDMarshallingTest extends XMLTestCase {
     /**
      * A random UUID for the tests in this class.
      */
@@ -50,8 +50,7 @@ public final strictfp class ObjectRefere
      */
     private static final String IDENTIFIED_XML =
             "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO + '"' +
-                            " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
+                            " xmlns:gco=\""   + Namespaces.GCO + "\">\n" +
             "  <gmd:title>\n" +
             "    <gco:CharacterString>My data</gco:CharacterString>\n" +
             "  </gmd:title>\n" +
@@ -69,9 +68,8 @@ public final strictfp class ObjectRefere
      * This XML declares the method body anyway, which is kind of contradictory with usage of reference.
      */
     private static final String REFERENCED_XML_WITH_BODY =
-            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD   + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO   + '"' +
-                            " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
+            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD + '"' +
+                            " xmlns:gco=\""   + Namespaces.GCO + "\">\n" +
             "  <gmd:title>\n" +
             "    <gco:CharacterString>My data</gco:CharacterString>\n" +
             "  </gmd:title>\n" +
@@ -88,9 +86,8 @@ public final strictfp class ObjectRefere
      * A XML with a {@code uuidref} identifier in the {@code <gmd:series>} element.
      */
     private static final String REFERENCED_XML =
-            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD   + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO   + '"' +
-                            " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
+            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD + '"' +
+                            " xmlns:gco=\""   + Namespaces.GCO + "\">\n" +
             "  <gmd:title>\n" +
             "    <gco:CharacterString>My data</gco:CharacterString>\n" +
             "  </gmd:title>\n" +

Copied: sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java (from r1550461, sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java)
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java?p2=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java&p1=sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java&r1=1550461&r2=1550841&rev=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/ObjectReferenceMarshallingTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -16,218 +16,132 @@
  */
 package org.apache.sis.xml;
 
-import java.lang.reflect.Proxy;
+import java.util.Collections;
+import java.net.URI;
+import java.net.URISyntaxException;
 import javax.xml.bind.JAXBException;
-import org.opengis.metadata.citation.Series;
-import org.opengis.metadata.citation.Citation;
-import org.apache.sis.test.DependsOnMethod;
+import org.opengis.metadata.identification.Identification;
+import org.apache.sis.metadata.iso.DefaultMetadata;
+import org.apache.sis.metadata.iso.identification.DefaultDataIdentification;
+import org.apache.sis.util.iso.SimpleInternationalString;
+import org.apache.sis.util.ComparisonMode;
 import org.apache.sis.test.DependsOn;
 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 the XML marshalling of object having {@code xlink} or {@code uuid} attributes.
+ * Tests the XML marshalling of object having {@code xlink} attribute.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @since   0.3 (derived from geotk-3.18)
- * @version 0.3
+ * @since   0.4 (derived from geotk-3.18)
+ * @version 0.4
  * @module
  *
  * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-165">GEOTK-165</a>
  */
 @DependsOn(NilReasonMarshallingTest.class)
-public final strictfp class ObjectReferenceMarshallingTest extends XMLTestCase {
+public final strictfp class XLinkMarshallingTest extends XMLTestCase {
     /**
-     * A random UUID for the tests in this class.
+     * A XML with a {@code xlink:href} without element definition.
      */
-    private static final String UUID_VALUE = "f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf";
-
-    /**
-     * A XML with a {@code uuid} identifier in the {@code <gmd:CI_Series>} element.
-     */
-    private static final String IDENTIFIED_XML =
-            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO + '"' +
+    private static final String LINK_ONLY_XML =
+            "<gmd:MD_Metadata xmlns:gmd=\""   + Namespaces.GMD + '"' +
                             " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
-            "  <gmd:title>\n" +
-            "    <gco:CharacterString>My data</gco:CharacterString>\n" +
-            "  </gmd:title>\n" +
-            "  <gmd:series>\n" +
-            "    <gmd:CI_Series uuid=\"" + UUID_VALUE + "\">\n" +
-            "      <gmd:name>\n" +
-            "        <gco:CharacterString>My aggregate dataset</gco:CharacterString>\n" +
-            "      </gmd:name>\n" +
-            "    </gmd:CI_Series>\n" +
-            "  </gmd:series>\n" +
-            "</gmd:CI_Citation>";
+            "  <gmd:identificationInfo xlink:href=\"http://test.net\"/>\n" +
+            "</gmd:MD_Metadata>";
 
     /**
-     * A XML with a {@code uuidref} identifier in the {@code <gmd:series>} element.
-     * This XML declares the method body anyway, which is kind of contradictory with usage of reference.
+     * A XML with a {@code xlink:href} without element definition.
      */
-    private static final String REFERENCED_XML_WITH_BODY =
-            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD   + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO   + '"' +
-                            " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
-            "  <gmd:title>\n" +
-            "    <gco:CharacterString>My data</gco:CharacterString>\n" +
-            "  </gmd:title>\n" +
-            "  <gmd:series uuidref=\"" + UUID_VALUE + "\">\n" +
-            "    <gmd:CI_Series>\n" +
-            "      <gmd:name>\n" +
-            "        <gco:CharacterString>My aggregate dataset</gco:CharacterString>\n" +
-            "      </gmd:name>\n" +
-            "    </gmd:CI_Series>\n" +
-            "  </gmd:series>\n" +
-            "</gmd:CI_Citation>";
-
-    /**
-     * A XML with a {@code uuidref} identifier in the {@code <gmd:series>} element.
-     */
-    private static final String REFERENCED_XML =
-            "<gmd:CI_Citation xmlns:gmd=\""   + Namespaces.GMD   + '"' +
-                            " xmlns:gco=\""   + Namespaces.GCO   + '"' +
+    private static final String LINK_WITH_ELEMENT_XML =
+            "<gmd:MD_Metadata xmlns:gmd=\""   + Namespaces.GMD + '"' +
+                            " xmlns:gco=\""   + Namespaces.GCO + '"' +
                             " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" +
-            "  <gmd:title>\n" +
-            "    <gco:CharacterString>My data</gco:CharacterString>\n" +
-            "  </gmd:title>\n" +
-            "  <gmd:series uuidref=\"" + UUID_VALUE + "\"/>\n" +
-            "</gmd:CI_Citation>";
+            "  <gmd:identificationInfo xlink:href=\"http://test.net\">\n" +
+            "    <gmd:MD_DataIdentification>\n" +
+            "      <gmd:abstract>\n" +
+            "        <gco:CharacterString>This is a test.</gco:CharacterString>\n" +
+            "      </gmd:abstract>\n" +
+            "    </gmd:MD_DataIdentification>\n" +
+            "  </gmd:identificationInfo>\n" +
+            "</gmd:MD_Metadata>";
+
+    /**
+     * Verifies if the given metadata contains the expected {@code xlink:href} attribute value.
+     *
+     * @param isNilExpected {@code true} if the identification info is expected to be a {@link NilObject} instance.
+     * @param metadata The metadata to verify.
+     */
+    private static void verify(final boolean isNilExpected, final DefaultMetadata metadata) {
+        final Identification identification = getSingleton(metadata.getIdentificationInfo());
+        assertEquals("NilObject", isNilExpected, identification instanceof NilObject);
+        assertInstanceOf("Identification", IdentifiedObject.class, identification);
+        final XLink xlink = ((IdentifiedObject) identification).getIdentifierMap().getSpecialized(IdentifierSpace.XLINK);
+        assertEquals("xlink:href", "http://test.net", xlink.getHRef().toString());
+    }
 
     /**
-     * Tests (un)marshalling of an object identified by the {@code uuid} attribute.
-     * The element of interest for this test is the {@code "uuid"} attribute value
-     * in the {@code <gmd:CI_Series>} element of the following XML fragment:
+     * Tests (un)marshalling of an object with a {@code xlink:href} attribute without element definition.
+     * The XML fragment is:
      *
      * {@preformat xml
-     *   <gmd:CI_Citation>
-     *     <gmd:title>
-     *       <gco:CharacterString>My data</gco:CharacterString>
-     *     </gmd:title>
-     *     <gmd:series>
-     *       <gmd:CI_Series uuid="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf">
-     *         <gmd:name>
-     *           <gco:CharacterString>My aggregate dataset</gco:CharacterString>
-     *         </gmd:name>
-     *       </gmd:CI_Series>
-     *     </gmd:series>
-     *   </gmd:CI_Citation>
+     *   <gmd:MD_Metadata>
+     *     <gmd:identificationInfo xlink:href="http://test.net"/>
+     *   </gmd:MD_Metadata>
      * }
      *
-     * On an implementation note, the {@code uuid} and other attributes of the {@code <gmd:CI_Series>}
-     * elements are handled by {@link org.apache.sis.internal.jaxb.gco.PropertyType}.
-     *
      * @throws JAXBException Should never happen.
+     * @throws URISyntaxException Should never happen.
      */
     @Test
-    public void testIdentification() throws JAXBException {
-        final Citation citation = (Citation) XML.unmarshal(IDENTIFIED_XML);
-        assertEquals("title", "My data", citation.getTitle().toString());
-        /*
-         * Programmatic verification of the Series properties,
-         * which is the main object of interest in this test.
-         */
-        final Series series = citation.getSeries();
-        assertFalse("Unexpected proxy", Proxy.isProxyClass(series.getClass()));
-        assertInstanceOf("Expected IdentifiedObject", IdentifiedObject.class, series);
-        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
-        assertEquals("series", "My aggregate dataset",  series.getName().toString());
-        assertNull  ("href", map.get(IdentifierSpace.HREF));
-        assertEquals(UUID_VALUE, String.valueOf(map.get(IdentifierSpace.UUID)));
-        /*
-         * Marshal the object back to XML and compare with the original string
-         * supplied to this method.
-         */
-        final String actual = XML.marshal(citation);
-        assertXmlEquals(IDENTIFIED_XML, actual, "xmlns:*");
-        assertEquals(citation, XML.unmarshal(actual));
+    public void testLinkOnly() throws JAXBException, URISyntaxException {
+        final XLink xlink = new XLink();
+        xlink.setHRef(new URI("http://test.net"));
+        final DefaultDataIdentification identification = new DefaultDataIdentification();
+        identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
+        final DefaultMetadata metadata = new DefaultMetadata();
+        metadata.setIdentificationInfo(Collections.singleton(identification));
+
+        assertXmlEquals(LINK_ONLY_XML, XML.marshal(metadata), "xmlns:*");
+        verify(true, unmarshal(DefaultMetadata.class, LINK_ONLY_XML));
     }
 
     /**
-     * Tests (un)marshalling of an object referenced by a {@code uuidref} attribute.
-     * This test does not try to resolve the reference, but only check that the identifier is properly saved.
-     *
-     * <p>The element of interest for this test is the {@code "uuidref"} part
-     * in the {@code <gmd:series>} property of the following XML fragment:</p>
+     * Tests (un)marshalling of an object with a {@code xlink:href} attribute with an element definition.
+     * The XML fragment is:
      *
      * {@preformat xml
-     *   <gmd:CI_Citation>
-     *     <gmd:title>
-     *       <gco:CharacterString>My data</gco:CharacterString>
-     *     </gmd:title>
-     *     <gmd:series uuidref="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf">
-     *       <gmd:CI_Series>
-     *         <gmd:name>
-     *           <gco:CharacterString>My aggregate dataset</gco:CharacterString>
-     *         </gmd:name>
-     *       </gmd:CI_Series>
-     *     </gmd:series>
-     *   </gmd:CI_Citation>
+     *   <gmd:MD_Metadata>
+     *     <gmd:identificationInfo xlink:href="http://test.net">
+     *       <gmd:MD_DataIdentification>
+     *         <gmd:abstract>
+     *           <gco:CharacterString>This is a test.</gco:CharacterString>
+     *         </gmd:abstract>
+     *       </gmd:MD_DataIdentification>
+     *     </gmd:identificationInfo>
+     *   </gmd:MD_Metadata>
      * }
      *
-     * On an implementation note, the {@code uuidref}, {@code xlink:href} and other attributes of the
-     * {@code <gmd:series>} element are handled by {@link org.apache.sis.internal.jaxb.gco.PropertyType}.
-     *
-     * @throws JAXBException Should never happen.
-     */
-    @Test
-    public void testReference() throws JAXBException {
-        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML_WITH_BODY);
-        assertEquals("Citation.title",  "My data", citation.getTitle().toString());
-        /*
-         * Programmatic verification of the Series properties,
-         * which is the main object of interest in this test.
-         */
-        final Series series = citation.getSeries();
-        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
-        assertFalse     ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
-        assertEquals    ("Citation.series.name", "My aggregate dataset", series.getName().toString());
-        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
-        assertNull  ("href",             map.get(IdentifierSpace.HREF));
-        assertEquals("uuid", UUID_VALUE, map.get(IdentifierSpace.UUID));
-        /*
-         * Marshal the object back to XML and compare with the expected result. The result shall be
-         * slightly different than the original XML, since the UUID in the <gmd:series> element shall
-         * move to the <gmd:CI_Series> element. This is the expected behavior because we have a fully
-         * constructed object, not a reference to an object defined elsewhere.
-         */
-        final String actual = XML.marshal(citation);
-        assertXmlEquals(IDENTIFIED_XML, actual, "xmlns:*");
-        assertEquals(citation, XML.unmarshal(actual));
-    }
-
-    /**
-     * The same test than {@link #testReference()}, except that the {@code <gmd:CI_Series>} element is empty.
-     * This situation shall force the creation of a new, empty, element for storing the {@code uuidref} information.
-     *
      * @throws JAXBException Should never happen.
+     * @throws URISyntaxException Should never happen.
      */
     @Test
-    @DependsOnMethod("testReference")
-    public void testReferenceInEmptyObject() throws JAXBException {
-        final Citation citation = (Citation) XML.unmarshal(REFERENCED_XML);
-        assertEquals("Citation.title",  "My data", citation.getTitle().toString());
-        /*
-         * Programmatic verification of the Series properties,
-         * which is the main object of interest in this test.
-         */
-        final Series series = citation.getSeries();
-        assertInstanceOf("Citation.series", IdentifiedObject.class, series);
-        assertNull      ("Citation.series.name", series.getName());
-        assertTrue      ("Citation.series.isProxy", Proxy.isProxyClass(series.getClass()));
-        assertInstanceOf("Citation.series", NilObject.class, series);
-        assertEquals    ("Series[{gco:uuid=“" + UUID_VALUE + "”}]", series.toString());
-        final IdentifierMap map = ((IdentifiedObject) series).getIdentifierMap();
-        assertNull  ("href",             map.get(IdentifierSpace.HREF));
-        assertEquals("uuid", UUID_VALUE, map.get(IdentifierSpace.UUID));
-        /*
-         * Marshal the object back to XML and compare with the expected result.
-         */
-        final String actual = XML.marshal(citation);
-        assertXmlEquals(REFERENCED_XML, actual, "xmlns:*");
-        assertEquals(citation, XML.unmarshal(actual));
+    public void testWithElement() throws JAXBException, URISyntaxException {
+        final XLink xlink = new XLink();
+        xlink.setHRef(new URI("http://test.net"));
+        final DefaultDataIdentification identification = new DefaultDataIdentification();
+        identification.getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, xlink);
+        identification.setAbstract(new SimpleInternationalString("This is a test."));
+        final DefaultMetadata metadata = new DefaultMetadata();
+        metadata.setIdentificationInfo(Collections.singleton(identification));
+
+        assertXmlEquals(LINK_WITH_ELEMENT_XML, XML.marshal(metadata), "xmlns:*");
+        final DefaultMetadata unmarshal = unmarshal(DefaultMetadata.class, LINK_WITH_ELEMENT_XML);
+        verify(false, unmarshal);
+        assertTrue(metadata.equals(unmarshal, ComparisonMode.DEBUG));
     }
 }

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java?rev=1550841&r1=1550840&r2=1550841&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/xml/MimeTypeDetectorTest.java [UTF-8] Fri Dec 13 21:57:35 2013
@@ -19,7 +19,7 @@ package org.apache.sis.internal.storage.
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.StringReader;
-import org.apache.sis.xml.MetadataMarshallingTest;
+import org.apache.sis.metadata.iso.extent.DefaultExtentTest;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
@@ -65,8 +65,7 @@ public final strictfp class MimeTypeDete
     @Test
     @DependsOnMethod("testGMDFromString")
     public void testGMDFromInputStream() throws IOException {
-        final InputStream in = MetadataMarshallingTest.class.getResourceAsStream("Extent.xml");
-        assertNotNull("Can not read Extent.xml", in);
+        final InputStream in = DefaultExtentTest.getResource("Extent.xml").openStream();
         assertEquals('<', in.read());
         assertEquals('?', in.read());
         final MimeTypeDetector detector = new MimeTypeDetector() {



Mime
View raw message