/** * Tests marshalling with replacement of {@link DefaultResponsibility} by {@link DefaultResponsibleParty}. * * @throws JAXBException if an error occurred during the marshalling. */ @Test public void testLegacyMarshalling() throws JAXBException { final DefaultIndividual party = new DefaultIndividual("An author", null, null); final DefaultResponsibleParty r = new DefaultResponsibleParty(Role.AUTHOR); final DefaultCitation citation = new DefaultCitation(); r.setParties(singleton(party)); citation.setCitedResponsibleParties(singleton(r)); final String xml = marshal(citation, VERSION_2007); assertXmlEquals("<gmd:CI_Citation xmlns:gco=\"" + LegacyNamespaces.GCO + '"' + " xmlns:gmd=\"" + LegacyNamespaces.GMD + "\">\n" + " <gmd:citedResponsibleParty>\n" + " <gmd:CI_ResponsibleParty>\n" + " <gmd:individualName>\n" + " <gco:CharacterString>An author</gco:CharacterString>\n" + " </gmd:individualName>\n" + " <gmd:role>\n" + " <gmd:CI_RoleCode codeList=\"http://schemas.opengis.net/iso/19139/20070417/resources/Codelist/gmxCodelists.xml#CI_RoleCode\" codeListValue=\"author\">Author</gmd:CI_RoleCode>\n" + " </gmd:role>\n" + " </gmd:CI_ResponsibleParty>\n" + " </gmd:citedResponsibleParty>\n" + "</gmd:CI_Citation>\n", xml, "xmlns:*"); } }