/** * Tests XML marshalling of {@code <gcx:MimeFileType>} inside {@code <mcc:MD_BrowseGraphic>}. * This method uses the XML schema defined by ISO 19115-3. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @Test public void testMimeFileType() throws JAXBException { final DefaultBrowseGraphic browse = new DefaultBrowseGraphic(); browse.setFileType("image/tiff"); roundtrip(browse, "<mcc:MD_BrowseGraphic xmlns:mcc=\"" + Namespaces.MCC + '"' + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <mcc:fileType>\n" + " <gcx:MimeFileType type=\"image/tiff\">image/tiff</gcx:MimeFileType>\n" + " </mcc:fileType>\n" + "</mcc:MD_BrowseGraphic>"); }
/** * Tests XML marshalling of {@code <gcx:FileName>} and {@code <gcx:MimeFileType>} together. * This method uses the XML schema defined by ISO 19115-3. * * @throws JAXBException if an error occurred while (un)marshalling the {@code BrowseGraphic}. */ @Test @DependsOnMethod({"testFileName", "testMimeFileType"}) public void testFileNameAndType() throws JAXBException { final DefaultBrowseGraphic browse = new DefaultBrowseGraphic(URI.create("file:/catalog/image.png")); browse.setFileType("image/tiff"); roundtrip(browse, "<mcc:MD_BrowseGraphic xmlns:mcc=\"" + Namespaces.MCC + '"' + " xmlns:gcx=\"" + Namespaces.GCX + "\">\n" + " <mcc:fileName>\n" + " <gcx:FileName src=\"file:/catalog/image.png\">image.png</gcx:FileName>\n" + " </mcc:fileName>\n" + " <mcc:fileType>\n" + " <gcx:MimeFileType type=\"image/tiff\">image/tiff</gcx:MimeFileType>\n" + " </mcc:fileType>\n" + "</mcc:MD_BrowseGraphic>"); }
public void testStringSubstitution() throws JAXBException { final DefaultBrowseGraphic browse = new DefaultBrowseGraphic(URI.create("file:/catalog/image.png")); browse.setFileType("image/tiff");