@Test
public void testRoundTripCapabilities() throws Exception {
CapabilitiesType caps = (CapabilitiesType) parser.parse(getClass().getResourceAsStream("Capabilities.xml"));
Encoder encoder = new Encoder(new CSWConfiguration());
encoder.setIndenting(true);
encoder.setNamespaceAware(true);
encoder.getNamespaces().declarePrefix("ows", OWS.NAMESPACE);
encoder.getNamespaces().declarePrefix("ogc", OGC.NAMESPACE);
encoder.getNamespaces().declarePrefix("gml", GML.NAMESPACE);
String encoded = encoder.encodeAsString(caps, CSW.Capabilities);
// System.out.println(encoded);
CapabilitiesType reParsed = (CapabilitiesType) parser.parse(new StringReader(encoded));
assertTrue(EMFUtils.emfEquals(caps, reParsed));
}