/** @see TileLayerDispatcher#getLayerNames() */ public Set<String> getLayerNames() { return tileLayerDispatcher.getLayerNames(); }
public Set<String> getLayerNames() { return tld.getLayerNames(); }
public Set<String> getTileLayerNames() { return tld.getLayerNames(); }
public Set<String> getTileLayerNames() { return tld.getLayerNames(); }
/** * Get List of layers as xml * * @param request * @return */ @RequestMapping(value = "/layers", method = RequestMethod.GET) public XStreamListAliasWrapper layersGet(HttpServletRequest request) { return new XStreamListAliasWrapper( layerDispatcher.getLayerNames(), "layer", Set.class, this.getClass()); }
throws GeoWebCacheException { Set<String> layerList = new TreeSet<String>(tileLayerDispatcher.getLayerNames()); for (String layerName : layerList) { TileLayer layer = tileLayerDispatcher.getTileLayer(layerName);
new LayerCacheInfoBuilder(cacheRoot, cleanUpExecutorService, quotaUsageMonitor); for (String layerName : tileLayerDispatcher.getLayerNames()) {
extension = "xml"; List<String> layerNames = new ArrayList<String>(layerDispatcher.getLayerNames()); Collections.sort(layerNames);
private void mockTileLayerDispatcher() throws Exception { when(tld.getConfiguration(same(tileLayer))).thenReturn(config); when(tld.getConfiguration(same(tileLayerGroup))).thenReturn(config); when(tld.getConfiguration(eq(tileLayer.getName()))).thenReturn(config); when(tld.getConfiguration(eq(tileLayerGroup.getName()))).thenReturn(config); when(tld.getTileLayer(eq(tileLayer.getName()))).thenReturn(tileLayer); when(tld.getTileLayer(eq(tileLayerGroup.getName()))).thenReturn(tileLayerGroup); when(tld.getLayerNames()).thenReturn( ImmutableSet.of(tileLayer.getName(), tileLayerGroup.getName())); Iterable<TileLayer> tileLayers = ImmutableList.of((TileLayer) tileLayer, (TileLayer) tileLayerGroup); when(tld.getLayerList()).thenReturn(tileLayers); when(tld.layerExists(eq(tileLayer.getName()))).thenReturn(true); when(tld.layerExists(eq(tileLayerGroup.getName()))).thenReturn(true); }
public void testReloadAndLayerRemovedExternally() throws Exception { final String removedLayer = tileLayer.getName(); final String remainingLayer = tileLayerGroup.getName(); final Set<String> layerNames = Sets.newHashSet(removedLayer, remainingLayer); when(tld.getLayerNames()).thenReturn(layerNames); doAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { layerNames.remove(removedLayer); return null; } }).when(tld).reInit(); ArgumentCaptor<String> argCaptor = ArgumentCaptor.forClass(String.class); mediator = spy(mediator); doReturn(true).when(mediator).layerRemoved(argCaptor.capture()); mediator.reload(); verify(tld, times(1)).reInit(); assertEquals(1, argCaptor.getAllValues().size()); assertEquals(removedLayer, argCaptor.getValue()); }
@Test public void testRemoveLayer() { String layerToRemove = GWCConfigIntegrationTestData.LAYER_TOPP_STATES; tileLayerDispatcher.removeLayer(layerToRemove); assertFalse(tileLayerDispatcher.getLayerNames().contains(layerToRemove)); try { tileLayerDispatcher.getTileLayer(layerToRemove); fail("Expected exception when trying to get removed layer"); } catch (GeoWebCacheException e) { } }
@Test public void testLayerList() { int count = tileLayerDispatcher.getLayerCount(); Set<String> names = tileLayerDispatcher.getLayerNames(); int i = 0; for (TileLayer layer : tileLayerDispatcher.getLayerList()) { assertTrue(names.contains(layer.getName())); i++; } assertEquals(count, i); assertEquals(count, names.size()); }
@Test public void testAddLayer() throws GeoWebCacheException { String layerName = "newLayer"; WMSLayer layer = new WMSLayer( layerName, new String[] {"http://example.com/"}, null, null, null, null, null, null, null, false, null); tileLayerDispatcher.addLayer(layer); assertTrue(tileLayerDispatcher.getLayerNames().contains(layerName)); assertEquals(layer, tileLayerDispatcher.getTileLayer(layerName)); }
set.add(unAdvertisedLayer.getName()); when(tld.getLayerNames()).thenReturn(set);