public void testGetBasic() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0"); // print(dom); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); }
public void testPostBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; Document dom = postAsDOM(BASEPATH, request); // print(dom); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); }
@Test public void testUpdateSequenceInferiorGet() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&updateSequence=-1"); checkValidationErrors(dom, WCS11_SCHEMA); final Node root = dom.getFirstChild(); assertEquals("wcs:Capabilities", root.getNodeName()); assertTrue(root.getChildNodes().getLength() > 0); }
public void testUpdateSequenceInferiorPost() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" xmlns:ows=\"http://www.opengis.net/ows/1.1\"" + " xmlns:wcs=\"http://www.opengis.net/wcs\"" + " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"" + " updateSequence=\"-1\"/>"; Document dom = postAsDOM(BASEPATH, request); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); final Node root = dom.getFirstChild(); assertEquals("wcs:WCS_Capabilities", root.getNodeName()); assertTrue(root.getChildNodes().getLength() > 0); }
public void testUpdateSequenceInferiorGet() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&updateSequence=-1"); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); final Node root = dom.getFirstChild(); assertEquals("wcs:WCS_Capabilities", root.getNodeName()); assertTrue(root.getChildNodes().getLength() > 0); }
@Test public void testPostBasic() throws Exception { String request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<wcs:GetCapabilities service=\"WCS\" xmlns:ows=\"http://www.opengis.net/ows/1.1\" " + "xmlns:wcs=\"http://www.opengis.net/wcs/1.1.1\" " + "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"/>"; Document dom = postAsDOM(BASEPATH, request); // print(dom); checkValidationErrors(dom, WCS11_SCHEMA); }
@Test public void testUpdateSequenceInferiorGet() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&updateSequence=-1"); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); final Node root = dom.getFirstChild(); assertEquals("wcs:WCS_Capabilities", root.getNodeName()); assertTrue(root.getChildNodes().getLength() > 0); }
@Test public void testAcceptVersions() throws Exception { Document dom = getAsDOM( BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0&acceptversions=1.0.0"); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); }
@Test public void testSchemaLocation() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS"); checkValidationErrors(dom, WCS11_SCHEMA); assertXpathEvaluatesTo( "1", "count(//wcs:Capabilities[contains(@xsi:schemaLocation,'http://www.opengis.net/wcs/1.1.1 ')])", dom); }
public void testSectionsAll() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0§ion=/"); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); assertXpathEvaluatesTo("1", "count(//wcs:Service)", dom); assertXpathEvaluatesTo("1", "count(//wcs:Capability)", dom); assertXpathEvaluatesTo("1", "count(//wcs:ContentMetadata)", dom); }
@Test public void testUnsupportedVersionGet() throws Exception { Document dom = getAsDOM( BASEPATH + "?request=GetCapabilities&service=WCS&acceptVersions=9.9.9,8.8.8"); checkValidationErrors(dom, WCS11_SCHEMA); checkOws11Exception(dom); assertXpathEvaluatesTo( "VersionNegotiationFailed", "ows:ExceptionReport/ows:Exception/@exceptionCode", dom); }
public void testTimeCoverage() throws Exception { setupRasterDimension(ResourceInfo.TIME, DimensionPresentation.LIST, null); Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0"); // print(dom); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); // check the envelopes String base = "//wcs:CoverageOfferingBrief[wcs:name='wcs:watertemp']//wcs:lonLatEnvelope"; assertXpathEvaluatesTo("2008-10-31T00:00:00.000Z", base + "/gml:timePosition[1]", dom); assertXpathEvaluatesTo("2008-11-01T00:00:00.000Z", base + "/gml:timePosition[2]", dom); } }
@Test public void testSectionsBogus() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS§ions=Bogus"); checkValidationErrors(dom, WCS11_SCHEMA); checkOws11Exception(dom); assertXpathEvaluatesTo( WcsExceptionCode.InvalidParameterValue.toString(), "/ows:ExceptionReport/ows:Exception/@exceptionCode", dom); }
@Test public void testSectionsAll() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0§ion=/"); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); assertXpathEvaluatesTo("1", "count(//wcs:Service)", dom); assertXpathEvaluatesTo("1", "count(//wcs:Capability)", dom); assertXpathEvaluatesTo("1", "count(//wcs:ContentMetadata)", dom); }
@Test public void testTimeRangeCoverage() throws Exception { setupRasterDimension(TIMERANGES, ResourceInfo.TIME, DimensionPresentation.LIST, null); Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0"); // print(dom); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); // check the envelopes String base = "//wcs:CoverageOfferingBrief[wcs:name='sf:timeranges']//wcs:lonLatEnvelope"; assertXpathEvaluatesTo("2008-10-31T00:00:00.000Z", base + "/gml:timePosition[1]", dom); assertXpathEvaluatesTo("2008-11-07T00:00:00.000Z", base + "/gml:timePosition[2]", dom); } }
@Test public void testTimeCoverage() throws Exception { setupRasterDimension(WATTEMP, ResourceInfo.TIME, DimensionPresentation.LIST, null); Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS&version=1.0.0"); // print(dom); checkValidationErrors(dom, WCS10_GETCAPABILITIES_SCHEMA); // check the envelopes String base = "//wcs:CoverageOfferingBrief[wcs:name='wcs:watertemp']//wcs:lonLatEnvelope"; assertXpathEvaluatesTo("2008-10-31T00:00:00.000Z", base + "/gml:timePosition[1]", dom); assertXpathEvaluatesTo("2008-11-01T00:00:00.000Z", base + "/gml:timePosition[2]", dom); }
@Test public void testTwoSection() throws Exception { Document dom = getAsDOM( BASEPATH + "?request=GetCapabilities&service=WCS§ions=ServiceProvider,Contents"); checkValidationErrors(dom, WCS11_SCHEMA); assertXpathEvaluatesTo("0", "count(//ows:ServiceIdentification)", dom); assertXpathEvaluatesTo("1", "count(//ows:ServiceProvider)", dom); assertXpathEvaluatesTo("0", "count(//ows:OperationsMetadata)", dom); assertXpathEvaluatesTo("1", "count(//wcs:Contents)", dom); }
@Test public void testOneSection() throws Exception { Document dom = getAsDOM( BASEPATH + "?request=GetCapabilities&service=WCS§ions=ServiceProvider"); checkValidationErrors(dom, WCS11_SCHEMA); assertXpathEvaluatesTo("0", "count(//ows:ServiceIdentification)", dom); assertXpathEvaluatesTo("1", "count(//ows:ServiceProvider)", dom); assertXpathEvaluatesTo("0", "count(//ows:OperationsMetadata)", dom); assertXpathEvaluatesTo("0", "count(//wcs:Contents)", dom); }
@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); }
@Test public void testSectionsAll() throws Exception { Document dom = getAsDOM(BASEPATH + "?request=GetCapabilities&service=WCS§ions=All"); checkValidationErrors(dom, WCS11_SCHEMA); assertXpathEvaluatesTo("1", "count(//ows:ServiceIdentification)", dom); assertXpathEvaluatesTo("1", "count(//ows:ServiceProvider)", dom); assertXpathEvaluatesTo("1", "count(//ows:OperationsMetadata)", dom); assertXpathEvaluatesTo("1", "count(//wcs:Contents)", dom); }