Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/identification/DefaultServiceIdentificationTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -18,24 +18,27 @@ package org.apache.sis.metadata.iso.iden import javax.xml.bind.JAXBException; import org.opengis.util.NameFactory; +import org.opengis.parameter.ParameterDescriptor; import org.opengis.metadata.citation.Citation; import org.apache.sis.internal.geoapi.evolution.UnsupportedCodeList; +import org.apache.sis.metadata.iso.citation.DefaultCitation; import org.apache.sis.internal.system.DefaultFactories; -import org.apache.sis.util.ComparisonMode; import org.apache.sis.xml.NilReason; 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 java.util.Collections.singleton; +import static org.apache.sis.test.MetadataAssert.*; +import static org.apache.sis.test.TestUtilities.getSingleton; /** * Tests {@link DefaultServiceIdentification}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.5 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.5 * @module */ @@ -50,11 +53,17 @@ public final strictfp class DefaultServi private static final String XML_FILE = "ServiceIdentification.xml"; /** + * Same as {@link #XML_FILE} but using legacy ISO 19139:2007 schema. + */ + private static final String XML_FILE_LEGACY = "ServiceIdentification (legacy).xml"; + + /** * Creates the service identification to use for testing purpose. */ private static DefaultServiceIdentification create() { final NameFactory factory = DefaultFactories.forBuildin(NameFactory.class); - final DefaultCoupledResource resource = DefaultCoupledResourceTest.create(); + final DefaultCoupledResource resource = DefaultCoupledResourceTest.create(factory); + resource.setResourceReferences(singleton(new DefaultCitation("WMS specification"))); final DefaultServiceIdentification id = new DefaultServiceIdentification( factory.createGenericName(null, "Web Map Server"), // serviceType NilReason.MISSING.createNilObject(Citation.class), // citation @@ -67,13 +76,31 @@ public final strictfp class DefaultServi } /** - * Tests the marshalling of a service metadata. - * - * @throws JAXBException if an error occurred during the during marshalling process. + * Compare values of the given service identifications against the value expected for the + * instance created by {@link #create()} method. */ - @Test - public void testMarshal() throws JAXBException { - assertMarshalEqualsFile(XML_FILE, create(), "xlmns:*", "xsi:schemaLocation"); + private static void verify(final DefaultServiceIdentification id) { + assertEquals("serviceTypeVersion", "1.0", getSingleton(id.getServiceTypeVersions())); + assertEquals("serviceType", "Web Map Server", String.valueOf(id.getServiceType())); + assertEquals("abstract", "A dummy service for testing purpose.", String.valueOf(id.getAbstract())); + assertEquals("citation", NilReason.MISSING, NilReason.forObject(id.getCitation())); + assertEquals("couplingType", UnsupportedCodeList.valueOf("loose"), id.getCouplingType()); + + final DefaultCoupledResource resource = getSingleton(id.getCoupledResources()); +// assertEquals("scopedName", "mySpace:ABC-123", …) skipped because not present in new ISO 19115-3:2016. +// assertEquals("resourceReference", "WMS specification", …) skipped because not present in legacy ISO 19139:2007. + + final DefaultOperationMetadata op = resource.getOperation(); + assertNotNull("operation", op); + assertEquals("operationName", "Get Map", op.getOperationName()); + assertEquals("distributedComputingPlatform", UnsupportedCodeList.valueOf("WEB_SERVICES"), getSingleton(op.getDistributedComputingPlatforms())); + assertEquals("connectPoints", NilReason.MISSING, NilReason.forObject(getSingleton(op.getConnectPoints()))); + + final ParameterDescriptor<?> param = getSingleton(op.getParameters()); + assertEquals("name", "Version", String.valueOf(param.getName())); + assertEquals("minimumOccurs", 0, param.getMinimumOccurs()); + assertEquals("maximumOccurs", 1, param.getMaximumOccurs()); +// assertEquals("direction", ParameterDirection.IN, param.getDirection()); } /** @@ -86,6 +113,42 @@ public final strictfp class DefaultServi */ @Test public void testUnmarshal() throws JAXBException { - assertTrue(create().equals(unmarshalFile(DefaultServiceIdentification.class, XML_FILE), ComparisonMode.DEBUG)); + final DefaultServiceIdentification id = unmarshalFile(DefaultServiceIdentification.class, XML_FILE); + verify(id); + final DefaultCoupledResource resource = getSingleton(id.getCoupledResources()); + assertTitleEquals("resourceReference", "WMS specification", getSingleton(resource.getResourceReferences())); + } + + /** + * Tests the unmarshalling of a service metadata from legacy ISO 19139:2007 schema. + * + * @throws JAXBException if an error occurred during the during unmarshalling process. + */ + @Test + public void testUnmarshalLegacy() throws JAXBException { + final DefaultServiceIdentification id = unmarshalFile(DefaultServiceIdentification.class, XML_FILE_LEGACY); + verify(id); + final DefaultCoupledResource resource = getSingleton(id.getCoupledResources()); + assertEquals("scopedName", "mySpace:ABC-123", String.valueOf(resource.getScopedName())); + } + + /** + * Tests the marshalling of a service metadata. + * + * @throws JAXBException if an error occurred during the during marshalling process. + */ + @Test + public void testMarshal() throws JAXBException { + assertMarshalEqualsFile(XML_FILE, create(), "xmlns:*", "xsi:schemaLocation"); + } + + /** + * Tests the marshalling of a service metadata to legacy ISO 19139:2007 schema. + * + * @throws JAXBException if an error occurred during the during marshalling process. + */ + @Test + public void testMarshalLegacy() throws JAXBException { + assertMarshalEqualsFile(XML_FILE_LEGACY, create(), VERSION_2007, "xmlns:*", "xsi:schemaLocation"); } }
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultLineageTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -16,13 +16,15 @@ */ package org.apache.sis.metadata.iso.lineage; -import java.util.Arrays; import javax.xml.bind.JAXBException; +import org.opengis.metadata.lineage.Source; +import org.apache.sis.xml.Namespaces; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.util.iso.SimpleInternationalString; import org.apache.sis.metadata.iso.DefaultIdentifier; +import org.apache.sis.test.DependsOnMethod; +import org.apache.sis.test.TestUtilities; 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.*; @@ -33,31 +35,74 @@ import static org.apache.sis.test.Assert * {@code "gmi"} namespace that GeoAPI merged with the object of same name in the {@code "gmd"} namespace. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @version 1.0 * @since 0.3 * @module */ 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. + * Create a lineage to marshal. If {@code extension} is {@code false}, then this method uses + * only properties defined in ISO 19115-1. If {@code extension} is {@code true}, then this + * method adds an ISO 19115-2 property. + */ + private static DefaultLineage create(final boolean extension) { + final DefaultLineage lineage = new DefaultLineage(); + final DefaultSource source = new DefaultSource(); + source.setDescription(new SimpleInternationalString("Description of source data level.")); + lineage.getSources().add(source); + if (extension) { + source.setProcessedLevel(new DefaultIdentifier("DummyLevel")); + } + return lineage; + } + + /** + * Verifies the unmarshalling result. + */ + private static void verify(final DefaultLineage lineage) { + final Source source = TestUtilities.getSingleton(lineage.getSources()); + assertEquals("source.description", "Description of source data level.", String.valueOf(source.getDescription())); + } + + /** + * Tests the marshalling of a {@code "mrl:LI_Source"} element. + * If this case, the test uses only ISO 19115-1 elements (no ISO 19115-2). + * Consequently the XML name shall be {@code "mrl:LI_Source"}. * * @throws JAXBException if an error occurred while marshalling the XML. */ @Test public void testSource() throws JAXBException { - final DefaultLineage lineage = new DefaultLineage(); - final DefaultSource source = new DefaultSource(); - source.setDescription(new SimpleInternationalString("Description of source data level.")); - lineage.setSources(Arrays.asList(source)); - /* - * If this simpler case, only ISO 19115 elements are defined (no ISO 19115-2). - * Consequently the XML name shall be "gmd:LI_Source". - */ - String actual = XML.marshal(lineage); + String actual = marshal(create(false)); assertXmlEquals( - "<gmd:LI_Lineage xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<mrl:LI_Lineage xmlns:mrl=\"" + Namespaces.MRL + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + + " <mrl:source>\n" + + " <mrl:LI_Source>\n" + + " <mrl:description>\n" + + " <gco:CharacterString>Description of source data level.</gco:CharacterString>\n" + + " </mrl:description>\n" + + " </mrl:LI_Source>\n" + + " </mrl:source>\n" + + "</mrl:LI_Lineage>", actual, "xmlns:*"); + + verify(unmarshal(DefaultLineage.class, actual)); + } + + /** + * Tests the marshalling of a legacy {@code "gmd:LI_Source"} element. + * If this case, the test uses only ISO 19115-1 elements (no ISO 19115-2). + * Consequently the legacy XML name shall be {@code "gmd:LI_Source"}. + * + * @throws JAXBException if an error occurred while marshalling the XML. + */ + @Test + @DependsOnMethod("testSource") + public void testLegacySource() throws JAXBException { + String actual = marshal(create(false), VERSION_2007); + assertXmlEquals( + "<gmd:LI_Lineage xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' + + " xmlns:gco=\"" + LegacyNamespaces.GCO + "\">\n" + " <gmd:source>\n" + " <gmd:LI_Source>\n" + " <gmd:description>\n" + @@ -66,15 +111,61 @@ public final strictfp class DefaultLinea " </gmd:LI_Source>\n" + " </gmd:source>\n" + "</gmd:LI_Lineage>", actual, "xmlns:*"); - /* - * Now add a ISO 19115-2 specific property. The XML name shall become "gmi:LE_Source". - */ - source.setProcessedLevel(new DefaultIdentifier("DummyLevel")); - actual = XML.marshal(lineage); + + verify(unmarshal(DefaultLineage.class, actual)); + } + + /** + * Tests the marshalling of a {@code "mrl:LE_Source"} element. + * This test starts with the same metadata than {@link #testSource()} and adds an + * ISO 19115-2 specific property. Consequently the XML name, which was originally + * {@code "mrl:LI_Source"}, shall become {@code "mrl:LE_Source"}. + * + * @throws JAXBException if an error occurred while marshalling the XML. + */ + @Test + @DependsOnMethod("testSource") + public void testSourceImagery() throws JAXBException { + String actual = marshal(create(true)); assertXmlEquals( - "<gmd:LI_Lineage xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gmi=\"" + Namespaces.GMI + '"' + + "<mrl:LI_Lineage xmlns:mrl=\"" + Namespaces.MRL + '"' + + " xmlns:mcc=\"" + Namespaces.MCC + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + + " <mrl:source>\n" + + " <mrl:LE_Source>\n" + + " <mrl:description>\n" + + " <gco:CharacterString>Description of source data level.</gco:CharacterString>\n" + + " </mrl:description>\n" + + " <mrl:processedLevel>\n" + + " <mcc:MD_Identifier>\n" + + " <mcc:code>\n" + + " <gco:CharacterString>DummyLevel</gco:CharacterString>\n" + + " </mcc:code>\n" + + " </mcc:MD_Identifier>\n" + + " </mrl:processedLevel>\n" + + " </mrl:LE_Source>\n" + + " </mrl:source>\n" + + "</mrl:LI_Lineage>", actual, "xmlns:*"); + + verify(unmarshal(DefaultLineage.class, actual)); + } + + /** + * Tests the marshalling of a legacy {@code "gmi:LE_Source"} element. + * This test starts with the same metadata than {@link #testLegacySource()} and adds + * an ISO 19115-2 specific property. Consequently the XML name, which was originally + * {@code "gmd:LI_Source"}, shall become {@code "gmi:LE_Source"}. + * + * @throws JAXBException if an error occurred while marshalling the XML. + */ + @Test + @DependsOnMethod("testLegacySource") + public void testLegacySourceImagery() throws JAXBException { + String actual = marshal(create(true), VERSION_2007); + assertXmlEquals( + "<gmd:LI_Lineage xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' + + " xmlns:gmi=\"" + LegacyNamespaces.GMI + '"' + + " xmlns:gco=\"" + LegacyNamespaces.GCO + "\">\n" + " <gmd:source>\n" + " <gmi:LE_Source>\n" + " <gmd:description>\n" + @@ -90,5 +181,7 @@ public final strictfp class DefaultLinea " </gmi:LE_Source>\n" + " </gmd:source>\n" + "</gmd:LI_Lineage>", actual, "xmlns:*"); + + verify(unmarshal(DefaultLineage.class, actual)); } } Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/lineage/DefaultProcessStepTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -19,7 +19,9 @@ package org.apache.sis.metadata.iso.line import javax.xml.bind.JAXBException; import org.apache.sis.util.iso.SimpleInternationalString; import org.apache.sis.internal.jaxb.gmi.LE_ProcessStep; +import org.apache.sis.metadata.iso.DefaultIdentifier; import org.apache.sis.test.XMLTestCase; +import org.apache.sis.util.Version; import org.junit.Test; import static org.opengis.test.Assert.*; @@ -30,17 +32,12 @@ import static org.opengis.test.Assert.*; * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.8 + * @version 1.0 * @since 0.3 * @module */ public final strictfp class DefaultProcessStepTest extends XMLTestCase { /** - * An XML file in this package containing a process step definition. - */ - private static final String XML_FILE = "ProcessStep.xml"; - - /** * Tests the (un)marshalling of a metadata mixing elements from ISO 19115 and ISO 19115-2 standards. * * <p><b>XML test file:</b> @@ -50,21 +47,40 @@ public final strictfp class DefaultProce */ @Test public void testXML() throws JAXBException { + roundtrip("ProcessStep.xml", VERSION_2014); + } + + /** + * Tests the (un)marshalling of a metadata in legacy ISO 19139:2007 document. + * This test uses the same metadata than {@link #testXML()}. + * + * @throws JAXBException if an error occurred during the during marshalling / unmarshalling processes. + */ + @Test + public void testLegacyXML() throws JAXBException { + roundtrip("ProcessStep (legacy).xml", VERSION_2007); + } + + /** + * Tests (un)marshalling in the given version. + */ + private void roundtrip(final String filename, final Version version) throws JAXBException { final DefaultProcessing processing = new DefaultProcessing(); final DefaultProcessStep processStep = new DefaultProcessStep("Some process step."); processing.setProcedureDescription(new SimpleInternationalString("Some procedure.")); + processing.setIdentifier(new DefaultIdentifier("P4")); processStep.setProcessingInformation(processing); /* * XML marshalling, and compare with the content of "ProcessStep.xml" file. */ - assertMarshalEqualsFile(XML_FILE, processStep, "xlmns:*", "xsi:schemaLocation"); + assertMarshalEqualsFile(filename, processStep, version, "xmlns:*", "xsi:schemaLocation"); /* * XML unmarshalling: ensure that we didn't lost any information. * Note that since the XML uses the <gmi:…> namespace, we got an instance of LE_ProcessStep, which * in SIS implementation does not carry any useful information; it is just a consequence of the way * namespaces are managed. We will convert to the parent DefaultProcessStep type before comparison. */ - DefaultProcessStep step = unmarshalFile(DefaultProcessStep.class, XML_FILE); + DefaultProcessStep step = unmarshalFile(DefaultProcessStep.class, filename); assertInstanceOf("The unmarshalled object is expected to be in GMI namespace.", LE_ProcessStep.class, step); step = new DefaultProcessStep(step); assertEquals(processStep, step); Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/iso/quality/AbstractPositionalAccuracyTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -18,10 +18,13 @@ package org.apache.sis.metadata.iso.qual import java.util.Locale; import javax.xml.bind.JAXBException; +import org.opengis.metadata.quality.Result; import org.opengis.util.InternationalString; import org.apache.sis.xml.FreeTextMarshallingTest; +import org.apache.sis.util.Version; import org.apache.sis.test.XMLTestCase; import org.apache.sis.test.DependsOn; +import org.junit.Ignore; import org.junit.Test; import static org.opengis.test.Assert.*; @@ -33,18 +36,14 @@ import static org.apache.sis.test.TestUt * * @author Cédric Briançon (Geomatys) * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ @DependsOn(FreeTextMarshallingTest.class) public final strictfp class AbstractPositionalAccuracyTest extends XMLTestCase { /** - * An XML file in this package containing a positional accuracy definition. - */ - private static final String XML_FILE = "PositionalAccuracy.xml"; - - /** * 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. @@ -54,12 +53,34 @@ public final strictfp class AbstractPosi * * @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 <a href="https://issues.apache.org/jira/browse/SIS-394">Issue SIS-394</a> * @see FreeTextMarshallingTest */ @Test + @Ignore("Depends on SIS-394") public void testXML() throws JAXBException { - final AbstractElement metadata = unmarshalFile(AbstractElement.class, XML_FILE); + roundtrip("PositionalAccuracy.xml", VERSION_2014); + } + + /** + * Tests the (un)marshalling of a text group from/to legacy ISO 19139:2007 schema. + * + * @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 <a href="https://issues.apache.org/jira/browse/SIS-399">SIS-399</a> + */ + @Test + public void testLegacyXML() throws JAXBException { + roundtrip("PositionalAccuracy (legacy).xml", VERSION_2007); + } + + /** + * Unmarshals the given file and verify the content. + * Then marshals the object and verify that we get equivalent XML. + */ + private void roundtrip(final String filename, final Version version) throws JAXBException { + final AbstractElement metadata = unmarshalFile(AbstractElement.class, filename); final InternationalString nameOfMeasure = getSingleton(metadata.getNamesOfMeasure()); /* * Programmatic verification of the text group. @@ -72,11 +93,12 @@ public final strictfp class AbstractPosi * 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(metadata.getResults())); + final Result result = getSingleton(metadata.getResults()); + assertInstanceOf("Wrong value for <gmd:result>", DefaultConformanceResult.class, result); + assertEquals("result.pass", Boolean.TRUE, ((DefaultConformanceResult) result).pass()); /* * Marshalling: ensure that we didn't lost any information. */ - assertMarshalEqualsFile(XML_FILE, metadata, "xmlns:*", "xsi:schemaLocation", "xsi:type"); + assertMarshalEqualsFile(filename, metadata, version, "xmlns:*", "xsi:schemaLocation", "xsi:type"); } } Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java?rev=1825355&r1=1825261&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/xml/AnnotationConsistencyCheck.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -31,12 +31,9 @@ import javax.xml.bind.annotation.XmlElem import javax.xml.bind.annotation.XmlElementRefs; import javax.xml.bind.annotation.XmlRootElement; import org.opengis.annotation.UML; -import org.opengis.annotation.Classifier; -import org.opengis.annotation.Stereotype; import org.opengis.annotation.Obligation; import org.opengis.annotation.Specification; import org.opengis.util.CodeList; -import org.opengis.util.ControlledVocabulary; import org.apache.sis.util.ArraysExt; import org.apache.sis.xml.Namespaces; import org.apache.sis.internal.jaxb.Schemas; @@ -216,7 +213,6 @@ public abstract strictfp class Annotatio * <p>The default implementation recognizes the * {@linkplain Specification#ISO_19115 ISO 19115}, * {@linkplain Specification#ISO_19115_2 ISO 19115-2}, - * {@linkplain Specification#ISO_19115_3 ISO 19115-3}, * {@linkplain Specification#ISO_19139 ISO 19139} and * {@linkplain Specification#ISO_19108 ISO 19108} specifications, * with a hard-coded list of exceptions to the general rule. @@ -232,8 +228,10 @@ public abstract strictfp class Annotatio * @param uml the UML associated to the class or the method. * @return the expected namespace. * @throws IllegalArgumentException if the given UML is unknown to this method. + * + * @deprecated the complete function is available only on development branch because it depends on GeoAPI 3.1. */ - @SuppressWarnings("deprecation") + @Deprecated protected String getExpectedNamespaceStart(final Class<?> impl, final UML uml) { final String identifier = uml.identifier(); switch (identifier) { @@ -242,13 +240,11 @@ public abstract strictfp class Annotatio case "SV_OperationChainMetadata": case "SV_ServiceIdentification": { // Historical reasons (other standard integrated into ISO 19115) assertEquals("Unexpected @Specification value.", Specification.ISO_19115, uml.specification()); - assertEquals("Specification version should be latest ISO 19115.", (short) 0, uml.version()); return Namespaces.SRV; } case "DQ_TemporalAccuracy": // Renamed DQ_TemporalQuality case "DQ_NonQuantitativeAttributeAccuracy": { // Renamed DQ_NonQuantitativeAttributeCorrectness assertEquals("Unexpected @Specification value.", Specification.ISO_19115, uml.specification()); - assertEquals("Specification version should be legacy ISO 19115.", (short) 2003, uml.version()); return LegacyNamespaces.GMD; } case "role": { @@ -300,12 +296,11 @@ public abstract strictfp class Annotatio */ if (identifier.startsWith("DQ_")) { assertEquals("Unexpected @Specification value.", Specification.ISO_19115, uml.specification()); - assertEquals("Specification version should be legacy ISO 19115.", (short) 2003, uml.version()); return Namespaces.MDQ; } if (identifier.startsWith("QE_")) { assertEquals("Unexpected @Specification value.", Specification.ISO_19115_2, uml.specification()); - switch (uml.version()) { + switch (/*uml.version()*/ 0) { case 0: return Namespaces.MDQ; case 2009: return LegacyNamespaces.GMI; default: fail("Unexpected version number in " + uml); @@ -321,7 +316,7 @@ public abstract strictfp class Annotatio * General cases (after we processed all the special cases) * based on which standard defines the type or property. */ - if (uml.version() != 0) { + if (/*uml.version()*/ 0 != 0) { switch (uml.specification()) { case ISO_19115: return LegacyNamespaces.GMD; case ISO_19115_2: return LegacyNamespaces.GMI; @@ -329,8 +324,7 @@ public abstract strictfp class Annotatio } switch (uml.specification()) { case ISO_19115: - case ISO_19115_2: - case ISO_19115_3: return Schemas.METADATA_ROOT; + case ISO_19115_2: return Schemas.METADATA_ROOT; case ISO_19139: return LegacyNamespaces.GMX; case ISO_19108: return LegacyNamespaces.GMD; default: throw new IllegalArgumentException(uml.toString()); @@ -344,18 +338,17 @@ public abstract strictfp class Annotatio * and unconditionally with {@code "_Type"} appended. * Subclasses shall override this method when mismatches are known to exist between the UML and XML type names. * - * @param stereotype the stereotype of the interface, or {@code null} if none. - * @param uml the UML of the interface for which to get the corresponding XML type name. + * @param uml the UML of the interface for which to get the corresponding XML type name. * @return the name of the XML type for the given element, or {@code null} if none. * * @see #testImplementationAnnotations() + * + * @deprecated the complete function is available only on development branch because it depends on GeoAPI 3.1. */ - protected String getExpectedXmlTypeName(final Stereotype stereotype, final UML uml) { + @Deprecated + protected String getExpectedXmlTypeName(final UML uml) { final String rootName = uml.identifier(); final StringBuilder buffer = new StringBuilder(rootName.length() + 13); - if (Stereotype.ABSTRACT.equals(stereotype)) { - buffer.append("Abstract"); - } return buffer.append(rootName).append("_Type").toString(); } @@ -364,21 +357,20 @@ public abstract strictfp class Annotatio * The default implementation returns {@link UML#identifier()}, possibly with {@code "Abstract"} prepended. * Subclasses shall override this method when mismatches are known to exist between the UML and XML element names. * - * @param stereotype the stereotype of the interface, or {@code null} if none. - * @param uml the UML of the interface for which to get the corresponding XML root element name. + * @param uml the UML of the interface for which to get the corresponding XML root element name. * @return the name of the XML root element for the given UML. * * @see #testImplementationAnnotations() + * + * @deprecated the complete function is available only on development branch because it depends on GeoAPI 3.1. */ - protected String getExpectedXmlRootElementName(final Stereotype stereotype, final UML uml) { + @Deprecated + protected String getExpectedXmlRootElementName(final UML uml) { String name = uml.identifier(); switch (name) { // This case can be removed if https://issues.apache.org/jira/browse/SIS-398 is fixed. case "MI_PolarizationOrientationCode": name = "MI_PolarisationOrientationCode"; break; } - if (Stereotype.ABSTRACT.equals(stereotype)) { - name = "Abstract".concat(name); - } return name; } @@ -502,7 +494,7 @@ public abstract strictfp class Annotatio * We check only the namespace start, since some specifications define many namespaces * under a common root (e.g. "http://standards.iso.org/iso/19115/-3/"). */ - if (uml != null) { + if (uml != null && false) { // This verification is available only on development branches. final String expected = getExpectedNamespaceStart(impl, uml); if (!namespace.startsWith(expected)) { fail("Expected " + expected + "… namespace for that ISO specification but got " + namespace); @@ -565,6 +557,18 @@ public abstract strictfp class Annotatio protected boolean isIgnored(final Method method) { switch (method.getName()) { /* + * Spelling changed. + */ + case "getCenterPoint": { + return true; + } + /* + * Method that override an annotated method in parent class. + */ + case "getUnits": { + return org.opengis.metadata.content.Band.class.isAssignableFrom(method.getDeclaringClass()); + } + /* * Types for which JAXB binding has not yet implemented. */ case "getGeographicCoordinates": { @@ -583,7 +587,7 @@ public abstract strictfp class Annotatio case "getNominalSpatialResolution": case "getTransferFunctionType": { final Class<?> dc = method.getDeclaringClass(); - return org.opengis.metadata.content.SampleDimension.class.isAssignableFrom(dc) + return org.apache.sis.metadata.iso.content.DefaultSampleDimension.class.isAssignableFrom(dc) && !org.opengis.metadata.content.Band.class.isAssignableFrom(dc); } /* @@ -614,7 +618,7 @@ public abstract strictfp class Annotatio testingClass = type.getCanonicalName(); UML uml = type.getAnnotation(UML.class); assertNotNull("Missing @UML annotation.", uml); - if (!ControlledVocabulary.class.isAssignableFrom(type)) { + if (!CodeList.class.isAssignableFrom(type)) { for (final Method method : type.getDeclaredMethods()) { testingMethod = method.getName(); if (!isIgnored(method)) { @@ -641,7 +645,7 @@ public abstract strictfp class Annotatio public void testPackageAnnotations() { final Set<Package> packages = new HashSet<>(); for (final Class<?> type : types) { - if (!ControlledVocabulary.class.isAssignableFrom(type)) { + if (!CodeList.class.isAssignableFrom(type)) { testingClass = type.getCanonicalName(); final Class<?> impl = getImplementation(type); if (impl != null) { @@ -682,7 +686,7 @@ public abstract strictfp class Annotatio @DependsOnMethod("testInterfaceAnnotations") public void testImplementationAnnotations() { for (final Class<?> type : types) { - if (ControlledVocabulary.class.isAssignableFrom(type)) { + if (CodeList.class.isAssignableFrom(type)) { // Skip code lists, since they are not the purpose of this test. continue; } @@ -705,14 +709,7 @@ public abstract strictfp class Annotatio final XmlRootElement root = impl.getAnnotation(XmlRootElement.class); assertNotNull("Missing @XmlRootElement annotation.", root); final UML uml = type.getAnnotation(UML.class); - Stereotype stereotype = null; - if (uml != null) { - final Classifier c = type.getAnnotation(Classifier.class); - if (c != null) { - stereotype = c.value(); - } - assertEquals("Wrong @XmlRootElement.name().", getExpectedXmlRootElementName(stereotype, uml), root.name()); - } + // More tests on development branch (removed on trunk because test depends on GeoAPI 3.1) /* * Check that the namespace is the expected one (according subclass) * and is not redundant with the package @XmlSchema annotation. @@ -723,11 +720,7 @@ public abstract strictfp class Annotatio */ final XmlType xmlType = impl.getAnnotation(XmlType.class); assertNotNull("Missing @XmlType annotation.", xmlType); - String expected = getExpectedXmlTypeName(stereotype, uml); - if (expected == null) { - expected = DEFAULT; - } - assertEquals("Wrong @XmlType.name().", expected, xmlType.name()); + // More tests on development branch (removed on trunk because test depends on GeoAPI 3.1) } } @@ -745,7 +738,7 @@ public abstract strictfp class Annotatio @DependsOnMethod("testImplementationAnnotations") public void testMethodAnnotations() { for (final Class<?> type : types) { - if (ControlledVocabulary.class.isAssignableFrom(type)) { + if (CodeList.class.isAssignableFrom(type)) { // Skip code lists, since they are not the purpose of this test. continue; } @@ -819,9 +812,7 @@ public abstract strictfp class Annotatio */ if (uml != null) { assertEquals("Wrong @XmlElement.name().", getExpectedXmlElementName(type, uml), element.name()); - if (!method.isAnnotationPresent(Deprecated.class) && uml.version() == 0) { - assertEquals("Wrong @XmlElement.required().", uml.obligation() == Obligation.MANDATORY, element.required()); - } + // More tests on development branch (removed on trunk because test depends on GeoAPI 3.1) } /* * Check that the namespace is the expected one (according subclass) @@ -907,10 +898,10 @@ public abstract strictfp class Annotatio assertFalse("Expected @XmlElementRef.", wrapper.isInherited); final UML uml = type.getAnnotation(UML.class); if (uml != null) { // 'assertNotNull' is 'testInterfaceAnnotations()' job. - assertEquals("Wrong @XmlElement.", getExpectedXmlRootElementName(null, uml), element.name()); + assertEquals("Wrong @XmlElement.", getExpectedXmlRootElementName(uml), element.name()); } final String namespace = assertExpectedNamespace(element.namespace(), wrapper.type, uml); - if (!ControlledVocabulary.class.isAssignableFrom(type)) { + if (!CodeList.class.isAssignableFrom(type)) { final String expected = getNamespace(getImplementation(type)); if (expected != null) { // 'assertNotNull' is 'testImplementationAnnotations()' job. assertEquals("Inconsistent @XmlRootElement namespace.", expected, namespace); Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/CharSequenceSubstitutionTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -21,6 +21,8 @@ import org.opengis.metadata.citation.Add import org.opengis.metadata.acquisition.Instrument; import org.opengis.metadata.identification.DataIdentification; import org.opengis.metadata.identification.InitiativeType; +import org.apache.sis.metadata.iso.DefaultIdentifier; +import org.apache.sis.internal.jaxb.LegacyNamespaces; import org.apache.sis.internal.metadata.SensorType; import org.apache.sis.util.iso.Types; import org.apache.sis.test.DependsOnMethod; @@ -37,24 +39,26 @@ import org.opengis.referencing.Reference * Tests the XML marshalling of {@code Anchor} and {@code CodeList} as substitution of {@code <gco:CharacterSequence>}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.7 + * @author Cullen Rombach (Image Matters) + * @version 1.0 * @since 0.3 * @module */ public final strictfp class CharSequenceSubstitutionTest extends XMLTestCase { /** - * Tests unmarshalling of anchor in an identifier element. The {@code xlink:href} attribute - * is lost because the Java type of the {@code gmd:code} attribute is {@link String}. + * Tests unmarshalling of {@code "RS_Identifier"} element. This element was defined in legacy ISO 19139:2007 + * but has been removed in ISO 19115-3. That element is extensively used for Coordinate Reference Systems in + * GML 3.2. * * @throws JAXBException if the unmarshalling failed. */ @Test - @DependsOnMethod("testAnchor") - public void testAnchorForString() throws JAXBException { + @DependsOnMethod("testAnchorForString") + public void testLegacy() throws JAXBException { final String expected = - "<gmd:RS_Identifier xmlns:gmx=\"" + Namespaces.GMX + '"' + - " xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gco=\"" + Namespaces.GCO + '"' + + "<gmd:RS_Identifier xmlns:gmd=\"" + LegacyNamespaces.GMD + '"' + + " xmlns:gmx=\"" + LegacyNamespaces.GMX + '"' + + " xmlns:gco=\"" + LegacyNamespaces.GCO + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + " <gmd:code>\n" + " <gmx:Anchor xlink:href=\"SDN:L101:2:4326\">EPSG:4326</gmx:Anchor>\n" + @@ -64,7 +68,34 @@ public final strictfp class CharSequence " </gmd:codeSpace>\n" + "</gmd:RS_Identifier>"; - final ReferenceIdentifier id = (ReferenceIdentifier) XML.unmarshal(expected); + final ReferenceIdentifier id = unmarshal(ReferenceIdentifier.class, expected); + assertEquals("codespace", "L101", id.getCodeSpace()); + assertEquals("code", "EPSG:4326", id.getCode()); + } + + /** + * Tests unmarshalling of anchor in an identifier element. The {@code xlink:href} attribute + * is lost because the Java type of the {@code gmd:code} attribute is {@link String}. + * + * @throws JAXBException if the unmarshalling failed. + */ + @Test + @DependsOnMethod("testAnchor") + public void testAnchorForString() throws JAXBException { + final String expected = + "<mdb:MD_Identifier xmlns:mdb=\"" + Namespaces.MDB + '"' + + " xmlns:gcx=\"" + Namespaces.GCX + '"' + + " xmlns:gco=\"" + Namespaces.GCO + '"' + + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + + " <mdb:code>\n" + + " <gcx:Anchor xlink:href=\"SDN:L101:2:4326\">EPSG:4326</gcx:Anchor>\n" + + " </mdb:code>\n" + + " <mdb:codeSpace>\n" + + " <gco:CharacterString>L101</gco:CharacterString>\n" + + " </mdb:codeSpace>\n" + + "</mdb:MD_Identifier>"; + + final DefaultIdentifier id = unmarshal(DefaultIdentifier.class, expected); assertEquals("codespace", "L101", id.getCodeSpace()); assertEquals("code", "EPSG:4326", id.getCode()); } @@ -78,28 +109,28 @@ public final strictfp class CharSequence @Test public void testAnchor() throws JAXBException { final String expected = - "<gmd:CI_Address xmlns:gmx=\"" + Namespaces.GMX + '"' + - " xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<cit:CI_Address xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gcx=\"" + Namespaces.GCX + '"' + " xmlns:gco=\"" + Namespaces.GCO + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + - " <gmd:deliveryPoint>\n" + + " <cit:deliveryPoint>\n" + " <gco:CharacterString>Centre IFREMER de Brest BP 70</gco:CharacterString>\n" + - " </gmd:deliveryPoint>\n" + - " <gmd:city>\n" + + " </cit:deliveryPoint>\n" + + " <cit:city>\n" + " <gco:CharacterString>Plouzané</gco:CharacterString>\n" + - " </gmd:city>\n" + - " <gmd:postalCode>\n" + + " </cit:city>\n" + + " <cit:postalCode>\n" + " <gco:CharacterString>29280</gco:CharacterString>\n" + - " </gmd:postalCode>\n" + - " <gmd:country>\n" + - " <gmx:Anchor xlink:href=\"SDN:C320:2:FR\">France</gmx:Anchor>\n" + - " </gmd:country>\n" + - " <gmd:electronicMailAddress>\n" + + " </cit:postalCode>\n" + + " <cit:country>\n" + + " <gcx:Anchor xlink:href=\"SDN:C320:2:FR\">France</gcx:Anchor>\n" + + " </cit:country>\n" + + " <cit:electronicMailAddress>\n" + " <gco:CharacterString>(hiden)@ifremer.fr</gco:CharacterString>\n" + - " </gmd:electronicMailAddress>\n" + - "</gmd:CI_Address>"; + " </cit:electronicMailAddress>\n" + + "</cit:CI_Address>"; - final Address address = (Address) XML.unmarshal(expected); + final Address address = unmarshal(Address.class, expected); assertEquals("Plouzané", address.getCity().toString()); assertEquals("France", address.getCountry().toString()); assertEquals(1, address.getElectronicMailAddresses().size()); @@ -112,7 +143,7 @@ public final strictfp class CharSequence anchor.setType(XLink.Type.AUTO); assertEquals(XLink.Type.LOCATOR, anchor.getType()); - final String actual = XML.marshal(address); + final String actual = marshal(address); assertXmlEquals(expected, actual, "xmlns:*"); } @@ -126,19 +157,19 @@ public final strictfp class CharSequence @Test public void testCodeList() throws JAXBException { final String expected = - "<gmd:MD_DataIdentification xmlns:gmd=\"" + Namespaces.GMD + "\">\n" + - " <gmd:purpose>\n" + - " <gmd:DS_InitiativeTypeCode\n" + - " codeList=\"http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#DS_InitiativeTypeCode\"\n" + - " codeListValue=\"investigation\">Investigation</gmd:DS_InitiativeTypeCode>\n" + - " </gmd:purpose>\n" + - "</gmd:MD_DataIdentification>"; + "<mri:MD_DataIdentification xmlns:mri=\"" + Namespaces.MRI + "\">\n" + + " <mri:purpose>\n" + + " <mri:DS_InitiativeTypeCode\n" + + " codeList=\"http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#DS_InitiativeTypeCode\"\n" + + " codeListValue=\"investigation\">Investigation</mri:DS_InitiativeTypeCode>\n" + + " </mri:purpose>\n" + + "</mri:MD_DataIdentification>"; - final DataIdentification id = (DataIdentification) XML.unmarshal(expected); + final DataIdentification id = unmarshal(DataIdentification.class, expected); assertEquals("purpose", "Investigation", String.valueOf(id.getPurpose())); assertSame("purpose", InitiativeType.INVESTIGATION, Types.forCodeTitle(id.getPurpose())); - final String actual = XML.marshal(id); + final String actual = marshal(id); assertXmlEquals(expected, actual, "xmlns:*"); } @@ -162,7 +193,7 @@ public final strictfp class CharSequence " </gmi:type>\n" + "</gmi:MI_Instrument>"; - final Instrument instrument = (Instrument) XML.unmarshal(expected); + final Instrument instrument = unmarshal(Instrument.class, expected); assertEquals("type", "RADIOMETER", String.valueOf(instrument.getType())); assertInstanceOf("type", SensorType.class, Types.forCodeTitle(instrument.getType())); } Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/FreeTextMarshallingTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/FreeTextMarshallingTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/FreeTextMarshallingTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/FreeTextMarshallingTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -30,7 +30,7 @@ import static org.apache.sis.test.Assert * Tests the XML marshalling of {@code FreeText}. * * @author Martin Desruisseaux (Geomatys) - * @version 0.3 + * @version 1.0 * * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-107">GEOTK-107</a> * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-152">GEOTK-152</a> @@ -60,26 +60,29 @@ public final strictfp class FreeTextMars @Test public void testStandard() throws JAXBException { final String expected = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + "\" xmlns:gco=\"" + Namespaces.GCO + "\" xmlns:xsi=\"" + Namespaces.XSI + "\">\n" + - " <gmd:title xsi:type=\"gmd:PT_FreeText_PropertyType\">\n" + + "<cit:CI_Citation xmlns:lan=\"" + Namespaces.LAN + '"' + + " xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gco=\"" + Namespaces.GCO + '"' + + " xmlns:xsi=\"" + Namespaces.XSI + "\">\n" + + " <cit:title xsi:type=\"lan:PT_FreeText_PropertyType\">\n" + " <gco:CharacterString>OpenSource Project</gco:CharacterString>\n" + - " <gmd:PT_FreeText>\n" + - " <gmd:textGroup>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-eng\">OpenSource Project</gmd:LocalisedCharacterString>\n" + - " </gmd:textGroup>\n" + - " <gmd:textGroup>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-ita\">Progetto OpenSource</gmd:LocalisedCharacterString>\n" + - " </gmd:textGroup>\n" + - " <gmd:textGroup>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-fra\">Projet OpenSource</gmd:LocalisedCharacterString>\n" + - " </gmd:textGroup>\n" + - " </gmd:PT_FreeText>\n" + - " </gmd:title>\n" + - "</gmd:CI_Citation>\n"; + " <lan:PT_FreeText>\n" + + " <lan:textGroup>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-eng\">OpenSource Project</lan:LocalisedCharacterString>\n" + + " </lan:textGroup>\n" + + " <lan:textGroup>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-ita\">Progetto OpenSource</lan:LocalisedCharacterString>\n" + + " </lan:textGroup>\n" + + " <lan:textGroup>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-fra\">Projet OpenSource</lan:LocalisedCharacterString>\n" + + " </lan:textGroup>\n" + + " </lan:PT_FreeText>\n" + + " </cit:title>\n" + + "</cit:CI_Citation>\n"; - final Citation citation = (Citation) XML.unmarshal(expected); + final Citation citation = unmarshal(Citation.class, expected); assertEquals(getExpectedI18N(), citation.getTitle()); - final String actual = XML.marshal(citation); + final String actual = marshal(citation); assertXmlEquals(expected, actual, "xmlns:*"); } @@ -94,20 +97,23 @@ public final strictfp class FreeTextMars @Test public void testLegacy() throws JAXBException { final String legacy = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + "\" xmlns:gco=\"" + Namespaces.GCO + "\" xmlns:xsi=\"" + Namespaces.XSI + "\">\n" + - " <gmd:title xsi:type=\"gmd:PT_FreeText_PropertyType\">\n" + + "<cit:CI_Citation xmlns:lan=\"" + Namespaces.LAN + '"' + + " xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gco=\"" + Namespaces.GCO + '"' + + " xmlns:xsi=\"" + Namespaces.XSI + "\">\n" + + " <cit:title xsi:type=\"lan:PT_FreeText_PropertyType\">\n" + " <gco:CharacterString>OpenSource Project</gco:CharacterString>\n" + - " <gmd:PT_FreeText>\n" + - " <gmd:textGroup>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-eng\">OpenSource Project</gmd:LocalisedCharacterString>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-ita\">Progetto OpenSource</gmd:LocalisedCharacterString>\n" + - " <gmd:LocalisedCharacterString locale=\"#locale-fra\">Projet OpenSource</gmd:LocalisedCharacterString>\n" + - " </gmd:textGroup>\n" + - " </gmd:PT_FreeText>\n" + - " </gmd:title>\n" + - "</gmd:CI_Citation>\n"; + " <lan:PT_FreeText>\n" + + " <lan:textGroup>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-eng\">OpenSource Project</lan:LocalisedCharacterString>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-ita\">Progetto OpenSource</lan:LocalisedCharacterString>\n" + + " <lan:LocalisedCharacterString locale=\"#locale-fra\">Projet OpenSource</lan:LocalisedCharacterString>\n" + + " </lan:textGroup>\n" + + " </lan:PT_FreeText>\n" + + " </cit:title>\n" + + "</cit:CI_Citation>\n"; - final Citation citation = (Citation) XML.unmarshal(legacy); + final Citation citation = unmarshal(Citation.class, legacy); assertEquals(getExpectedI18N(), citation.getTitle()); } } Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/NilReasonMarshallingTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/NilReasonMarshallingTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/NilReasonMarshallingTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/NilReasonMarshallingTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -33,7 +33,7 @@ import static org.apache.sis.test.Metada * Tests the XML marshalling of object having {@code nilReason} attribute. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @version 1.0 * * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-149">GEOTK-149</a> * @@ -49,15 +49,15 @@ public final strictfp class NilReasonMar @Test public void testMissing() throws JAXBException { final String expected = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:title>\n" + + " <cit:title>\n" + " <gco:CharacterString>A title</gco:CharacterString>\n" + - " </gmd:title>\n" + - " <gmd:series gco:nilReason=\"missing\"/>\n" + - "</gmd:CI_Citation>"; + " </cit:title>\n" + + " <cit:series gco:nilReason=\"missing\"/>\n" + + "</cit:CI_Citation>"; - final Citation citation = (Citation) XML.unmarshal(expected); + final Citation citation = unmarshal(Citation.class, expected); assertTitleEquals("citation", "A title", citation); final Series series = citation.getSeries(); @@ -71,9 +71,9 @@ public final strictfp class NilReasonMar assertEquals("Series[missing]", series.toString()); assertNull("All attributes are expected to be null.", series.getName()); - final String actual = XML.marshal(citation); + final String actual = marshal(citation); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(citation, XML.unmarshal(actual)); + assertEquals(citation, unmarshal(Citation.class, actual)); } /** @@ -87,15 +87,15 @@ public final strictfp class NilReasonMar @DependsOnMethod("testMissing") public void testMissingBoolean() throws JAXBException { final String expected = - "<gmd:DQ_ConformanceResult xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<mdq:DQ_ConformanceResult xmlns:mdq=\"" + Namespaces.MDQ + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:explanation>\n" + + " <mdq:explanation>\n" + " <gco:CharacterString>An explanation</gco:CharacterString>\n" + - " </gmd:explanation>\n" + - " <gmd:pass gco:nilReason=\"missing\"/>\n" + - "</gmd:DQ_ConformanceResult>"; + " </mdq:explanation>\n" + + " <mdq:pass gco:nilReason=\"missing\"/>\n" + + "</mdq:DQ_ConformanceResult>"; - final ConformanceResult result = (ConformanceResult) XML.unmarshal(expected); + final ConformanceResult result = unmarshal(ConformanceResult.class, expected); assertEquals("explanation", "An explanation", result.getExplanation().toString()); final Boolean pass = result.pass(); @@ -104,9 +104,9 @@ public final strictfp class NilReasonMar assertNotSame("Expected a sentinel value.", Boolean.FALSE, pass); assertSame("nilReason", NilReason.MISSING, NilReason.forObject(pass)); - final String actual = XML.marshal(result); + final String actual = marshal(result); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(result, XML.unmarshal(actual)); + assertEquals(result, unmarshal(ConformanceResult.class, actual)); } /** @@ -121,12 +121,12 @@ public final strictfp class NilReasonMar @SuppressWarnings("UnnecessaryBoxing") public void testMissingInteger() throws JAXBException { final String expected = - "<gmd:MD_Dimension xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<msr:MD_Dimension xmlns:msr=\"" + Namespaces.MSR + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:dimensionSize gco:nilReason=\"unknown\"/>\n" + - "</gmd:MD_Dimension>"; + " <msr:dimensionSize gco:nilReason=\"unknown\"/>\n" + + "</msr:MD_Dimension>"; - final Dimension result = (Dimension) XML.unmarshal(expected); + final Dimension result = unmarshal(Dimension.class, expected); final Integer size = result.getDimensionSize(); assertNotNull("Expected a sentinel value.", size); @@ -134,9 +134,9 @@ public final strictfp class NilReasonMar assertNotSame("Expected a sentinel value.", Integer.valueOf(0), size); assertSame("nilReason", NilReason.UNKNOWN, NilReason.forObject(size)); - final String actual = XML.marshal(result); + final String actual = marshal(result); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(result, XML.unmarshal(actual)); + assertEquals(result, unmarshal(Dimension.class, actual)); } /** @@ -148,13 +148,13 @@ public final strictfp class NilReasonMar @DependsOnMethod("testMissing") public void testMissingDouble() throws JAXBException { final String expected = - "<gmd:MD_Band xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<mrc:MD_Band xmlns:mrc=\"" + Namespaces.MRC + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:minValue gco:nilReason=\"unknown\"/>\n" + - " <gmd:peakResponse gco:nilReason=\"missing\"/>\n" + - "</gmd:MD_Band>"; + " <mrc:minValue gco:nilReason=\"unknown\"/>\n" + + " <mrc:peakResponse gco:nilReason=\"missing\"/>\n" + + "</mrc:MD_Band>"; - final Band result = (Band) XML.unmarshal(expected); + final Band result = unmarshal(Band.class, expected); final Double minValue = result.getMinValue(); assertNotNull("Expected a sentinel value.", minValue); @@ -166,9 +166,9 @@ public final strictfp class NilReasonMar assertTrue("Nil value shall be NaN.", peakResponse.isNaN()); assertSame("nilReason", NilReason.UNKNOWN, NilReason.forObject(peakResponse)); - final String actual = XML.marshal(result); + final String actual = marshal(result); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(result, XML.unmarshal(actual)); + assertEquals(result, unmarshal(Band.class, actual)); } /** @@ -180,15 +180,15 @@ public final strictfp class NilReasonMar @DependsOnMethod("testMissing") public void testOther() throws JAXBException { final String expected = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:title>\n" + + " <cit:title>\n" + " <gco:CharacterString>A title</gco:CharacterString>\n" + - " </gmd:title>\n" + - " <gmd:series gco:nilReason=\"other:myReason\"/>\n" + - "</gmd:CI_Citation>"; + " </cit:title>\n" + + " <cit:series gco:nilReason=\"other:myReason\"/>\n" + + "</cit:CI_Citation>"; - final Citation citation = (Citation) XML.unmarshal(expected); + final Citation citation = unmarshal(Citation.class, expected); assertTitleEquals("citation", "A title", citation); final Series series = citation.getSeries(); @@ -201,9 +201,9 @@ public final strictfp class NilReasonMar assertEquals("Series[other:myReason]", series.toString()); assertNull("All attributes are expected to be null.", series.getName()); - final String actual = XML.marshal(citation); + final String actual = marshal(citation); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(citation, XML.unmarshal(actual)); + assertEquals(citation, unmarshal(Citation.class, actual)); } /** @@ -215,15 +215,15 @@ public final strictfp class NilReasonMar @DependsOnMethod("testMissing") public void testURI() throws JAXBException { final String expected = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:title>\n" + + " <cit:title>\n" + " <gco:CharacterString>A title</gco:CharacterString>\n" + - " </gmd:title>\n" + - " <gmd:series gco:nilReason=\"http://www.myreason.org\"/>\n" + - "</gmd:CI_Citation>"; + " </cit:title>\n" + + " <cit:series gco:nilReason=\"http://www.myreason.org\"/>\n" + + "</cit:CI_Citation>"; - final Citation citation = (Citation) XML.unmarshal(expected); + final Citation citation = unmarshal(Citation.class, expected); assertTitleEquals("citation", "A title", citation); final Series series = citation.getSeries(); @@ -236,8 +236,8 @@ public final strictfp class NilReasonMar assertEquals("Series[http://www.myreason.org]", series.toString()); assertNull("All attributes are expected to be null.", series.getName()); - final String actual = XML.marshal(citation); + final String actual = marshal(citation); assertXmlEquals(expected, actual, "xmlns:*"); - assertEquals(citation, XML.unmarshal(actual)); + assertEquals(citation, unmarshal(Citation.class, actual)); } } Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/UUIDMarshallingTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -32,7 +32,7 @@ import static org.apache.sis.test.Metada * Tests the XML marshalling of object having {@code uuid} or {@code uuidref} attributes. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @version 1.0 * * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-165">GEOTK-165</a> * @@ -50,50 +50,50 @@ public final strictfp class UUIDMarshall * 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 + "\">\n" + - " <gmd:title>\n" + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + + " <cit: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" + + " </cit:title>\n" + + " <cit:series>\n" + + " <cit:CI_Series uuid=\"" + UUID_VALUE + "\">\n" + + " <cit:name>\n" + " <gco:CharacterString>My aggregate dataset</gco:CharacterString>\n" + - " </gmd:name>\n" + - " </gmd:CI_Series>\n" + - " </gmd:series>\n" + - "</gmd:CI_Citation>"; + " </cit:name>\n" + + " </cit:CI_Series>\n" + + " </cit:series>\n" + + "</cit:CI_Citation>"; /** * 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. */ private static final String REFERENCED_XML_WITH_BODY = - "<gmd:CI_Citation xmlns:gmd=\"" + Namespaces.GMD + '"' + - " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + - " <gmd:title>\n" + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + + " <cit: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" + + " </cit:title>\n" + + " <cit:series uuidref=\"" + UUID_VALUE + "\">\n" + + " <cit:CI_Series>\n" + + " <cit:name>\n" + " <gco:CharacterString>My aggregate dataset</gco:CharacterString>\n" + - " </gmd:name>\n" + - " </gmd:CI_Series>\n" + - " </gmd:series>\n" + - "</gmd:CI_Citation>"; + " </cit:name>\n" + + " </cit:CI_Series>\n" + + " </cit:series>\n" + + "</cit: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 + "\">\n" + - " <gmd:title>\n" + + "<cit:CI_Citation xmlns:cit=\"" + Namespaces.CIT + '"' + + " xmlns:gco=\"" + Namespaces.GCO + "\">\n" + + " <cit:title>\n" + " <gco:CharacterString>My data</gco:CharacterString>\n" + - " </gmd:title>\n" + - " <gmd:series uuidref=\"" + UUID_VALUE + "\"/>\n" + - "</gmd:CI_Citation>"; + " </cit:title>\n" + + " <cit:series uuidref=\"" + UUID_VALUE + "\"/>\n" + + "</cit:CI_Citation>"; /** * Tests (un)marshalling of an object identified by the {@code uuid} attribute. @@ -101,18 +101,18 @@ public final strictfp class UUIDMarshall * in the {@code <gmd:CI_Series>} element of the following XML fragment: * * {@preformat xml - * <gmd:CI_Citation> - * <gmd:title> + * <cit:CI_Citation> + * <cit:title> * <gco:CharacterString>My data</gco:CharacterString> - * </gmd:title> - * <gmd:series> - * <gmd:CI_Series uuid="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf"> - * <gmd:name> + * </cit:title> + * <cit:series> + * <cit:CI_Series uuid="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf"> + * <cit:name> * <gco:CharacterString>My aggregate dataset</gco:CharacterString> - * </gmd:name> - * </gmd:CI_Series> - * </gmd:series> - * </gmd:CI_Citation> + * </cit:name> + * </cit:CI_Series> + * </cit:series> + * </cit:CI_Citation> * } * * On an implementation note, the {@code uuid} and other attributes of the {@code <gmd:CI_Series>} @@ -152,18 +152,18 @@ public final strictfp class UUIDMarshall * in the {@code <gmd:series>} property of the following XML fragment:</p> * * {@preformat xml - * <gmd:CI_Citation> - * <gmd:title> + * <cit:CI_Citation> + * <cit:title> * <gco:CharacterString>My data</gco:CharacterString> - * </gmd:title> - * <gmd:series uuidref="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf"> - * <gmd:CI_Series> - * <gmd:name> + * </cit:title> + * <cit:series uuidref="f8f5fcb1-d57b-4013-b3a4-4eaa40df6dcf"> + * <cit:CI_Series> + * <cit:name> * <gco:CharacterString>My aggregate dataset</gco:CharacterString> - * </gmd:name> - * </gmd:CI_Series> - * </gmd:series> - * </gmd:CI_Citation> + * </cit:name> + * </cit:CI_Series> + * </cit:series> + * </cit:CI_Citation> * } * * On an implementation note, the {@code uuidref}, {@code xlink:href} and other attributes of the Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java [UTF-8] (original) +++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/xml/XLinkMarshallingTest.java [UTF-8] Mon Feb 26 11:28:17 2018 @@ -37,7 +37,7 @@ import static org.apache.sis.test.TestUt * Tests the XML marshalling of object having {@code xlink} attribute. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @version 1.0 * * @see <a href="http://jira.geotoolkit.org/browse/GEOTK-165">GEOTK-165</a> * @@ -50,26 +50,27 @@ public final strictfp class XLinkMarshal * A XML with a {@code xlink:href} without element definition. */ private static final String LINK_ONLY_XML = - "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<mdb:MD_Metadata xmlns:mdb=\"" + Namespaces.MDB + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + - " <gmd:identificationInfo xlink:href=\"http://test.net\"/>\n" + - "</gmd:MD_Metadata>"; + " <mdb:identificationInfo xlink:href=\"http://test.net\"/>\n" + + "</mdb:MD_Metadata>"; /** * A XML with a {@code xlink:href} without element definition. */ private static final String LINK_WITH_ELEMENT_XML = - "<gmd:MD_Metadata xmlns:gmd=\"" + Namespaces.GMD + '"' + + "<mdb:MD_Metadata xmlns:mdb=\"" + Namespaces.MDB + '"' + + " xmlns:mri=\"" + Namespaces.MRI + '"' + " xmlns:gco=\"" + Namespaces.GCO + '"' + " xmlns:xlink=\"" + Namespaces.XLINK + "\">\n" + - " <gmd:identificationInfo xlink:href=\"http://test.net\">\n" + - " <gmd:MD_DataIdentification>\n" + - " <gmd:abstract>\n" + + " <mdb:identificationInfo xlink:href=\"http://test.net\">\n" + + " <mri:MD_DataIdentification>\n" + + " <mri:abstract>\n" + " <gco:CharacterString>This is a test.</gco:CharacterString>\n" + - " </gmd:abstract>\n" + - " </gmd:MD_DataIdentification>\n" + - " </gmd:identificationInfo>\n" + - "</gmd:MD_Metadata>"; + " </mri:abstract>\n" + + " </mri:MD_DataIdentification>\n" + + " </mdb:identificationInfo>\n" + + "</mdb:MD_Metadata>"; /** * Verifies if the given metadata contains the expected {@code xlink:href} attribute value. @@ -90,9 +91,9 @@ public final strictfp class XLinkMarshal * The XML fragment is: * * {@preformat xml - * <gmd:MD_Metadata> - * <gmd:identificationInfo xlink:href="http://test.net"/> - * </gmd:MD_Metadata> + * <mdb:MD_Metadata> + * <mdb:identificationInfo xlink:href="http://test.net"/> + * </mdb:MD_Metadata> * } * * @throws JAXBException if an error occurred during (un)marshalling. @@ -107,7 +108,7 @@ public final strictfp class XLinkMarshal final DefaultMetadata metadata = new DefaultMetadata(); metadata.setIdentificationInfo(Collections.singleton(identification)); - assertXmlEquals(LINK_ONLY_XML, XML.marshal(metadata), "xmlns:*"); + assertXmlEquals(LINK_ONLY_XML, marshal(metadata), "xmlns:*"); verify(true, unmarshal(DefaultMetadata.class, LINK_ONLY_XML)); } @@ -116,15 +117,15 @@ public final strictfp class XLinkMarshal * The XML fragment is: * * {@preformat xml - * <gmd:MD_Metadata> - * <gmd:identificationInfo xlink:href="http://test.net"> - * <gmd:MD_DataIdentification> - * <gmd:abstract> + * <mdb:MD_Metadata> + * <mdb:identificationInfo xlink:href="http://test.net"> + * <mdb:MD_DataIdentification> + * <mdb:abstract> * <gco:CharacterString>This is a test.</gco:CharacterString> - * </gmd:abstract> - * </gmd:MD_DataIdentification> - * </gmd:identificationInfo> - * </gmd:MD_Metadata> + * </mdb:abstract> + * </mdb:MD_DataIdentification> + * </mdb:identificationInfo> + * </mdb:MD_Metadata> * } * * @throws JAXBException if an error occurred during (un)marshalling. @@ -140,7 +141,7 @@ public final strictfp class XLinkMarshal final DefaultMetadata metadata = new DefaultMetadata(); metadata.setIdentificationInfo(Collections.singleton(identification)); - assertXmlEquals(LINK_WITH_ELEMENT_XML, XML.marshal(metadata), "xmlns:*"); + assertXmlEquals(LINK_WITH_ELEMENT_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/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/api-changes.properties URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/api-changes.properties?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/api-changes.properties [ISO-8859-1] (original) +++ sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/api-changes.properties [ISO-8859-1] Mon Feb 26 11:28:17 2018 @@ -48,7 +48,7 @@ org.opengis.metadata.identification.Serv org.opengis.metadata.identification.Usage=+getAdditionalDocumentation:additionalDocumentation +getIdentifiedIssues:identifiedIssues +getResponses:response org.opengis.metadata.Identifier=+getCodeSpace:codeSpace +getDescription:description +getVersion:version org.opengis.metadata.lineage.Lineage=+getAdditionalDocumentation:additionalDocumentation +getScope:scope -org.opengis.metadata.lineage.ProcessStep=+getReferences:reference +getScope:scope +org.opengis.metadata.lineage.ProcessStep=-getDate +getReferences:reference +getScope:scope org.opengis.metadata.lineage.Source=-getScaleDenominator +getScope:scope -getSourceExtents +getSourceMetadata:sourceMetadata +getSourceSpatialResolution:sourceSpatialResolution org.opengis.metadata.maintenance.MaintenanceInformation=-getDateOfNextUpdate +getMaintenanceDates:maintenanceDate +getMaintenanceScopes:maintenanceScope -getUpdateScopeDescriptions -getUpdateScopes org.opengis.metadata.Metadata=+getAlternativeMetadataReferences:alternativeMetadataReference -getCharacterSet +getCharacterSets:characterSet -getDataSetUri -getDateStamp +getDateInfo:dateInfo -getFileIdentifier -getHierarchyLevelNames -getHierarchyLevels -getLanguage +getLanguages:defaultLocale+otherLocale -getLocales +getMetadataIdentifier:metadataIdentifier +getMetadataLinkages:metadataLinkage +getMetadataProfiles:metadataProfile +getMetadataScopes:metadataScope -getMetadataStandardName -getMetadataStandardVersion +getMetadataStandards:metadataStandard -getParentIdentifier +getParentMetadata:parentMetadata +getResourceLineages:resourceLineage Modified: sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml?rev=1825355&r1=1825354&r2=1825355&view=diff ============================================================================== --- sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml (original) +++ sis/trunk/core/sis-metadata/src/test/resources/org/apache/sis/metadata/iso/citation/Citation.xml Mon Feb 26 11:28:17 2018 @@ -18,56 +18,87 @@ under the License. --> -<gmd:CI_Citation - xmlns:gco = "http://www.isotc211.org/2005/gco" - xmlns:gmd = "http://www.isotc211.org/2005/gmd" - xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" - xmlns:xlink = "http://www.w3.org/1999/xlink" - xsi:schemaLocation = "http://www.isotc211.org/2005/gmd http://schemas.opengis.net/iso/19139/20070417/gmd/gmd.xsd"> +<cit:CI_Citation + xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/1.0" + xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0" + xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:xlink="http://www.w3.org/1999/xlink" + xsi:schemaLocation = "http://standards.iso.org/iso/19115/-3/cit/1.0 http://standards.iso.org/iso/19115/-3/cit/1.0/cit.xsd + http://standards.iso.org/iso/19115/-3/gcx/1.0 http://standards.iso.org/iso/19115/-3/gcx/1.0/gcx.xsd"> - <gmd:title> + <cit:title> <gco:CharacterString>Fight against poverty</gco:CharacterString> - </gmd:title> - <gmd:date> - <gmd:CI_Date> - <gmd:date> + </cit:title> + <cit:date> + <cit:CI_Date> + <cit:date> <!-- International Day for the Eradication of Poverty --> <gco:DateTime>2015-10-17T02:00:00+02:00</gco:DateTime> - </gmd:date> - <gmd:dateType> - <gmd:CI_DateTypeCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode" - codeListValue="adopted">Adopted</gmd:CI_DateTypeCode> - </gmd:dateType> - </gmd:CI_Date> - </gmd:date> - <gmd:citedResponsibleParty> - <gmd:CI_ResponsibleParty> - <gmd:individualName> - <gco:CharacterString>Maid Marian</gco:CharacterString> - </gmd:individualName> - <gmd:contactInfo> - <gmd:CI_Contact id="ip-protocol"> - <gmd:contactInstructions> - <gco:CharacterString>Send carrier pigeon.</gco:CharacterString> - </gmd:contactInstructions> - </gmd:CI_Contact> - </gmd:contactInfo> - <gmd:role> - <gmd:CI_RoleCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode" - codeListValue="originator">Originator</gmd:CI_RoleCode> - </gmd:role> - </gmd:CI_ResponsibleParty> - </gmd:citedResponsibleParty> - <gmd:citedResponsibleParty> - <gmd:CI_ResponsibleParty> - <gmd:individualName> - <gco:CharacterString>Robin Hood</gco:CharacterString> - </gmd:individualName> - <gmd:contactInfo xlink:href="#ip-protocol"/> - <gmd:role> - <gmd:CI_RoleCode codeList="http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode" - codeListValue="funder">Funder</gmd:CI_RoleCode> - </gmd:role> - </gmd:CI_ResponsibleParty> - </gmd:citedResponsibleParty> -</gmd:CI_Citation> + </cit:date> + <cit:dateType> + <cit:CI_DateTypeCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_DateTypeCode" + codeListValue="adopted">Adopted</cit:CI_DateTypeCode> + </cit:dateType> + </cit:CI_Date> + </cit:date> + <cit:citedResponsibleParty> + <cit:CI_Responsibility> + <cit:role> + <cit:CI_RoleCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_RoleCode" + codeListValue="originator">Originator</cit:CI_RoleCode> + </cit:role> + <cit:party> + <cit:CI_Individual> + <cit:name> + <gco:CharacterString>Maid Marian</gco:CharacterString> + </cit:name> + <cit:contactInfo> + <cit:CI_Contact id="ip-protocol"> + <cit:onlineResource> + <cit:CI_OnlineResource> + <cit:linkage> + <gcx:FileName src="https://tools.ietf.org/html/rfc1149">rfc1149</gcx:FileName> + </cit:linkage> + <cit:name> + <gco:CharacterString>IP over Avian Carriers</gco:CharacterString> + </cit:name> + <cit:description> + <gco:CharacterString>High delay, low throughput, and low altitude service.</gco:CharacterString> + </cit:description> + <cit:function> + <cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_OnLineFunctionCode" + codeListValue="offlineAccess">Offline access</cit:CI_OnLineFunctionCode> + </cit:function> + </cit:CI_OnlineResource> + </cit:onlineResource> + <cit:contactInstructions> + <gco:CharacterString>Send carrier pigeon.</gco:CharacterString> + </cit:contactInstructions> + </cit:CI_Contact> + </cit:contactInfo> + </cit:CI_Individual> + </cit:party> + </cit:CI_Responsibility> + </cit:citedResponsibleParty> + <cit:citedResponsibleParty> + <cit:CI_Responsibility> + <cit:role> + <cit:CI_RoleCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_RoleCode" + codeListValue="funder">Funder</cit:CI_RoleCode> + </cit:role> + <cit:party> + <cit:CI_Individual> + <cit:name> + <gco:CharacterString>Robin Hood</gco:CharacterString> + </cit:name> + <cit:contactInfo xlink:href="#ip-protocol"/> + </cit:CI_Individual> + </cit:party> + </cit:CI_Responsibility> + </cit:citedResponsibleParty> + <cit:presentationForm> + <cit:CI_PresentationFormCode codeList="http://standards.iso.org/iso/19115/resources/Codelist/cat/codelists.xml#CI_PresentationFormCode" + codeListValue="physicalObject">Physical object</cit:CI_PresentationFormCode> + </cit:presentationForm> +</cit:CI_Citation>
