Exemple #1
0
  /** See GEOS-5003 */
  @Test
  public void testNullsInDimensionAndTimeParameters() throws Exception {
    TileLayerInfoUtil.updateAcceptAllFloatParameterFilter(tileLayerInfo, "ELEVATION", true);
    TileLayerInfoUtil.updateAcceptAllRegExParameterFilter(tileLayerInfo, "TIME", true);
    tileLayer = new GeoServerTileLayer(layer, gridSetBroker, tileLayerInfo);

    GetMapRequest request = new GetMapRequest();
    @SuppressWarnings("unchecked")
    Map<String, String> rawKvp = new CaseInsensitiveMap(new HashMap<String, String>());
    request.setRawKvp(rawKvp);

    StringBuilder target = new StringBuilder();

    boolean cachingPossible;

    request.setElevation(Arrays.asList((Object) null));
    cachingPossible = mediator.isCachingPossible(tileLayer, request, target);
    assertTrue(cachingPossible);
    assertEquals(0, target.length());
    request.setElevation(Collections.emptyList());

    request.setTime(Arrays.asList((Object) null));
    cachingPossible = mediator.isCachingPossible(tileLayer, request, target);
    assertTrue(cachingPossible);
    assertEquals(0, target.length());
  }