private void setOutputLimit(int kbytes) { GeoServer gs = getGeoServer(); WCSInfo info = gs.getService(WCSInfo.class); info.setMaxOutputMemory(kbytes); gs.save(info); } }
private void setOutputLimit(int kbytes) { GeoServer gs = getGeoServer(); WCSInfo info = gs.getService(WCSInfo.class); info.setMaxOutputMemory(kbytes); gs.save(info); }
private void setInputLimit(int kbytes) { GeoServer gs = getGeoServer(); WCSInfo info = gs.getService(WCSInfo.class); info.setMaxInputMemory(kbytes); gs.save(info); }
private void setInputLimit(int kbytes) { GeoServer gs = getGeoServer(); WCSInfo info = gs.getService(WCSInfo.class); info.setMaxInputMemory(kbytes); gs.save(info); }
@Test public void testTimeInputLimitsCustom() throws Exception { GeoServer gs = getGeoServer(); WCSInfo wcs = gs.getService(WCSInfo.class); wcs.setMaxRequestedDimensionValues(2); gs.save(wcs); try { String queryString = "&request=getcoverage&service=wcs&version=1.1.1&&format=image/geotiff" + "&BoundingBox=-45,146,-42,147,urn:ogc:def:crs:EPSG:6.6:4326&timeSequence=2010-01-01/2011-01-01/P1D"; Document dom = getAsDOM( "wcs/BlueMarble/wcs?identifier=" + getLayerId(TASMANIA_BM) + queryString); // print(dom); String text = checkOws11Exception(dom, ServiceException.INVALID_PARAMETER_VALUE, "time"); assertThat(text, containsString("More than 2 times")); } finally { wcs.setMaxRequestedDimensionValues( DimensionInfo.DEFAULT_MAX_REQUESTED_DIMENSION_VALUES); gs.save(wcs); } }
@Test public void testTimeTooMany() throws Exception { GeoServer gs = getGeoServer(); WCSInfo wcs = gs.getService(WCSInfo.class); wcs.setMaxRequestedDimensionValues(2); gs.save(wcs); try { String queryString = "request=getcoverage&service=wcs&version=1.0.0&format=image/geotiff" + "&bbox=0.237,40.562,14.593,44.558&crs=EPSG:4326&width=25&height=25&time=2008-10-31/2008-11-31/PT1H" + "&coverage=" + getLayerId(WATTEMP); MockHttpServletResponse response = getAsServletResponse("wcs?" + queryString); assertEquals("application/vnd.ogc.se_xml", response.getContentType()); Document dom = dom(response, true); // print(dom); String text = checkLegacyException(dom, ServiceException.INVALID_PARAMETER_VALUE, "time"); assertThat(text, containsString("More than 2 times")); } finally { wcs.setMaxRequestedDimensionValues( DimensionInfo.DEFAULT_MAX_REQUESTED_DIMENSION_VALUES); gs.save(wcs); } }