@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); Catalog catalog = (Catalog) applicationContext.getBean("catalog"); reader = new GetCoverageRequestReader(catalog); }
protected void checkOws11Exception(Document dom) throws Exception { assertEquals("ServiceExceptionReport", dom.getFirstChild().getNodeName()); assertEquals("1.2.0", dom.getFirstChild().getAttributes().getNamedItem("version") .getNodeValue()); assertXpathEvaluatesTo("1.2.0", "/ServiceExceptionReport/@version", dom); Node root = xpath.getMatchingNodes("/ServiceExceptionReport", dom).item(0); assertNotNull(root); }
/** * Parses a multipart message from the response * * @param response * @throws MessagingException * @throws IOException */ protected Multipart getMultipart(MockHttpServletResponse response) throws MessagingException, IOException { MimeMessage body = new MimeMessage((Session) null, getBinaryInputStream(response)); Multipart multipart = (Multipart) body.getContent(); return multipart; } }
protected void setupRasterDimension(String metadata, DimensionPresentation presentation, Double resolution) { CoverageInfo info = getCatalog().getCoverageByName(WATTEMP.getLocalPart()); DimensionInfo di = new DimensionInfoImpl(); di.setEnabled(true); di.setPresentation(presentation); if(resolution != null) { di.setResolution(new BigDecimal(resolution)); } info.getMetadata().put(metadata, di); getCatalog().save(info); } }
@Override protected void oneTimeSetUp() throws Exception { super.oneTimeSetUp(); Catalog catalog = (Catalog) applicationContext.getBean("catalog"); reader = new Wcs10GetCoverageRequestReader(catalog); }
@Override protected void populateDataDirectory(MockData dataDirectory) throws Exception { super.populateDataDirectory(dataDirectory); // this also adds the raster style dataDirectory.addCoverage(MOSAIC, MockData.class.getResource("raster-filter-test.zip"), null, "raster"); }
/** @return The global wfs instance from the application context. */ protected WCSInfo getWCS() { return getGeoServer().getService(WCSInfo.class); }
@Override protected void setUpInternal() throws Exception { super.setUpInternal(); kvpreader = (Wcs10GetCoverageRequestReader) applicationContext.getBean("wcs100GetCoverageRequestReader"); service = (WebCoverageService100) applicationContext.getBean("wcs100ServiceTarget"); configuration = new WCSConfiguration(); catalog=(Catalog)applicationContext.getBean("catalog"); xmlReader = new WcsXmlReader("GetCoverage", "1.0.0", configuration); // enable dimensions on the water temperature layer setupRasterDimension(ResourceInfo.TIME, DimensionPresentation.LIST, null); setupRasterDimension(ResourceInfo.ELEVATION, DimensionPresentation.LIST, null); }
protected void setupRasterDimension( QName layer, String metadata, DimensionPresentation presentation, Double resolution) { CoverageInfo info = getCatalog().getCoverageByName(layer.getLocalPart()); DimensionInfo di = new DimensionInfoImpl(); di.setEnabled(true); di.setPresentation(presentation); if (resolution != null) { di.setResolution(new BigDecimal(resolution)); } info.getMetadata().put(metadata, di); getCatalog().save(info); } }
@Override protected void oneTimeSetUp() throws Exception { super.oneTimeSetUp(); configuration = new WCSConfiguration(); reader = new WcsXmlReader("GetCoverage", "1.0.0", configuration); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); Catalog cat = getCatalog(); CoverageStoreInfo csi = cat.getCoverageStoreByName(SystemTestData.WORLD.getLocalPart()); csi.setEnabled(false); cat.save(csi); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); testData.addRasterLayer(MOSAIC, "raster-filter-test.zip", null, getCatalog()); testData.addRasterLayer( SPATIO_TEMPORAL, "spatio-temporal.zip", null, null, SystemTestData.class, getCatalog()); testData.addRasterLayer( new QName(MockData.WCS_URI, "category", MockData.WCS_PREFIX), "category.tiff", null, getCatalog()); // enable dimensions on the water temperature layer setupRasterDimension(WATTEMP, ResourceInfo.TIME, DimensionPresentation.LIST, null); setupRasterDimension(WATTEMP, ResourceInfo.ELEVATION, DimensionPresentation.LIST, null); }
@Override protected void onSetUp(SystemTestData testData) throws Exception { super.onSetUp(testData); testData.addRasterLayer(SF_RAIN, "rain.zip", "asc", getCatalog()); testData.addRasterLayer(GS_RAIN, "rain.zip", "asc", getCatalog()); testData.addRasterLayer( NO_RANGE, "norange.tiff", null, null, DescribeCoverageTest.class, getCatalog()); // the GUI builds the dimension without range, let's do the same here CoverageInfo noRange = getCatalog().getCoverageByName(getLayerId(NO_RANGE)); CoverageDimensionInfo cdi = noRange.getDimensions().get(0); cdi.setRange(null); getCatalog().save(noRange); GeoServerInfo global = getGeoServer().getGlobal(); global.getSettings().setProxyBaseUrl("src/test/resources/geoserver"); getGeoServer().save(global); }