wms.setWorkspace( ws );
wms.setName( "foo" );
wms.setCapabilitiesURL( "http://fake.host/wms?request=getCapabilities");
catalog.add( wms );
WMSLayerInfo wl = cFactory.createWMSLayer();
wl.setStore( wms );
wl.setNamespace( ns );
wl.setName( "wmsLayer" );
wl.setAbstract( "abstract");
wl.setSRS( "EPSG:4326");
wl.setNativeCRS( CRS.decode( "EPSG:4326") );
ByteArrayOutputStream out = out();
persister.save( wl, out );
// System.out.println( new String(out.toByteArray()) );
persister.setCatalog( catalog );
wl = persister.load( in( out ), WMSLayerInfo.class );
assertNotNull( wl );
assertEquals( "wmsLayer", wl.getName() );
assertEquals( wms, wl.getStore() );
assertEquals( ns, wl.getNamespace() );
assertEquals( "EPSG:4326", wl.getSRS() );
assertTrue( CRS.equalsIgnoreMetadata( CRS.decode( "EPSG:4326"), wl.getNativeCRS() ) );
Document dom = dom( in( out ) );
assertEquals( "wmsLayer", dom.getDocumentElement().getNodeName() );
}