gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-26 21:11:05 27 4
gpt4 key购买 nike

本文整理了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

/** Same as GEOS-1875, but let's check without bbox and without name prefix */
@SuppressWarnings("unchecked")
@Test
public void testInvalidTypeName() throws Exception {
  Map raw = new HashMap();
  raw.put("service", "WFS");
  raw.put("version", "1.1.0");
  raw.put("request", "GetFeature");
  raw.put("typeName", "InvalidTypeName");
  try {
    Map parsed = parseKvp(raw);
    reader.read(WfsFactory.eINSTANCE.createGetFeatureType(), parsed, raw);
  } catch (WFSException e) {
    assertEquals("InvalidParameterValue", e.getCode());
    assertEquals("typeName", e.getLocator());
    // System.out.println(e.getMessage());
    assertTrue(e.getMessage().contains("InvalidTypeName"));
  }
}

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

/** https://osgeo-org.atlassian.net/browse/GEOS-1875 */
@Test
@SuppressWarnings("unchecked")
public void testInvalidTypeNameBbox() throws Exception {
  Map raw = new HashMap();
  raw.put("service", "WFS");
  raw.put("version", "1.1.0");
  raw.put("request", "GetFeature");
  raw.put("bbox", "-80.4864795578115,25.6176257083275,-80.3401307394915,25.7002737069969");
  raw.put("typeName", "cite:InvalidTypeName");
  Map parsed = parseKvp(raw);
  try {
    // before fix for GEOS-1875 this would bomb out with an NPE instead of the proper
    // exception
    reader.read(WfsFactory.eINSTANCE.createGetFeatureType(), parsed, raw);
  } catch (WFSException e) {
    assertEquals("InvalidParameterValue", e.getCode());
    assertEquals("typeName", e.getLocator());
    System.out.println(e.getMessage());
    assertTrue(e.getMessage().contains("cite:InvalidTypeName"));
  }
}

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

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

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

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

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

/**
   * Test {@link WFSException#init(Object)} for Exception with a WFS20 {@link
   * GetFeatureRequest}-Action.
   *
   * @see "https://osgeo-org.atlassian.net/browse/GEOS-5857"
   */
  @Test
  public void testWFS20GetFeatureType() {
    WFSException tmpEx = new WFSException(new GetFeatureRequest.WFS20(getFeatureType2), "test");
    Assert.assertEquals("GetFeature", tmpEx.getLocator());
  }
}

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

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

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

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

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com