* @see <a href="http://issues.apache.org/jira/browse/SIS-160">SIS-160: Need XSLT between GML 3.1 and 3.2</a>
*/
@Test
public void testGML31() throws JAXBException {
final Version version = new Version("3.1");
final MarshallerPool pool = getMarshallerPool();
final Unmarshaller unmarshaller = pool.acquireUnmarshaller();
unmarshaller.setProperty(XML.GML_VERSION, version);
final DefaultVerticalDatum datum =
(DefaultVerticalDatum) unmarshaller.unmarshal(getClass().getResource(GML31_FILE));
pool.recycle(unmarshaller);
/*
* Following attribute exists in GML 3.1 only.
*/
assertEquals("vertDatumType", VerticalDatumType.GEOIDAL, datum.getVerticalDatumType());
/*
* The name, anchor definition and domain of validity are lost because
* those property does not have the same XML element name (SIS-160).
* Below is all we have.
*/
assertEquals("remarks", "Approximates geoid.", datum.getRemarks().toString());
assertEquals("scope", "Hydrography.", datum.getScope().toString());
/*
* Test marshaling. We can not yet compare with the original XML file
* because of all the information lost. This may be fixed in a future
* SIS version (SIS-160).
*/
final Marshaller marshaller = pool.acquireMarshaller();
marshaller.setProperty(XML.GML_VERSION, version);
final String xml = marshal(marshaller, datum);
pool.recycle(marshaller);
assertXmlEquals(
"<gml:VerticalDatum xmlns:gml=\"" + LegacyNamespaces.GML + "\">\n" +
" <gml:remarks>Approximates geoid.</gml:remarks>\n" +
" <gml:scope>Hydrography.</gml:scope>\n" +
" <gml:verticalDatumType>geoidal</gml:verticalDatumType>\n" +