org.geoserver.wfs.WFSException.getLocator()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.geoserver.wfs.WFSException.getLocator()方法的一些代码示例,展示了WFSException.getLocator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WFSException.getLocator()方法的具体详情如下:
包路径:org.geoserver.wfs.WFSException
类名称:WFSException
方法名:getLocator

WFSException.getLocator介绍

暂无

代码示例

代码示例来源:origin: org.geoserver/gs-wfs

  1. /** Same as GEOS-1875, but let's check without bbox and without name prefix */
  2. @SuppressWarnings("unchecked")
  3. @Test
  4. public void testInvalidTypeName() throws Exception {
  5. Map raw = new HashMap();
  6. raw.put("service", "WFS");
  7. raw.put("version", "1.1.0");
  8. raw.put("request", "GetFeature");
  9. raw.put("typeName", "InvalidTypeName");
  10. try {
  11. Map parsed = parseKvp(raw);
  12. reader.read(WfsFactory.eINSTANCE.createGetFeatureType(), parsed, raw);
  13. } catch (WFSException e) {
  14. assertEquals("InvalidParameterValue", e.getCode());
  15. assertEquals("typeName", e.getLocator());
  16. // System.out.println(e.getMessage());
  17. assertTrue(e.getMessage().contains("InvalidTypeName"));
  18. }
  19. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. /** https://osgeo-org.atlassian.net/browse/GEOS-1875 */
  2. @Test
  3. @SuppressWarnings("unchecked")
  4. public void testInvalidTypeNameBbox() throws Exception {
  5. Map raw = new HashMap();
  6. raw.put("service", "WFS");
  7. raw.put("version", "1.1.0");
  8. raw.put("request", "GetFeature");
  9. raw.put("bbox", "-80.4864795578115,25.6176257083275,-80.3401307394915,25.7002737069969");
  10. raw.put("typeName", "cite:InvalidTypeName");
  11. Map parsed = parseKvp(raw);
  12. try {
  13. // before fix for GEOS-1875 this would bomb out with an NPE instead of the proper
  14. // exception
  15. reader.read(WfsFactory.eINSTANCE.createGetFeatureType(), parsed, raw);
  16. } catch (WFSException e) {
  17. assertEquals("InvalidParameterValue", e.getCode());
  18. assertEquals("typeName", e.getLocator());
  19. System.out.println(e.getMessage());
  20. assertTrue(e.getMessage().contains("cite:InvalidTypeName"));
  21. }
  22. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. /**
  2. * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link Delete}-Action.
  3. *
  4. * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
  5. */
  6. @Test
  7. public void testWFS11Delete() {
  8. WFSException tmpEx = new WFSException(new Delete.WFS11(deleteElementType1), "test");
  9. // WFS 1.x: no locator
  10. Assert.assertNull(tmpEx.getLocator());
  11. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. /**
  2. * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link Delete}-Action.
  3. *
  4. * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
  5. */
  6. @Test
  7. public void testWFS20Delete() {
  8. WFSException tmpEx = new WFSException(new Delete.WFS20(deleteType2), "test");
  9. Assert.assertEquals("Delete", tmpEx.getLocator());
  10. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. /**
  2. * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link
  3. * GetFeatureRequest}-Action.
  4. *
  5. * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
  6. */
  7. @Test
  8. public void testWFS20GetFeatureType() {
  9. WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS20(getFeatureType2), "test");
  10. Assert.assertEquals("GetFeature", tmpEx.getLocator());
  11. }
  12. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. /**
  2. * Test {@link WFSException#init(Object)} for Exception with a WFS11 {@link
  3. * GetFeatureRequest}-Action.
  4. *
  5. * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
  6. */
  7. @Test
  8. public void testWFS11GetFeatureType() {
  9. WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS11(getFeatureType1), "test");
  10. // WFS 1.x: no locator, GetFeature type is a top-level request and provides a default
  11. // version (1.1.0)
  12. Assert.assertNull(tmpEx.getLocator());
  13. }

代码示例来源:origin: org.geoserver/gs-wfs

  1. && (e.getLocator() == null
  2. || "GetFeature".equalsIgnoreCase(e.getLocator()))) {
  3. e.setLocator(query.getHandle());

相关文章