public MetadataMap getMetadata() { return delegate.getMetadata(); }
/** * Check maxConnections, connectTimeout, and readTimeout, stored as metadata properties in a * 2.1.3+ configuration are read back as actual properties. */ @Test public void testWMSStoreBackwardsCompatibility() throws Exception { Catalog catalog = new CatalogImpl(); 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")); }
MetadataMap metadata = wmsStore.getMetadata(); Integer maxConnections = null; Integer connectTimeout = null;
@Override public void visit(WMSStoreInfo wmsStore) { WMSStoreInfo otherWmsStore = otherCatalog.getStore(wmsStore.getId(), WMSStoreInfo.class); if (!(Objects.equals(wmsStore, otherWmsStore) && Objects.equals(wmsStore.getType(), otherWmsStore.getType()) && Objects.equals(wmsStore.getCapabilitiesURL(), otherWmsStore.getCapabilitiesURL()) && Objects.equals(wmsStore.getUsername(), otherWmsStore.getUsername()) && Objects.equals(wmsStore.getPassword(), otherWmsStore.getPassword()) && Objects.equals(wmsStore.getMaxConnections(), otherWmsStore.getMaxConnections()) && Objects.equals(wmsStore.getReadTimeout(), otherWmsStore.getReadTimeout()) && Objects.equals(wmsStore.getConnectTimeout(), otherWmsStore.getConnectTimeout()) && checkEquals(wmsStore.getMetadata(), otherWmsStore.getMetadata()) && checkEquals( wmsStore.getConnectionParameters(), otherWmsStore.getConnectionParameters()))) { differences.add(new InfoDiff(wmsStore, otherWmsStore)); } }