CatalogFactory cFactory = catalog.getFactory();
WorkspaceInfo ws = cFactory.createWorkspace();
ws.setName( "foo" );
WMSStoreInfo wms1 = cFactory.createWebMapServer();
wms1.setName( "bar" );
wms1.setWorkspace( ws );
wms1.setCapabilitiesURL( "http://fake.host/wms?request=GetCapabilities&service=wms");
wms1.getMetadata().put("maxConnections", Integer.valueOf(18));
wms1.getMetadata().put("connectTimeout", Integer.valueOf(25));
wms1.getMetadata().put("readTimeout", Integer.valueOf(78));
ByteArrayOutputStream out = out();
persister.save( wms1, out );
WMSStoreInfo wms2 = persister.load( in( out ), WMSStoreInfo.class );
assertEquals( "bar", wms2.getName() );
assertEquals(18, wms2.getMaxConnections());
assertEquals(25, wms2.getConnectTimeout());
assertEquals(78, wms2.getReadTimeout());
assertNull(wms2.getMetadata().get("maxConnections"));
assertNull(wms2.getMetadata().get("connectTimeout"));
assertNull(wms2.getMetadata().get("readTimeout"));
}