WebFeatureService extends AbstractOWS { SupportedEncodings parseEncodings( DeegreeWFS jaxbConfig ) { SupportedRequests supportedRequests = jaxbConfig.getSupportedRequests(); if ( supportedRequests != null ) { if ( isAtLeastOneRequestTypeConfigured( supportedRequests ) || isGlobalSupportedEncodingsConfigured( supportedRequests ) ) return parseEncodings( supportedRequests ); } return new UnlimitedSupportedEncodings(); } WebFeatureService( ResourceMetadata<OWS> metadata, Workspace workspace, Object jaxbConfig ); @Override void init( DeegreeServicesMetadataType serviceMetadata, DeegreeServiceControllerType mainConf,
                      Object controllerConf ); @Override void destroy(); WfsFeatureStoreManager getStoreManager(); StoredQueryHandler getStoredQueryHandler(); @Override void doKVP( Map<String, String> kvpParamsUC, HttpServletRequest request, HttpResponseBuffer response,
                       List<FileItem> multiParts ); @Override void doXML( XMLStreamReader xmlStream, HttpServletRequest request, HttpResponseBuffer response,
                       List<FileItem> multiParts ); @Override void doSOAP( SOAPEnvelope soapDoc, HttpServletRequest request, HttpResponseBuffer response,
                        List<FileItem> multiParts, SOAPFactory factory ); static XMLStreamWriter getXMLResponseWriter( HttpResponseBuffer writer, String mimeType,
                                                        String schemaLocation ); @Override XMLExceptionSerializer getExceptionSerializer( Version requestVersion ); int getQueryMaxFeatures(); BigInteger getResolveTimeOutInSeconds(); boolean getCheckAreaOfUse(); ICRS getDefaultQueryCrs(); boolean isEnableResponsePaging(); boolean isSoapSupported(); ReferencePatternMatcher getReferencePatternMatcher();  }
@Test public void testParseEncodingsWithRequestTypeSpecific() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithRequestTypeSpecific(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "xml", "soap" ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings, hasOnlyItems( "xml" ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings, hasOnlyItems( "xml" ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings.size(), is( 0 ) ); }
@Test public void testParseEncodingsWithKvpForAll() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithKvpForAll(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "kvp", "xml", "soap" ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings, hasOnlyItems( "kvp", "xml" ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings, hasOnlyItems( "kvp", "xml" ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings.size(), is( 0 ) ); }
@Test public void testParseEncodingsWithKvpForAllAndNoRequestTypesSpecific() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithKvpForAllAndNoRequestTypesSpecific(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "kvp" ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings, hasOnlyItems( "kvp" ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings, hasOnlyItems( "kvp" ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings, hasOnlyItems( "kvp" ) ); }
@Test public void testParseEncodingsWithKvpForAllAndEmptyRequestTypeSpecific() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithKvpForAllAndEmptyRequestTypeSpecific(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "kvp" ) ); assertThat( capabilitiesEncodings, not( hasOnlyItems( "xml", "soap" ) ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings, hasOnlyItems( "kvp" ) ); assertThat( capabilitiesEncodings, not( hasOnlyItems( "xml", "soap" ) ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings.size(), is( 0 ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings.size(), is( 0 ) ); }
@Test public void testParseEncodingsWithEmptyAndSupportedRequestTypeSpecific() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithEmptyAndSupportedRequestTypeSpecific(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "xml", "soap" ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings, hasOnlyItems( "xml", "soap", "kvp" ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings, hasOnlyItems( "xml" ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings.size(), is( 0 ) ); }
@Test public void testParseEncodingsWithEmptyRequestTypesSpecific() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithEmptyRequestTypesSpecific(); LimitedSupportedEncodings limitedSupportedEncodings = (LimitedSupportedEncodings) webFeatureService.parseEncodings( supportedRequests ); Map<WFSRequestType, Set<String>> enabledEncodings = limitedSupportedEncodings.getEnabledEncodingsPerRequestType(); Set<String> capabilitiesEncodings = enabledEncodings.get( GetCapabilities ); assertThat( capabilitiesEncodings, hasOnlyItems( "kvp", "xml", "soap" ) ); Set<String> getFeatureEncodings = enabledEncodings.get( GetFeature ); assertThat( getFeatureEncodings, hasOnlyItems( "kvp", "xml", "soap" ) ); Set<String> describeFeatureTypeEncodings = enabledEncodings.get( DescribeFeatureType ); assertThat( describeFeatureTypeEncodings.size(), is( 0 ) ); Set<String> getPropertyValueEncodings = enabledEncodings.get( GetPropertyValue ); assertThat( getPropertyValueEncodings.size(), is( 0 ) ); }
@Test public void testParseEncodingsWithoutRequestTypesSpecificAndKvp() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithoutRequestTypesSpecificAndKvp(); SupportedEncodings unlimitedSupportedEncodings = webFeatureService.parseEncodings( supportedRequests ); assertThat( unlimitedSupportedEncodings, CoreMatchers.instanceOf( UnlimitedSupportedEncodings.class ) ); }
@Test public void testParseEncodingsWithoutSupportedRequestConfiguration() { DeegreeWFS supportedRequests = prepareSupportedRequestsWithoutSupportedRequestConfiguration(); SupportedEncodings unlimitedSupportedEncodings = webFeatureService.parseEncodings( supportedRequests ); assertThat( unlimitedSupportedEncodings, CoreMatchers.instanceOf( UnlimitedSupportedEncodings.class ) ); }