public ContactInfo createContact() { return new ContactInfoImpl(); }
public Object doUnmarshal( Object result, HierarchicalStreamReader reader, UnmarshallingContext context) { SettingsInfoImpl obj = (SettingsInfoImpl) super.doUnmarshal(result, reader, context); if (obj.getMetadata() == null) { obj.setMetadata(new MetadataMap()); } if (obj.getContact() == null) { obj.setContact(new ContactInfoImpl()); } if (obj.getClientProperties() == null) { obj.setClientProperties(new HashMap<Object, Object>()); } return obj; } }
@Test public void testNoServiceContactInfo() throws Exception { // alter geoserver state so that there is no contact information getGeoServer().getGlobal().setContact(new ContactInfoImpl()); Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS"); // print(dom); checkValidationErrors(dom, WCS11_SCHEMA); }
@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(); }
/** * 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(); }
public void initContact() { ContactInfo contactInfo = new ContactInfoImpl(); contactInfo.setAddress("1600 Pennsylvania Avenue"); contactInfo.setAddressCity("Washington"); contactInfo.setAddressPostalCode("20001"); contactInfo.setAddressCountry("United States"); contactInfo.setAddressState("DC"); contactInfo.setAddressDeliveryPoint("The White House"); contactInfo.setAddressElectronicMailAddress("info@whitehouse.gov"); GeoServerInfo geoServerInfo = geoServer.getGlobal(); SettingsInfo settingsInfo = geoServerInfo.getSettings(); settingsInfo.setContact(contactInfo); geoServer.save(geoServerInfo); }
ContactInfo contactInfo = new ContactInfoImpl(); geosInfo.setContact(contactInfo); contactInfo.setContactPerson("contactPerson");