@Test public void testSetClientPropsHasEffect() throws Exception { GeoServerInfoImpl gsii = new GeoServerInfoImpl(geoServer); Map<Object, Object> before = gsii.getClientProperties(); Map<Object, Object> newProps = new HashMap<Object, Object>(); newProps.put("123", "456"); gsii.setClientProperties(newProps); assertFalse(before.equals(newProps)); }
setContact(contact); contact = null; setCharset(charset); charset = null; setTitle(title); title = null; setNumDecimals(numDecimals); numDecimals = null; setOnlineResource(onlineResource); onlineResource = null; setSchemaBaseUrl(schemaBaseUrl); schemaBaseUrl = null; setProxyBaseUrl(proxyBaseUrl); proxyBaseUrl = null; setVerbose(verbose); verbose = null; setVerboseExceptions(verboseExceptions); verboseExceptions = null;
protected void resolve(GeoServerInfo info) { GeoServerInfoImpl global = (GeoServerInfoImpl) info; if (global.getMetadata() == null) { global.setMetadata(new MetadataMap()); } if (global.getClientProperties() == null) { global.setClientProperties(new HashMap<Object, Object>()); } if (global.getCoverageAccess() == null) { global.setCoverageAccess(new CoverageAccessInfoImpl()); } }
@Before public void internalSetUp() throws IOException { this.catalog = getCatalog(); geosConfig = new GeoServerImpl(); geosInfo = new GeoServerInfoImpl(geosConfig); geosInfo.setContact(new ContactInfoImpl()); geosConfig.setGlobal(geosInfo); wmsInfo = new WMSInfoImpl(); geosConfig.add(wmsInfo); geosConfig.setCatalog(catalog); wmsConfig = new WMS(geosConfig); wmsConfig.setApplicationContext(applicationContext); req = new GetCapabilitiesRequest(); req.setBaseUrl(baseUrl); getTestData() .copyTo( getClass().getResourceAsStream("/legendURL/BasicPolygons.png"), LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/BasicPolygons.png"); getTestData() .copyTo( getClass().getResourceAsStream("/legendURL/Bridges.png"), LegendSampleImpl.LEGEND_SAMPLES_FOLDER + "/Bridges.png"); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); namespaces.put("wms", "http://www.opengis.net/wms"); namespaces.put("ows", "http://www.opengis.net/ows"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); XPATH = XMLUnit.newXpathEngine(); }
public GeoServerInfo createGlobal() { return new GeoServerInfoImpl(gs); }
mockGeoServer.setCatalog(catalog); GeoServerInfoImpl geoserverInfo = new GeoServerInfoImpl(mockGeoServer); geoserverInfo.setId("geoserver"); mockGeoServer.setGlobal(geoserverInfo);
geosInfo.setContact(contactInfo); contactInfo.setContactPerson("contactPerson"); contactInfo.setContactOrganization("contactOrganization");
if (getResourceErrorHandling() == null) { if (other.getResourceErrorHandling() != null) return false; } else { if (!getResourceErrorHandling().equals(other.getResourceErrorHandling())) return false;
/** * Sets up the configuration objects with default values. Since they're live, specific tests can * modify their state before running the assertions */ @Before public void setUp() throws Exception { geosConfig = new GeoServerImpl(); geosInfo = new GeoServerInfoImpl(geosConfig); geosInfo.setContact(new ContactInfoImpl()); geosConfig.setGlobal(geosInfo); wmsInfo = new WMSInfoImpl(); geosConfig.add(wmsInfo); catalog = new CatalogImpl(); geosConfig.setCatalog(catalog); wmsConfig = new WMS(geosConfig); req = new GetCapabilitiesRequest(); req.setBaseUrl(baseUrl); Map<String, String> namespaces = new HashMap<String, String>(); namespaces.put("xlink", "http://www.w3.org/1999/xlink"); XMLUnit.setXpathNamespaceContext(new SimpleNamespaceContext(namespaces)); XPATH = XMLUnit.newXpathEngine(); }
void createAppContext(String proxyBaseUrl) { SettingsInfo settings = createNiceMock(SettingsInfo.class); expect(settings.getProxyBaseUrl()).andReturn(proxyBaseUrl).anyTimes(); replay(settings); GeoServer geoServer = createNiceMock(GeoServer.class); expect(geoServer.getGlobal()).andReturn(new GeoServerInfoImpl()); expect(geoServer.getSettings()).andReturn(settings).anyTimes(); replay(geoServer); ProxifyingURLMangler mangler = new ProxifyingURLMangler(geoServer); ApplicationContext appContext = createNiceMock(ApplicationContext.class); expect(appContext.getBeanNamesForType(URLMangler.class)) .andReturn(new String[] {"mangler"}); expect(appContext.getBean("mangler")).andReturn(mangler).anyTimes(); replay(appContext); GeoServerExtensionsHelper.init(appContext); }
@Test public void testGetProxyBaseURL() { SettingsInfo settings = new SettingsInfoImpl(); settings.setProxyBaseUrl("https://foo.com/geoserver"); GeoServerInfo info = new GeoServerInfoImpl(); info.setSettings(settings); GeoServer gs = new GeoServerImpl(); gs.setGlobal(info); TestWfsPost servlet = new TestWfsPost() { @Override protected GeoServer getGeoServer() { return gs; } }; assertEquals("https://foo.com/geoserver", servlet.getProxyBaseURL()); }