Search in sources :

Example 16 with MarshallerPool

use of org.apache.sis.xml.MarshallerPool in project sis by apache.

the class DefaultPrimeMeridianTest method testMarshallGML31.

/**
 * Tests marshalling in the GML 3.1 namespace.
 *
 * @throws JAXBException if an error occurred during marshalling.
 */
@Test
@DependsOnMethod("testMarshall")
public void testMarshallGML31() throws JAXBException {
    final DefaultPrimeMeridian pm = new DefaultPrimeMeridian(PrimeMeridianMock.GREENWICH);
    final MarshallerPool pool = getMarshallerPool();
    final Marshaller marshaller = pool.acquireMarshaller();
    marshaller.setProperty(XML.GML_VERSION, LegacyNamespaces.VERSION_3_0);
    final String xml = marshal(marshaller, pm);
    pool.recycle(marshaller);
    assertXmlEquals(getGreenwichXml(LegacyNamespaces.GML), xml, "xmlns:*", "xsi:schemaLocation");
}
Also used : Marshaller(javax.xml.bind.Marshaller) MarshallerPool(org.apache.sis.xml.MarshallerPool) Test(org.junit.Test) DependsOnMethod(org.apache.sis.test.DependsOnMethod)

Aggregations

MarshallerPool (org.apache.sis.xml.MarshallerPool)16 Marshaller (javax.xml.bind.Marshaller)9 Test (org.junit.Test)7 Unmarshaller (javax.xml.bind.Unmarshaller)5 HashMap (java.util.HashMap)3 DependsOnMethod (org.apache.sis.test.DependsOnMethod)3 BeforeClass (org.junit.BeforeClass)2 StringWriter (java.io.StringWriter)1 XMLComparator (org.apache.sis.test.XMLComparator)1 IdentifiedObjectMock (org.apache.sis.test.mock.IdentifiedObjectMock)1 Version (org.apache.sis.util.Version)1 CitationDate (org.opengis.metadata.citation.CitationDate)1 ResponsibleParty (org.opengis.metadata.citation.ResponsibleParty)1 BrowseGraphic (org.opengis.metadata.identification.BrowseGraphic)1