* @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);
assertXmlEquals(
"<gmd:LI_Lineage xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
" <gmd:source>\n" +
" <gmd:LI_Source>\n" +
" <gmd:description>\n" +
" <gco:CharacterString>Description of source data level.</gco:CharacterString>\n" +
" </gmd:description>\n" +
" </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);
assertXmlEquals(
"<gmd:LI_Lineage xmlns:gmd=\"" + Namespaces.GMD + "\">\n" +
" <gmd:source>\n" +
" <gmi:LE_Source>\n" +