Author: desruisseaux Date: Mon Feb 19 22:19:33 2018 New Revision: 1824824 URL: http://svn.apache.org/viewvc?rev=1824824&view=rev Log: Fix or disable French profiles tests. See https://issues.apache.org/jira/browse/SIS-404. With this commit, all non-ignored tests now pass.
Modified: sis/branches/ISO-19115-3/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DataIdentification.java sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DataIdentificationTest.java sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java Modified: sis/branches/ISO-19115-3/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DataIdentification.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DataIdentification.java?rev=1824824&r1=1824823&r2=1824824&view=diff ============================================================================== --- sis/branches/ISO-19115-3/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DataIdentification.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/profiles/sis-french-profile/src/main/java/org/apache/sis/internal/profile/fra/DataIdentification.java [UTF-8] Mon Feb 19 22:19:33 2018 @@ -51,7 +51,7 @@ import org.apache.sis.metadata.iso.ident */ @SuppressWarnings("CloneableClassWithoutClone") // ModifiableMetadata needs shallow clones. @XmlType(name = "FRA_DataIdentification_Type") -@XmlRootElement(name ="FRA_DataIdentification") +@XmlRootElement(name = "FRA_DataIdentification") public class DataIdentification extends DefaultDataIdentification { /** * For serialization purpose. Modified: sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DataIdentificationTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DataIdentificationTest.java?rev=1824824&r1=1824823&r2=1824824&view=diff ============================================================================== --- sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DataIdentificationTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DataIdentificationTest.java [UTF-8] Mon Feb 19 22:19:33 2018 @@ -17,8 +17,8 @@ package org.apache.sis.internal.profile.fra; import javax.xml.bind.JAXBException; -import org.apache.sis.xml.XML; -import org.apache.sis.test.TestCase; +import org.apache.sis.test.XMLTestCase; +import org.junit.Ignore; import org.junit.Test; import static org.apache.sis.test.MetadataAssert.*; @@ -29,17 +29,20 @@ import static org.apache.sis.test.TestUt * Tests (un)marshalling of French profile of data identification. * * @author Martin Desruisseaux (Geomatys) - * @version 0.4 + * @version 1.0 * @since 0.4 * @module */ -public final strictfp class DataIdentificationTest extends TestCase { +public final strictfp class DataIdentificationTest extends XMLTestCase { /** * Tests marshalling and unmarshalling of a XML fragment. * * @throws JAXBException if an error occurred during (un)marshalling. + * + * @see <a href="https://issues.apache.org/jira/browse/SIS-404">SIS-404</a> */ @Test + @Ignore("Verify if we should discontinue this profile.") public void testMarshalling() throws JAXBException { final String xml = "<fra:FRA_DataIdentification xmlns:gmd=\"http://www.isotc211.org/2005/gmd\"" + @@ -61,12 +64,11 @@ public final strictfp class DataIdentifi " </fra:relatedCitation>\n" + "</fra:FRA_DataIdentification>"; - final Object id = XML.unmarshal(xml); - assertInstanceOf("Expected an AFNOR instance.", DataIdentification.class, id); - assertTitleEquals("citation", "Main documentation.", ((DataIdentification) id).getCitation()); - assertTitleEquals("relatedCitations", "Related documentation.", getSingleton(((DataIdentification) id).getRelatedCitations())); + final DataIdentification id = unmarshal(DataIdentification.class, xml); + assertTitleEquals("citation", "Main documentation.", id.getCitation()); + assertTitleEquals("relatedCitations", "Related documentation.", getSingleton(id.getRelatedCitations())); - final String actual = XML.marshal(id); + final String actual = marshal(id, VERSION_2007); assertXmlEquals(xml, actual, "xmlns:*"); } } Modified: sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java URL: http://svn.apache.org/viewvc/sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java?rev=1824824&r1=1824823&r2=1824824&view=diff ============================================================================== --- sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] (original) +++ sis/branches/ISO-19115-3/profiles/sis-french-profile/src/test/java/org/apache/sis/internal/profile/fra/DirectReferenceSystemTest.java [UTF-8] Mon Feb 19 22:19:33 2018 @@ -38,7 +38,7 @@ import static org.apache.sis.test.Assert * * @author Cédric Briançon (Geomatys) * @author Guilhem Legal (Geomatys) - * @version 0.4 + * @version 1.0 * @since 0.5 * @module */ @@ -76,7 +76,7 @@ public final strictfp class DirectRefere */ @Test public void marshallingTest() throws JAXBException { - assertMarshalEqualsFile(XML_FILE, createMetadata(false), "xmlns:*", "xsi:schemaLocation"); + assertMarshalEqualsFile(XML_FILE, createMetadata(false), VERSION_2007, "xmlns:*", "xsi:schemaLocation"); } /**