target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void testGetPayloadMetadataMimeType() { String testBlobFormat = "image/png"; ReflectionTestUtils.setField(swiftTile, "blobFormat", testBlobFormat); Payload testPayload = swiftTile.getPayload(); assertEquals(testBlobFormat, testPayload.getContentMetadata().getContentType()); } | public Payload getPayload() { Payload payload = new ByteArrayPayload(data); payload.setContentMetadata(getMetadata()); return payload; } | SwiftTile { public Payload getPayload() { Payload payload = new ByteArrayPayload(data); payload.setContentMetadata(getMetadata()); return payload; } } | SwiftTile { public Payload getPayload() { Payload payload = new ByteArrayPayload(data); payload.setContentMetadata(getMetadata()); return payload; } SwiftTile(final TileObject tile); } | SwiftTile { public Payload getPayload() { Payload payload = new ByteArrayPayload(data); payload.setContentMetadata(getMetadata()); return payload; } SwiftTile(final TileObject tile); Payload getPayload(); void setExisted(long oldSize); void notifyListeners(BlobStoreListenerList listeners); String toString(); } | SwiftTile { public Payload getPayload() { Payload payload = new ByteArrayPayload(data); payload.setContentMetadata(getMetadata()); return payload; } SwiftTile(final TileObject tile); Payload getPayload(); void setExisted(long oldSize); void notifyListeners(BlobStoreListenerList listeners); String toString(); } |
@Test public void testNotifyListenersWhenEmptyAndExisted() { ReflectionTestUtils.setField(swiftTile, "existed", true); swiftTile.notifyListeners(testListeners); checkListenersNotifications(0, 0); } | public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerName, gridSetId... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... |
@Test public void testNotifyListenersWhenEmptyAndNotExisted() { ReflectionTestUtils.setField(swiftTile, "existed", false); swiftTile.notifyListeners(testListeners); checkListenersNotifications(0, 0); } | public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerName, gridSetId... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... |
@Test public void testNotifyListenersWhenNotEmptyAndExisted() { ReflectionTestUtils.setField(swiftTile, "existed", true); addListener(); swiftTile.notifyListeners(testListeners); checkListenersNotifications(1, 0); } | public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerName, gridSetId... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... |
@Test public void testNotifyListenersWhenNotEmptyAndNotExisted() { ReflectionTestUtils.setField(swiftTile, "existed", false); addListener(); swiftTile.notifyListeners(testListeners); checkListenersNotifications(0, 1); } | public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerName, gridSetId... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... | SwiftTile { public void notifyListeners(BlobStoreListenerList listeners) { boolean hasListeners = !listeners.isEmpty(); if (hasListeners && existed) { listeners.sendTileUpdated( layerName, gridSetId, blobFormat, parametersId, x, y, z, outputLength, oldSize); } else if (hasListeners) { listeners.sendTileStored( layerNam... |
@Test public void destroy() { this.swiftBlobStore.destroy(); try { verify(swiftApi, times(1)).close(); verify(blobStoreContext, times(1)).close(); } catch (IOException e) { fail(e.getMessage()); } } | @Override public void destroy() { try { this.shutDown = true; this.swiftApi.close(); this.blobStoreContext.close(); } catch (IOException e) { log.error("Error closing connection."); log.error(e); } } | SwiftBlobStore implements BlobStore { @Override public void destroy() { try { this.shutDown = true; this.swiftApi.close(); this.blobStoreContext.close(); } catch (IOException e) { log.error("Error closing connection."); log.error(e); } } } | SwiftBlobStore implements BlobStore { @Override public void destroy() { try { this.shutDown = true; this.swiftApi.close(); this.blobStoreContext.close(); } catch (IOException e) { log.error("Error closing connection."); log.error(e); } } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); } | SwiftBlobStore implements BlobStore { @Override public void destroy() { try { this.shutDown = true; this.swiftApi.close(); this.blobStoreContext.close(); } catch (IOException e) { log.error("Error closing connection."); log.error(e); } } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override v... | SwiftBlobStore implements BlobStore { @Override public void destroy() { try { this.shutDown = true; this.swiftApi.close(); this.blobStoreContext.close(); } catch (IOException e) { log.error("Error closing connection."); log.error(e); } } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override v... |
@Test public void addListener() { assertTrue(testListeners.isEmpty()); BlobStoreListener swiftListener = mock(BlobStoreListener.class); this.swiftBlobStore.addListener(swiftListener); ArrayList<BlobStoreListener> blobStoreListenersResult = (ArrayList) testListeners.getListeners(); assertTrue(blobStoreListenersResult.co... | @Override public void addListener(BlobStoreListener listener) { listeners.addListener(listener); } | SwiftBlobStore implements BlobStore { @Override public void addListener(BlobStoreListener listener) { listeners.addListener(listener); } } | SwiftBlobStore implements BlobStore { @Override public void addListener(BlobStoreListener listener) { listeners.addListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); } | SwiftBlobStore implements BlobStore { @Override public void addListener(BlobStoreListener listener) { listeners.addListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean removeListen... | SwiftBlobStore implements BlobStore { @Override public void addListener(BlobStoreListener listener) { listeners.addListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean removeListen... |
@Test public void removeListener() { BlobStoreListener swiftListener = mock(BlobStoreListener.class); this.testListeners.addListener(swiftListener); ArrayList<BlobStoreListener> testListenersList = (ArrayList) testListeners.getListeners(); assertTrue(testListenersList.contains(swiftListener)); this.swiftBlobStore.remov... | @Override public boolean removeListener(BlobStoreListener listener) { return listeners.removeListener(listener); } | SwiftBlobStore implements BlobStore { @Override public boolean removeListener(BlobStoreListener listener) { return listeners.removeListener(listener); } } | SwiftBlobStore implements BlobStore { @Override public boolean removeListener(BlobStoreListener listener) { return listeners.removeListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); } | SwiftBlobStore implements BlobStore { @Override public boolean removeListener(BlobStoreListener listener) { return listeners.removeListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override bool... | SwiftBlobStore implements BlobStore { @Override public boolean removeListener(BlobStoreListener listener) { return listeners.removeListener(listener); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override bool... |
@Test public void testPutWhenFormatNull() { Resource testResource = createTestResource(3L); TileObject testTileObject = createMockTileObject(testResource); when(testTileObject.getBlobFormat()).thenReturn(null); try { this.swiftBlobStore.put(testTileObject); fail("Null check when tile format is null failed"); } catch (N... | @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue length is now " + uploadQueue.size()); ... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... |
@Test public void testProxyRequestWhitelistWithSecurityFilters() throws Exception { whitelistProperty.setValue("troz"); SecurityDispatcher secDisp = mock(SecurityDispatcher.class); when(secDisp.isSecurityEnabled()).thenReturn(true); GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPre... | public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... |
@Test public void testPutWhenBlobIsNull() { TileObject testTileObject = createMockTileObject(mock(Resource.class)); when(testTileObject.getBlob()).thenReturn(null); try { this.swiftBlobStore.put(testTileObject); fail("Null check when blob is null failed"); } catch (NullPointerException e) { verify(testTileObject, times... | @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue length is now " + uploadQueue.size()); ... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... |
@Test(expected = RuntimeException.class) public void testPutWhenBlobIsAnInvalidMimeType() { Resource testResource = createTestResource(3L); TileObject testTileObject = createMockTileObject(testResource); when(testTileObject.getBlobFormat()).thenReturn("invalid mime type"); try { this.swiftBlobStore.put(testTileObject);... | @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue length is now " + uploadQueue.size()); ... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... | SwiftBlobStore implements BlobStore { @Override public void put(TileObject obj) throws StorageException { try { final SwiftTile tile = new SwiftTile(obj); final String key = keyBuilder.forTile(obj); executor.execute(new SwiftUploadTask(key, tile, listeners, objectApi)); log.debug("Added request to upload queue. Queue l... |
@Test public void get() { String thePayloadData = "Test Content"; Date lastModified = new Date(); ByteSourcePayload testByteSourcePayload = new ByteSourcePayload( new ByteSource() { @Override public InputStream openStream() { return new ByteArrayInputStream(thePayloadData.getBytes()); } }); SwiftObject swiftObject = mo... | @Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); SwiftObject object = this.objectApi.get(key); if (object == null) { return false; } try (Payload in = object.getPayload()) { try (InputStream inStream = in.openStream()) { byte[] bytes = ByteStreams.toByte... | SwiftBlobStore implements BlobStore { @Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); SwiftObject object = this.objectApi.get(key); if (object == null) { return false; } try (Payload in = object.getPayload()) { try (InputStream inStream = in.openStream(... | SwiftBlobStore implements BlobStore { @Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); SwiftObject object = this.objectApi.get(key); if (object == null) { return false; } try (Payload in = object.getPayload()) { try (InputStream inStream = in.openStream(... | SwiftBlobStore implements BlobStore { @Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); SwiftObject object = this.objectApi.get(key); if (object == null) { return false; } try (Payload in = object.getPayload()) { try (InputStream inStream = in.openStream(... | SwiftBlobStore implements BlobStore { @Override public boolean get(TileObject obj) throws StorageException { final String key = keyBuilder.forTile(obj); SwiftObject object = this.objectApi.get(key); if (object == null) { return false; } try (Payload in = object.getPayload()) { try (InputStream inStream = in.openStream(... |
@Test public void deleteByGridsetId() { String testGridSetID = "TestGridSetID"; String testGridsetPrefix = "test/gridset/prefix"; doReturn(testGridsetPrefix) .when(this.keyBuilder) .forGridset(VALID_TEST_LAYER_NAME, testGridSetID); doReturn(false).when(this.swiftBlobStore).deleteByPath(testGridsetPrefix); boolean outco... | @Override public boolean deleteByGridsetId(final String layerName, final String gridSetId) { checkNotNull(layerName, "layerName"); checkNotNull(gridSetId, "gridSetId"); final String gridsetPrefix = keyBuilder.forGridset(layerName, gridSetId); boolean deletedSuccessfully = this.deleteByPath(gridsetPrefix); if (deletedSu... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByGridsetId(final String layerName, final String gridSetId) { checkNotNull(layerName, "layerName"); checkNotNull(gridSetId, "gridSetId"); final String gridsetPrefix = keyBuilder.forGridset(layerName, gridSetId); boolean deletedSuccessfully = this.dele... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByGridsetId(final String layerName, final String gridSetId) { checkNotNull(layerName, "layerName"); checkNotNull(gridSetId, "gridSetId"); final String gridsetPrefix = keyBuilder.forGridset(layerName, gridSetId); boolean deletedSuccessfully = this.dele... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByGridsetId(final String layerName, final String gridSetId) { checkNotNull(layerName, "layerName"); checkNotNull(gridSetId, "gridSetId"); final String gridsetPrefix = keyBuilder.forGridset(layerName, gridSetId); boolean deletedSuccessfully = this.dele... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByGridsetId(final String layerName, final String gridSetId) { checkNotNull(layerName, "layerName"); checkNotNull(gridSetId, "gridSetId"); final String gridsetPrefix = keyBuilder.forGridset(layerName, gridSetId); boolean deletedSuccessfully = this.dele... |
@Test public void rename() { boolean result = this.swiftBlobStore.rename(VALID_TEST_LAYER_NAME, "NewLayerName"); verify(objectApi, times(1)).get(VALID_TEST_LAYER_NAME); verify(this.testListeners, times(0)) .sendLayerRenamed(VALID_TEST_LAYER_NAME, "NewLayerName"); assertTrue(result); when(this.objectApi.get(VALID_TEST_L... | @Override public boolean rename(String oldLayerName, String newLayerName) { log.debug("No need to rename layers, SwiftBlobStore uses layer id as key root"); if (objectApi.get(oldLayerName) != null) { listeners.sendLayerRenamed(oldLayerName, newLayerName); } return true; } | SwiftBlobStore implements BlobStore { @Override public boolean rename(String oldLayerName, String newLayerName) { log.debug("No need to rename layers, SwiftBlobStore uses layer id as key root"); if (objectApi.get(oldLayerName) != null) { listeners.sendLayerRenamed(oldLayerName, newLayerName); } return true; } } | SwiftBlobStore implements BlobStore { @Override public boolean rename(String oldLayerName, String newLayerName) { log.debug("No need to rename layers, SwiftBlobStore uses layer id as key root"); if (objectApi.get(oldLayerName) != null) { listeners.sendLayerRenamed(oldLayerName, newLayerName); } return true; } SwiftBlob... | SwiftBlobStore implements BlobStore { @Override public boolean rename(String oldLayerName, String newLayerName) { log.debug("No need to rename layers, SwiftBlobStore uses layer id as key root"); if (objectApi.get(oldLayerName) != null) { listeners.sendLayerRenamed(oldLayerName, newLayerName); } return true; } SwiftBlob... | SwiftBlobStore implements BlobStore { @Override public boolean rename(String oldLayerName, String newLayerName) { log.debug("No need to rename layers, SwiftBlobStore uses layer id as key root"); if (objectApi.get(oldLayerName) != null) { listeners.sendLayerRenamed(oldLayerName, newLayerName); } return true; } SwiftBlob... |
@Test public void clear() { try { this.swiftBlobStore.clear(); fail("This method should not work, it should throw a Unsupported Operation Exception"); } catch (UnsupportedOperationException e) { assertThat(e.getMessage(), is("clear() should not be called")); } } | @Override public void clear() { throw new UnsupportedOperationException("clear() should not be called"); } | SwiftBlobStore implements BlobStore { @Override public void clear() { throw new UnsupportedOperationException("clear() should not be called"); } } | SwiftBlobStore implements BlobStore { @Override public void clear() { throw new UnsupportedOperationException("clear() should not be called"); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); } | SwiftBlobStore implements BlobStore { @Override public void clear() { throw new UnsupportedOperationException("clear() should not be called"); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean remo... | SwiftBlobStore implements BlobStore { @Override public void clear() { throw new UnsupportedOperationException("clear() should not be called"); } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean remo... |
@Test public void getLayerMetadata() { SwiftObject swiftObject = mock(SwiftObject.class); SwiftObject swiftObjectWithoutMetadata = mock(SwiftObject.class); when(objectApi.get("")).thenReturn(null); when(objectApi.get(INVALID_TEST_LAYER_NAME)).thenReturn(null); when(objectApi.get(VALID_TEST_LAYER_NAME)).thenReturn(swift... | @Nullable @Override public String getLayerMetadata(String layerName, String key) { SwiftObject layer = this.objectApi.get(layerName); if (layer == null) { return null; } if (layer.getMetadata() == null) { return null; } else { return layer.getMetadata().get(key); } } | SwiftBlobStore implements BlobStore { @Nullable @Override public String getLayerMetadata(String layerName, String key) { SwiftObject layer = this.objectApi.get(layerName); if (layer == null) { return null; } if (layer.getMetadata() == null) { return null; } else { return layer.getMetadata().get(key); } } } | SwiftBlobStore implements BlobStore { @Nullable @Override public String getLayerMetadata(String layerName, String key) { SwiftObject layer = this.objectApi.get(layerName); if (layer == null) { return null; } if (layer.getMetadata() == null) { return null; } else { return layer.getMetadata().get(key); } } SwiftBlobStore... | SwiftBlobStore implements BlobStore { @Nullable @Override public String getLayerMetadata(String layerName, String key) { SwiftObject layer = this.objectApi.get(layerName); if (layer == null) { return null; } if (layer.getMetadata() == null) { return null; } else { return layer.getMetadata().get(key); } } SwiftBlobStore... | SwiftBlobStore implements BlobStore { @Nullable @Override public String getLayerMetadata(String layerName, String key) { SwiftObject layer = this.objectApi.get(layerName); if (layer == null) { return null; } if (layer.getMetadata() == null) { return null; } else { return layer.getMetadata().get(key); } } SwiftBlobStore... |
@Test public void putLayerMetadata() { assertNull(this.objectApi.get(VALID_TEST_LAYER_NAME)); swiftBlobStore.putLayerMetadata(VALID_TEST_LAYER_NAME, "test_key", "test_value"); assertNull(this.objectApi.get(VALID_TEST_LAYER_NAME)); SwiftObject layer = mock(SwiftObject.class); when(objectApi.get(VALID_TEST_LAYER_NAME)).t... | @Override public void putLayerMetadata(String layerName, String key, String value) { SwiftObject layer = this.objectApi.get(layerName); Map<String, String> metaData; if (layer == null) { return; } metaData = layer.getMetadata(); if (metaData == null) { metaData = new HashMap<>(); } metaData.put(key, value); this.object... | SwiftBlobStore implements BlobStore { @Override public void putLayerMetadata(String layerName, String key, String value) { SwiftObject layer = this.objectApi.get(layerName); Map<String, String> metaData; if (layer == null) { return; } metaData = layer.getMetadata(); if (metaData == null) { metaData = new HashMap<>(); }... | SwiftBlobStore implements BlobStore { @Override public void putLayerMetadata(String layerName, String key, String value) { SwiftObject layer = this.objectApi.get(layerName); Map<String, String> metaData; if (layer == null) { return; } metaData = layer.getMetadata(); if (metaData == null) { metaData = new HashMap<>(); }... | SwiftBlobStore implements BlobStore { @Override public void putLayerMetadata(String layerName, String key, String value) { SwiftObject layer = this.objectApi.get(layerName); Map<String, String> metaData; if (layer == null) { return; } metaData = layer.getMetadata(); if (metaData == null) { metaData = new HashMap<>(); }... | SwiftBlobStore implements BlobStore { @Override public void putLayerMetadata(String layerName, String key, String value) { SwiftObject layer = this.objectApi.get(layerName); Map<String, String> metaData; if (layer == null) { return; } metaData = layer.getMetadata(); if (metaData == null) { metaData = new HashMap<>(); }... |
@Test public void layerExists() { SwiftObject swiftObject = mock(SwiftObject.class); when(objectApi.get(VALID_TEST_LAYER_NAME)).thenReturn(swiftObject); assertTrue(swiftBlobStore.layerExists(VALID_TEST_LAYER_NAME)); when(objectApi.get("layer which doesn't exist")).thenReturn(null); assertFalse(swiftBlobStore.layerExist... | @Override public boolean layerExists(String layerName) { return this.objectApi.get(layerName) != null; } | SwiftBlobStore implements BlobStore { @Override public boolean layerExists(String layerName) { return this.objectApi.get(layerName) != null; } } | SwiftBlobStore implements BlobStore { @Override public boolean layerExists(String layerName) { return this.objectApi.get(layerName) != null; } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); } | SwiftBlobStore implements BlobStore { @Override public boolean layerExists(String layerName) { return this.objectApi.get(layerName) != null; } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean remove... | SwiftBlobStore implements BlobStore { @Override public boolean layerExists(String layerName) { return this.objectApi.get(layerName) != null; } SwiftBlobStore(SwiftBlobStoreInfo config, TileLayerDispatcher layers); @Override void destroy(); @Override void addListener(BlobStoreListener listener); @Override boolean remove... |
@Test public void getParametersMapping() { String prefixPath = "sample/prefix/path"; String testObjectName = "test object"; SwiftObject swiftObject = mock(SwiftObject.class); when(swiftObject.getName()).thenReturn(testObjectName); List<SwiftObject> swiftObjects = new ArrayList<>(); swiftObjects.add(swiftObject); Object... | @Override public Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName) { String prefix = keyBuilder.parametersMetadataPrefix(layerName); ListContainerOptions options = new ListContainerOptions(); options.prefix(prefix); Map<String, Optional<Map<String, String>>> paramMapping = new HashMap<>(... | SwiftBlobStore implements BlobStore { @Override public Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName) { String prefix = keyBuilder.parametersMetadataPrefix(layerName); ListContainerOptions options = new ListContainerOptions(); options.prefix(prefix); Map<String, Optional<Map<String, S... | SwiftBlobStore implements BlobStore { @Override public Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName) { String prefix = keyBuilder.parametersMetadataPrefix(layerName); ListContainerOptions options = new ListContainerOptions(); options.prefix(prefix); Map<String, Optional<Map<String, S... | SwiftBlobStore implements BlobStore { @Override public Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName) { String prefix = keyBuilder.parametersMetadataPrefix(layerName); ListContainerOptions options = new ListContainerOptions(); options.prefix(prefix); Map<String, Optional<Map<String, S... | SwiftBlobStore implements BlobStore { @Override public Map<String, Optional<Map<String, String>>> getParametersMapping(String layerName) { String prefix = keyBuilder.parametersMetadataPrefix(layerName); ListContainerOptions options = new ListContainerOptions(); options.prefix(prefix); Map<String, Optional<Map<String, S... |
@Test public void testProxyRequestWhitelistWithSecurityFiltersAppliesFilters() throws Exception { whitelistProperty.setValue("troz"); SecurityDispatcher secDisp = mock(SecurityDispatcher.class); when(secDisp.isSecurityEnabled()).thenReturn(true); GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd... | public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... |
@Test public void deleteByParametersId() { String testParametersId = "testParamId"; try { this.swiftBlobStore.deleteByParametersId(null, testParametersId); fail("Null check for layer name failed"); } catch (NullPointerException e) { assertThat(e.getMessage(), is("layerName")); } try { this.swiftBlobStore.deleteByParame... | @Override public boolean deleteByParametersId(String layerName, String parametersId) { checkNotNull(layerName, "layerName"); checkNotNull(parametersId, "parametersId"); boolean deletionSuccessful = keyBuilder .forParameters(layerName, parametersId) .stream() .map(path -> this.deleteByPath(path)) .reduce(Boolean::logica... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByParametersId(String layerName, String parametersId) { checkNotNull(layerName, "layerName"); checkNotNull(parametersId, "parametersId"); boolean deletionSuccessful = keyBuilder .forParameters(layerName, parametersId) .stream() .map(path -> this.delet... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByParametersId(String layerName, String parametersId) { checkNotNull(layerName, "layerName"); checkNotNull(parametersId, "parametersId"); boolean deletionSuccessful = keyBuilder .forParameters(layerName, parametersId) .stream() .map(path -> this.delet... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByParametersId(String layerName, String parametersId) { checkNotNull(layerName, "layerName"); checkNotNull(parametersId, "parametersId"); boolean deletionSuccessful = keyBuilder .forParameters(layerName, parametersId) .stream() .map(path -> this.delet... | SwiftBlobStore implements BlobStore { @Override public boolean deleteByParametersId(String layerName, String parametersId) { checkNotNull(layerName, "layerName"); checkNotNull(parametersId, "parametersId"); boolean deletionSuccessful = keyBuilder .forParameters(layerName, parametersId) .stream() .map(path -> this.delet... |
@Test public void testValuesFromEnvironment() { S3BlobStoreConfigProvider provider = new S3BlobStoreConfigProvider(); XStream stream = new XStream(); stream = provider.getConfiguredXStream(stream); Object config = stream.fromXML(getClass().getResourceAsStream("blobstore.xml")); assertTrue(config instanceof S3BlobStoreI... | @Override public XStream getConfiguredXStream(XStream xs) { xs.alias("S3BlobStore", S3BlobStoreInfo.class); xs.registerLocalConverter( S3BlobStoreInfo.class, "maxConnections", EnvironmentNullableIntConverter); xs.registerLocalConverter( S3BlobStoreInfo.class, "proxyPort", EnvironmentNullableIntConverter); xs.registerLo... | S3BlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { xs.alias("S3BlobStore", S3BlobStoreInfo.class); xs.registerLocalConverter( S3BlobStoreInfo.class, "maxConnections", EnvironmentNullableIntConverter); xs.registerLocalConverter( S3BlobStoreInfo.cla... | S3BlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { xs.alias("S3BlobStore", S3BlobStoreInfo.class); xs.registerLocalConverter( S3BlobStoreInfo.class, "maxConnections", EnvironmentNullableIntConverter); xs.registerLocalConverter( S3BlobStoreInfo.cla... | S3BlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { xs.alias("S3BlobStore", S3BlobStoreInfo.class); xs.registerLocalConverter( S3BlobStoreInfo.class, "maxConnections", EnvironmentNullableIntConverter); xs.registerLocalConverter( S3BlobStoreInfo.cla... | S3BlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { xs.alias("S3BlobStore", S3BlobStoreInfo.class); xs.registerLocalConverter( S3BlobStoreInfo.class, "maxConnections", EnvironmentNullableIntConverter); xs.registerLocalConverter( S3BlobStoreInfo.cla... |
@Test public void testGetCap() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseInsensitiveMap(); kvp.p... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapWithExtensions() throws Exception { List<WMTSExtension> extensions = new ArrayList<>(); extensions.add( new WMTSExtension() { @Override public String[] getSchemaLocations() { return new String[] {"name-space schema-location"}; } @Override public void registerNamespaces(XMLBuilder xml) throws... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapServiceInfo() throws Exception { TileLayerDispatcher tldx = mockTileLayerDispatcher(); GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tldx, null, mock(RuntimeStats.class)); @SuppressWarnings("unche... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapOneWGS84BBox() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseInsensitive... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapUnboundedStyleFilter() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseIns... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapEmptyStyleFilter() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseInsensi... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testGetCapMultipleStyles() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseInsensiti... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@SuppressWarnings("unchecked") @Test public void testGetCapWithMultipleDimensions() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); Map<String, String[]> kvp = new CaseI... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testWriteResponse() throws Exception { final TileLayer layer = createWMSLayer(); BoundingBox bounds = new BoundingBox(-35.0, 14.0, 55.0, 39); int width = (int) bounds.getWidth() * 25; int height = (int) bounds.getHeight() * 25; layer.getGridSubset(layer.getGridSubsets().iterator().next()); File temp =... | protected void writeResponse(HttpServletResponse response, RuntimeStats stats) throws IOException, OutsideCoverageException, GeoWebCacheException, Exception { determineSourceResolution(); determineCanvasLayout(); createCanvas(); renderCanvas(); scaleRaster(); @SuppressWarnings("PMD.CloseResource") AccountingOutputStrea... | WMSTileFuser { protected void writeResponse(HttpServletResponse response, RuntimeStats stats) throws IOException, OutsideCoverageException, GeoWebCacheException, Exception { determineSourceResolution(); determineCanvasLayout(); createCanvas(); renderCanvas(); scaleRaster(); @SuppressWarnings("PMD.CloseResource") Accoun... | WMSTileFuser { protected void writeResponse(HttpServletResponse response, RuntimeStats stats) throws IOException, OutsideCoverageException, GeoWebCacheException, Exception { determineSourceResolution(); determineCanvasLayout(); createCanvas(); renderCanvas(); scaleRaster(); @SuppressWarnings("PMD.CloseResource") Accoun... | WMSTileFuser { protected void writeResponse(HttpServletResponse response, RuntimeStats stats) throws IOException, OutsideCoverageException, GeoWebCacheException, Exception { determineSourceResolution(); determineCanvasLayout(); createCanvas(); renderCanvas(); scaleRaster(); @SuppressWarnings("PMD.CloseResource") Accoun... | WMSTileFuser { protected void writeResponse(HttpServletResponse response, RuntimeStats stats) throws IOException, OutsideCoverageException, GeoWebCacheException, Exception { determineSourceResolution(); determineCanvasLayout(); createCanvas(); renderCanvas(); scaleRaster(); @SuppressWarnings("PMD.CloseResource") Accoun... |
@SuppressWarnings("unchecked") @Test public void testGetTileWithStyle() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMTSService(sb, tld, null, mock(RuntimeStats.class)); Map<String, String[]> kvp = new CaseInsensitiveMa... | @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor; } } if (request.getPathInfo(... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... | WMTSService extends Service { @Override public Conveyor getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException, OWSException { for (WMTSExtension extension : extensions) { Conveyor conveyor = extension.getConveyor(request, response, sb); if (conveyor != null) { return conveyor... |
@Test public void testRenameLayer() throws InterruptedException { assertEquals(16, countTileSetsByLayerName("topp:states")); store.renameLayer("topp:states", "states_renamed"); assertEquals(0, countTileSetsByLayerName("topp:states")); assertEquals(16, countTileSetsByLayerName("states_renamed")); } | public void renameLayer(final String oldLayerName, final String newLayerName) throws InterruptedException { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { String sql = dialect.getRenameLayerStatement(schema, "oldName", "newName"); M... | JDBCQuotaStore implements QuotaStore { public void renameLayer(final String oldLayerName, final String newLayerName) throws InterruptedException { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { String sql = dialect.getRenameLayerSta... | JDBCQuotaStore implements QuotaStore { public void renameLayer(final String oldLayerName, final String newLayerName) throws InterruptedException { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { String sql = dialect.getRenameLayerSta... | JDBCQuotaStore implements QuotaStore { public void renameLayer(final String oldLayerName, final String newLayerName) throws InterruptedException { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { String sql = dialect.getRenameLayerSta... | JDBCQuotaStore implements QuotaStore { public void renameLayer(final String oldLayerName, final String newLayerName) throws InterruptedException { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { String sql = dialect.getRenameLayerSta... |
@Test public void testDeleteParameters() throws InterruptedException { String layerName = "topp:states"; TileSet tset1 = new TileSet(layerName, "EPSG:4326", "image/jpeg", paramIds[0]); addToQuotaStore(tset1); TileSet tset2 = new TileSet(layerName, "EPSG:4326", "image/jpeg", paramIds[1]); addToQuotaStore(tset2); Quota t... | @Override public void deleteParameters(final String layerName, final String parametersId) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Quota quota = getUsedQuotaByParametersId(parametersId); quota.setBytes(quota.getBytes().negat... | JDBCQuotaStore implements QuotaStore { @Override public void deleteParameters(final String layerName, final String parametersId) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Quota quota = getUsedQuotaByParametersId(parametersId)... | JDBCQuotaStore implements QuotaStore { @Override public void deleteParameters(final String layerName, final String parametersId) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Quota quota = getUsedQuotaByParametersId(parametersId)... | JDBCQuotaStore implements QuotaStore { @Override public void deleteParameters(final String layerName, final String parametersId) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Quota quota = getUsedQuotaByParametersId(parametersId)... | JDBCQuotaStore implements QuotaStore { @Override public void deleteParameters(final String layerName, final String parametersId) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { Quota quota = getUsedQuotaByParametersId(parametersId)... |
@Test public void testDeleteLayer() throws InterruptedException { String layerName = "topp:states2"; TileSet tset = new TileSet(layerName, "EPSG:2163", "image/jpeg", null); addToQuotaStore(tset); Quota oldUsedQuota = store.getUsedQuotaByLayerName(layerName); assertNotNull(oldUsedQuota); Quota globalQuotaBefore = store.... | public void deleteLayer(final String layerName) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { deleteLayerInternal(layerName); } }); } | JDBCQuotaStore implements QuotaStore { public void deleteLayer(final String layerName) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { deleteLayerInternal(layerName); } }); } } | JDBCQuotaStore implements QuotaStore { public void deleteLayer(final String layerName) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { deleteLayerInternal(layerName); } }); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalc... | JDBCQuotaStore implements QuotaStore { public void deleteLayer(final String layerName) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { deleteLayerInternal(layerName); } }); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalc... | JDBCQuotaStore implements QuotaStore { public void deleteLayer(final String layerName) { tt.execute( new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { deleteLayerInternal(layerName); } }); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalc... |
@Test public void testGetTileSetById() throws Exception { TileSet tileSet = store.getTileSetById(testTileSet.getId()); assertNotNull(tileSet); assertEquals(testTileSet, tileSet); try { store.getTileSetById("NonExistentTileSetId"); fail("Expected IAE"); } catch (IllegalArgumentException e) { assertTrue(true); } } | public TileSet getTileSetById(String tileSetId) throws InterruptedException { TileSet result = getTileSetByIdInternal(tileSetId); if (result == null) { throw new IllegalArgumentException("Could not find a tile set with id: " + tileSetId); } return result; } | JDBCQuotaStore implements QuotaStore { public TileSet getTileSetById(String tileSetId) throws InterruptedException { TileSet result = getTileSetByIdInternal(tileSetId); if (result == null) { throw new IllegalArgumentException("Could not find a tile set with id: " + tileSetId); } return result; } } | JDBCQuotaStore implements QuotaStore { public TileSet getTileSetById(String tileSetId) throws InterruptedException { TileSet result = getTileSetByIdInternal(tileSetId); if (result == null) { throw new IllegalArgumentException("Could not find a tile set with id: " + tileSetId); } return result; } JDBCQuotaStore(DefaultS... | JDBCQuotaStore implements QuotaStore { public TileSet getTileSetById(String tileSetId) throws InterruptedException { TileSet result = getTileSetByIdInternal(tileSetId); if (result == null) { throw new IllegalArgumentException("Could not find a tile set with id: " + tileSetId); } return result; } JDBCQuotaStore(DefaultS... | JDBCQuotaStore implements QuotaStore { public TileSet getTileSetById(String tileSetId) throws InterruptedException { TileSet result = getTileSetByIdInternal(tileSetId); if (result == null) { throw new IllegalArgumentException("Could not find a tile set with id: " + tileSetId); } return result; } JDBCQuotaStore(DefaultS... |
@SuppressWarnings("unchecked") @Test public void testGetUsedQuotaByLayerName() throws Exception { String layerName = "topp:states2"; List<TileSet> tileSets; tileSets = new ArrayList<TileSet>(tilePageCalculator.getTileSetsFor(layerName)); Quota expected = new Quota(); for (TileSet tset : tileSets) { Quota quotaDiff = ne... | public Quota getUsedQuotaByLayerName(String layerName) { String sql = dialect.getUsedQuotaByLayerName(schema, "layerName"); return nonNullQuota( jt.queryForOptionalObject( sql, new DiskQuotaMapper(), Collections.singletonMap("layerName", layerName))); } | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByLayerName(String layerName) { String sql = dialect.getUsedQuotaByLayerName(schema, "layerName"); return nonNullQuota( jt.queryForOptionalObject( sql, new DiskQuotaMapper(), Collections.singletonMap("layerName", layerName))); } } | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByLayerName(String layerName) { String sql = dialect.getUsedQuotaByLayerName(schema, "layerName"); return nonNullQuota( jt.queryForOptionalObject( sql, new DiskQuotaMapper(), Collections.singletonMap("layerName", layerName))); } JDBCQuotaStore(DefaultStora... | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByLayerName(String layerName) { String sql = dialect.getUsedQuotaByLayerName(schema, "layerName"); return nonNullQuota( jt.queryForOptionalObject( sql, new DiskQuotaMapper(), Collections.singletonMap("layerName", layerName))); } JDBCQuotaStore(DefaultStora... | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByLayerName(String layerName) { String sql = dialect.getUsedQuotaByLayerName(schema, "layerName"); return nonNullQuota( jt.queryForOptionalObject( sql, new DiskQuotaMapper(), Collections.singletonMap("layerName", layerName))); } JDBCQuotaStore(DefaultStora... |
@SuppressWarnings("unchecked") @Test public void testGetUsedQuotaByTileSetId() throws Exception { String layerName = "topp:states2"; List<TileSet> tileSets; tileSets = new ArrayList<TileSet>(tilePageCalculator.getTileSetsFor(layerName)); Map<String, Quota> expectedById = new HashMap<String, Quota>(); for (TileSet tset ... | public Quota getUsedQuotaByTileSetId(String tileSetId) { return nonNullQuota(getUsedQuotaByTileSetIdInternal(tileSetId)); } | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByTileSetId(String tileSetId) { return nonNullQuota(getUsedQuotaByTileSetIdInternal(tileSetId)); } } | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByTileSetId(String tileSetId) { return nonNullQuota(getUsedQuotaByTileSetIdInternal(tileSetId)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); } | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByTileSetId(String tileSetId) { return nonNullQuota(getUsedQuotaByTileSetIdInternal(tileSetId)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialect); String getS... | JDBCQuotaStore implements QuotaStore { public Quota getUsedQuotaByTileSetId(String tileSetId) { return nonNullQuota(getUsedQuotaByTileSetIdInternal(tileSetId)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialect); String getS... |
@Test public void testValuesFromEnvironment() { AzureBlobStoreConfigProvider provider = new AzureBlobStoreConfigProvider(); XStream stream = new XStream(); stream = provider.getConfiguredXStream(stream); Object config = stream.fromXML(getClass().getResourceAsStream("blobstore.xml")); assertTrue(config instanceof AzureB... | @Override public XStream getConfiguredXStream(XStream xs) { Class<AzureBlobStoreInfo> clazz = AzureBlobStoreInfo.class; xs.alias("AzureBlobStore", clazz); xs.aliasField("id", clazz, "name"); return xs; } | AzureBlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { Class<AzureBlobStoreInfo> clazz = AzureBlobStoreInfo.class; xs.alias("AzureBlobStore", clazz); xs.aliasField("id", clazz, "name"); return xs; } } | AzureBlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { Class<AzureBlobStoreInfo> clazz = AzureBlobStoreInfo.class; xs.alias("AzureBlobStore", clazz); xs.aliasField("id", clazz, "name"); return xs; } } | AzureBlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { Class<AzureBlobStoreInfo> clazz = AzureBlobStoreInfo.class; xs.alias("AzureBlobStore", clazz); xs.aliasField("id", clazz, "name"); return xs; } @Override XStream getConfiguredXStream(XStream x... | AzureBlobStoreConfigProvider implements XMLConfigurationProvider { @Override public XStream getConfiguredXStream(XStream xs) { Class<AzureBlobStoreInfo> clazz = AzureBlobStoreInfo.class; xs.alias("AzureBlobStore", clazz); xs.aliasField("id", clazz, "name"); return xs; } @Override XStream getConfiguredXStream(XStream x... |
@Test public void testGetGloballyUsedQuota() throws InterruptedException { Quota usedQuota = store.getGloballyUsedQuota(); assertNotNull(usedQuota); assertEquals(0, usedQuota.getBytes().intValue()); String layerName = tilePageCalculator.getLayerNames().iterator().next(); TileSet tileSet = tilePageCalculator.getTileSets... | public Quota getGloballyUsedQuota() throws InterruptedException { return nonNullQuota(getUsedQuotaByTileSetIdInternal(GLOBAL_QUOTA_NAME)); } | JDBCQuotaStore implements QuotaStore { public Quota getGloballyUsedQuota() throws InterruptedException { return nonNullQuota(getUsedQuotaByTileSetIdInternal(GLOBAL_QUOTA_NAME)); } } | JDBCQuotaStore implements QuotaStore { public Quota getGloballyUsedQuota() throws InterruptedException { return nonNullQuota(getUsedQuotaByTileSetIdInternal(GLOBAL_QUOTA_NAME)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); } | JDBCQuotaStore implements QuotaStore { public Quota getGloballyUsedQuota() throws InterruptedException { return nonNullQuota(getUsedQuotaByTileSetIdInternal(GLOBAL_QUOTA_NAME)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dial... | JDBCQuotaStore implements QuotaStore { public Quota getGloballyUsedQuota() throws InterruptedException { return nonNullQuota(getUsedQuotaByTileSetIdInternal(GLOBAL_QUOTA_NAME)); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dial... |
@Test public void testSetTruncated() throws Exception { String tileSetId = testTileSet.getId(); TilePage page = new TilePage(tileSetId, 0, 0, 2); PageStatsPayload payload = new PageStatsPayload(page); payload.setTileSet(testTileSet); int numHits = 100; payload.setNumHits(numHits); payload.setNumTiles(5); store.addToQuo... | public PageStats setTruncated(final TilePage page) throws InterruptedException { return (PageStats) tt.execute( new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus status) { if (log.isDebugEnabled()) { log.info("Truncating page " + page); } PageStats stats = getPageStats(page.getKey()); ... | JDBCQuotaStore implements QuotaStore { public PageStats setTruncated(final TilePage page) throws InterruptedException { return (PageStats) tt.execute( new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus status) { if (log.isDebugEnabled()) { log.info("Truncating page " + page); } PageStat... | JDBCQuotaStore implements QuotaStore { public PageStats setTruncated(final TilePage page) throws InterruptedException { return (PageStats) tt.execute( new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus status) { if (log.isDebugEnabled()) { log.info("Truncating page " + page); } PageStat... | JDBCQuotaStore implements QuotaStore { public PageStats setTruncated(final TilePage page) throws InterruptedException { return (PageStats) tt.execute( new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus status) { if (log.isDebugEnabled()) { log.info("Truncating page " + page); } PageStat... | JDBCQuotaStore implements QuotaStore { public PageStats setTruncated(final TilePage page) throws InterruptedException { return (PageStats) tt.execute( new TransactionCallback<Object>() { public Object doInTransaction(TransactionStatus status) { if (log.isDebugEnabled()) { log.info("Truncating page " + page); } PageStat... |
@Test public void testGetLeastFrequentlyUsedPage() throws Exception { final String layerName = testTileSet.getLayerName(); Set<String> layerNames = Collections.singleton(layerName); TilePage lfuPage; lfuPage = store.getLeastFrequentlyUsedPage(layerNames); assertNull(lfuPage); TilePage page1 = new TilePage(testTileSet.g... | public TilePage getLeastFrequentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, true); } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastFrequentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, true); } } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastFrequentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, true); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastFrequentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, true); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialec... | JDBCQuotaStore implements QuotaStore { public TilePage getLeastFrequentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, true); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialec... |
@Test public void testGetLeastRecentlyUsedPage() throws Exception { MockSystemUtils mockSystemUtils = new MockSystemUtils(); mockSystemUtils.setCurrentTimeMinutes(1000); mockSystemUtils.setCurrentTimeMillis(mockSystemUtils.currentTimeMinutes() * 60 * 1000); SystemUtils.set(mockSystemUtils); final String layerName = tes... | public TilePage getLeastRecentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, false); } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastRecentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, false); } } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastRecentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, false); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); } | JDBCQuotaStore implements QuotaStore { public TilePage getLeastRecentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, false); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialect... | JDBCQuotaStore implements QuotaStore { public TilePage getLeastRecentlyUsedPage(Set<String> layerNames) throws InterruptedException { return getSinglePage(layerNames, false); } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculator tilePageCalculator); SQLDialect getDialect(); void setDialect(SQLDialect dialect... |
@Test public void testGetTilesForPage() throws Exception { TilePage page = new TilePage(testTileSet.getId(), 0, 0, 0); long[][] expected = tilePageCalculator.toGridCoverage(testTileSet, page); long[][] tilesForPage = store.getTilesForPage(page); assertTrue(Arrays.equals(expected[0], tilesForPage[0])); page = new TilePa... | public long[][] getTilesForPage(TilePage page) throws InterruptedException { TileSet tileSet = getTileSetById(page.getTileSetId()); long[][] gridCoverage = calculator.toGridCoverage(tileSet, page); return gridCoverage; } | JDBCQuotaStore implements QuotaStore { public long[][] getTilesForPage(TilePage page) throws InterruptedException { TileSet tileSet = getTileSetById(page.getTileSetId()); long[][] gridCoverage = calculator.toGridCoverage(tileSet, page); return gridCoverage; } } | JDBCQuotaStore implements QuotaStore { public long[][] getTilesForPage(TilePage page) throws InterruptedException { TileSet tileSet = getTileSetById(page.getTileSetId()); long[][] gridCoverage = calculator.toGridCoverage(tileSet, page); return gridCoverage; } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculat... | JDBCQuotaStore implements QuotaStore { public long[][] getTilesForPage(TilePage page) throws InterruptedException { TileSet tileSet = getTileSetById(page.getTileSetId()); long[][] gridCoverage = calculator.toGridCoverage(tileSet, page); return gridCoverage; } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculat... | JDBCQuotaStore implements QuotaStore { public long[][] getTilesForPage(TilePage page) throws InterruptedException { TileSet tileSet = getTileSetById(page.getTileSetId()); long[][] gridCoverage = calculator.toGridCoverage(tileSet, page); return gridCoverage; } JDBCQuotaStore(DefaultStorageFinder finder, TilePageCalculat... |
@Test public void testFileRenaming() throws Exception { File source = temp.newFile("source.txt"); File destination = temp.newFile("dest" + System.currentTimeMillis() + ".txt"); boolean renameFile = FileUtils.renameFile(source, destination); assertTrue("FileUtils.renameFile returned false", renameFile); assertThat(sourc... | public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path dstPath = P... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... |
@Test public void testFileNotRenamed() throws Exception { File source = temp.newFile("source.txt"); File destination = temp.newFile("destination.txt"); source.delete(); boolean renameFile = FileUtils.renameFile(source, destination); assertFalse("FileUtils.renameFile returned true", renameFile); assertThat(log.getEntrie... | public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path dstPath = P... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... | FileUtils { public static boolean renameFile(File src, File dst) { boolean renamed = false; boolean win = System.getProperty("os.name").startsWith("Windows"); if (win && dst.exists()) { if (!dst.delete()) { throw new RuntimeException("Could not delete: " + dst.getPath()); } } Path srcPath = Paths.get(src.toURI()); Path... |
@Test public void test4BitPNG() throws IOException, URISyntaxException { URL url = this.getClass().getResource("/images/4bit.png"); RenderedImage tile = ImageIO.read(new File(url.toURI())); ImageWriter writer = ImageMime.png8.getImageWriter(tile); assertNotEquals( "Writer for this image should not be the native version... | public ImageWriter getImageWriter(RenderedImage image) { Iterator<ImageWriter> it = javax.imageio.ImageIO.getImageWritersByFormatName(internalName); ImageWriter writer = it.next(); if (this.internalName.equals(ImageMime.png.internalName) || this.internalName.equals(ImageMime.png8.internalName)) { int bitDepth = image.g... | ImageMime extends MimeType { public ImageWriter getImageWriter(RenderedImage image) { Iterator<ImageWriter> it = javax.imageio.ImageIO.getImageWritersByFormatName(internalName); ImageWriter writer = it.next(); if (this.internalName.equals(ImageMime.png.internalName) || this.internalName.equals(ImageMime.png8.internalNa... | ImageMime extends MimeType { public ImageWriter getImageWriter(RenderedImage image) { Iterator<ImageWriter> it = javax.imageio.ImageIO.getImageWritersByFormatName(internalName); ImageWriter writer = it.next(); if (this.internalName.equals(ImageMime.png.internalName) || this.internalName.equals(ImageMime.png8.internalNa... | ImageMime extends MimeType { public ImageWriter getImageWriter(RenderedImage image) { Iterator<ImageWriter> it = javax.imageio.ImageIO.getImageWritersByFormatName(internalName); ImageWriter writer = it.next(); if (this.internalName.equals(ImageMime.png.internalName) || this.internalName.equals(ImageMime.png8.internalNa... | ImageMime extends MimeType { public ImageWriter getImageWriter(RenderedImage image) { Iterator<ImageWriter> it = javax.imageio.ImageIO.getImageWritersByFormatName(internalName); ImageWriter writer = it.next(); if (this.internalName.equals(ImageMime.png.internalName) || this.internalName.equals(ImageMime.png8.internalNa... |
@Test public void testToXMLDefaultNormalizer() throws Exception { filter.setNormalize(new CaseNormalizer()); XMLAssert.assertXMLEqual( "<regexParameterFilter>\n" + " <key>TEST</key>\n" + " <defaultValue>Default</defaultValue>\n" + " <normalize/>\n" + " <regex>foo|Bar|BAZ</regex>\n" + "</regexParameterFilter>", xs.toXML... | @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... |
@Test public void testToXMLNoneNormalizer() throws Exception { filter.setNormalize(new CaseNormalizer(Case.NONE)); XMLAssert.assertXMLEqual( "<regexParameterFilter>\n" + " <key>TEST</key>\n" + " <defaultValue>Default</defaultValue>\n" + " <normalize>\n" + " <case>NONE</case>\n" + " </normalize>\n" + " <regex>foo|Bar|BA... | @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... |
@Test public void testEscapeXMLChars() throws Exception { TileLayerDispatcher tld = createMock(TileLayerDispatcher.class); HttpServletRequest servReq = createMock(HttpServletRequest.class); HttpServletResponse response = createMock(HttpServletResponse.class); String baseUrl = "http: String contextPath = "service/"; URL... | String generateGetCapabilities(Charset encoding) { StringBuilder str = new StringBuilder(); XMLBuilder xml = new XMLBuilder(str); try { xml.header("1.0", encoding); xml.appendUnescaped( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http: if (includeVendorSpecific) { xml.appendUnescaped("[\n"); xml.appendUnescaped("<!ELEMENT ... | WMSGetCapabilities { String generateGetCapabilities(Charset encoding) { StringBuilder str = new StringBuilder(); XMLBuilder xml = new XMLBuilder(str); try { xml.header("1.0", encoding); xml.appendUnescaped( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http: if (includeVendorSpecific) { xml.appendUnescaped("[\n"); xml.append... | WMSGetCapabilities { String generateGetCapabilities(Charset encoding) { StringBuilder str = new StringBuilder(); XMLBuilder xml = new XMLBuilder(str); try { xml.header("1.0", encoding); xml.appendUnescaped( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http: if (includeVendorSpecific) { xml.appendUnescaped("[\n"); xml.append... | WMSGetCapabilities { String generateGetCapabilities(Charset encoding) { StringBuilder str = new StringBuilder(); XMLBuilder xml = new XMLBuilder(str); try { xml.header("1.0", encoding); xml.appendUnescaped( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http: if (includeVendorSpecific) { xml.appendUnescaped("[\n"); xml.append... | WMSGetCapabilities { String generateGetCapabilities(Charset encoding) { StringBuilder str = new StringBuilder(); XMLBuilder xml = new XMLBuilder(str); try { xml.header("1.0", encoding); xml.appendUnescaped( "<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http: if (includeVendorSpecific) { xml.appendUnescaped("[\n"); xml.append... |
@Test public void testToXMLUpperCanadianEnglish() throws Exception { filter.setNormalize(new CaseNormalizer(Case.UPPER, Locale.CANADA)); XMLAssert.assertXMLEqual( "<regexParameterFilter>\n" + " <key>TEST</key>\n" + " <defaultValue>Default</defaultValue>\n" + " <normalize>\n" + " <case>UPPER</case>\n" + " <locale>en_CA<... | @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); } | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... | RegexParameterFilter extends CaseNormalizingParameterFilter { @Override public void setNormalize(CaseNormalizer normalize) { super.setNormalize(normalize); this.pat = compile(this.regex, getNormalize().getCase()); } RegexParameterFilter(); synchronized Matcher getMatcher(String value); @Override String apply(String str... |
@Test public void testEmptyToKVP() { String result = ParametersUtils.getKvp(Collections.emptyMap()); assertThat(result, isEmptyString()); } | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testEmptyToMap() { Map<String, String> result = ParametersUtils.getMap(""); assertThat(result.entrySet(), empty()); } | public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... |
@Test public void testSingletonToKVP() { String result = ParametersUtils.getKvp(Collections.singletonMap("test", "blah")); assertThat(result, Matchers.equalTo("test=blah")); } | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testSingletonToMap() { Map<String, String> result = ParametersUtils.getMap("test=blah"); assertThat(result, hasEntries(entry(equalTo("test"), equalTo("blah")))); } | public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... |
@Test public void testTwoToKVP() { Map<String, String> parameters = new TreeMap<>(); parameters.put("test1", "blah1"); parameters.put("test2", "blah2"); String result = ParametersUtils.getKvp(parameters); assertThat(result, Matchers.equalTo("test1=blah1&test2=blah2")); } | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testTwoToMap() { Map<String, String> result = ParametersUtils.getMap("test1=blah1&test2=blah2"); assertThat( result, hasEntries( entry(equalTo("test1"), equalTo("blah1")), entry(equalTo("test2"), equalTo("blah2")))); } | public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... |
@Test public void testTwoToKVPSorting() { Map<String, String> parameters = new TreeMap<>( (s1, s2) -> -s1.compareTo(s2)); parameters.put("test1", "blah1"); parameters.put("test2", "blah2"); String result = ParametersUtils.getKvp(parameters); assertThat( result, Matchers.equalTo("test1=blah1&test2=blah2")); } | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testEqualsToKVP() { Map<String, String> parameters = new TreeMap<>(); parameters.put("=test1", "=blah1"); parameters.put("te=st2", "bl=ah2"); parameters.put("test3=", "blah3="); String result = ParametersUtils.getKvp(parameters); assertThat( result, Matchers.equalTo("%3Dtest1=%3Dblah1&te%3Dst2=bl%3Dah... | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testEqualsToMap() { Map<String, String> result = ParametersUtils.getMap("%3Dtest1=%3Dblah1&te%3Dst2=bl%3Dah2&test3%3D=blah3%3D"); assertThat( result, hasEntries( entry(equalTo("=test1"), equalTo("=blah1")), entry(equalTo("te=st2"), equalTo("bl=ah2")), entry(equalTo("test3="), equalTo("blah3=")))); } | public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... |
@Test public void testGetCap() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMSService(sb, tld, mock(RuntimeStats.class), new NullURLMangler(), gwcd); @SuppressWarnings("unchecked") Map<String, String[]> kvp = new CaseIn... | @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled", "cached", "metatiled", "widt... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... |
@Test public void testAmpToKVP() { Map<String, String> parameters = new TreeMap<>(); parameters.put("&test1", "&blah1"); parameters.put("te&st2", "bl&ah2"); parameters.put("test3&", "blah3&"); String result = ParametersUtils.getKvp(parameters); assertThat( result, Matchers.equalTo("%26test1=%26blah1&te%26st2=bl%26ah2&t... | public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } } | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... | ParametersUtils { public static String getKvp(Map<String, String> parameters) { return parameters .entrySet() .stream() .sorted(derivedComparator(Entry::getKey)) .map(e -> String.join("=", encUTF8(e.getKey()), encUTF8(e.getValue()))) .collect(Collectors.joining("&")); } static String getLegacyParametersKvp(Map<String,... |
@Test public void testAmpToMap() { Map<String, String> result = ParametersUtils.getMap("%26test1=%26blah1&te%26st2=bl%26ah2&test3%26=blah3%26"); assertThat( result, hasEntries( entry(equalTo("&test1"), equalTo("&blah1")), entry(equalTo("te&st2"), equalTo("bl&ah2")), entry(equalTo("test3&"), equalTo("blah3&")))); } | public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } } | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... | ParametersUtils { public static Map<String, String> getMap(String kvp) { return Arrays.stream(kvp.split("&")) .filter(((Predicate<String>) String::isEmpty).negate()) .map(pair -> pair.split("=", 2)) .collect(Collectors.toMap(p -> decUTF8(p[0]), p -> decUTF8(p[1]))); } static String getLegacyParametersKvp(Map<String, S... |
@Test public void testDoTruncate() throws Exception { String layerName = "testLayer"; BoundingBox bbox = new BoundingBox(0.0, 1.0, 10.0, 11.0); String gridSetName = "testGridset"; TruncateBboxRequest request = new TruncateBboxRequest(layerName, bbox, gridSetName); StorageBroker broker = EasyMock.createMock("broker", St... | @Override public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { final Set<Map<String, String>> allParams = sb.getCachedParameters(layerName); final TileLayer tileLayer = breeder.findTileLayer(layerName); final Collection<MimeType> allFormats = tileLayer.getMime... | TruncateBboxRequest implements MassTruncateRequest { @Override public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { final Set<Map<String, String>> allParams = sb.getCachedParameters(layerName); final TileLayer tileLayer = breeder.findTileLayer(layerName); fina... | TruncateBboxRequest implements MassTruncateRequest { @Override public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { final Set<Map<String, String>> allParams = sb.getCachedParameters(layerName); final TileLayer tileLayer = breeder.findTileLayer(layerName); fina... | TruncateBboxRequest implements MassTruncateRequest { @Override public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { final Set<Map<String, String>> allParams = sb.getCachedParameters(layerName); final TileLayer tileLayer = breeder.findTileLayer(layerName); fina... | TruncateBboxRequest implements MassTruncateRequest { @Override public boolean doTruncate(StorageBroker sb, TileBreeder breeder) throws StorageException, GeoWebCacheException { final Set<Map<String, String>> allParams = sb.getCachedParameters(layerName); final TileLayer tileLayer = breeder.findTileLayer(layerName); fina... |
@Test public void testWithUrl() { LegendInfo legendInfo = new LegendInfoBuilder() .withLayerName("layer1") .withLayerUrl("http: .withDefaultWidth(50) .withDefaultHeight(100) .withDefaultFormat("image/png") .withStyleName("style1") .withWidth(150) .withHeight(200) .withFormat("image/gif") .withUrl("http: .build(); asser... | public LegendInfoBuilder withUrl(String url) { this.url = url; return this; } | LegendInfoBuilder { public LegendInfoBuilder withUrl(String url) { this.url = url; return this; } } | LegendInfoBuilder { public LegendInfoBuilder withUrl(String url) { this.url = url; return this; } } | LegendInfoBuilder { public LegendInfoBuilder withUrl(String url) { this.url = url; return this; } LegendInfoBuilder withLayerName(String layerName); LegendInfoBuilder withLayerUrl(String layerUrl); LegendInfoBuilder withDefaultWidth(Integer defaultWidth); LegendInfoBuilder withDefaultHeight(Integer defaultHeight); Leg... | LegendInfoBuilder { public LegendInfoBuilder withUrl(String url) { this.url = url; return this; } LegendInfoBuilder withLayerName(String layerName); LegendInfoBuilder withLayerUrl(String layerUrl); LegendInfoBuilder withDefaultWidth(Integer defaultWidth); LegendInfoBuilder withDefaultHeight(Integer defaultHeight); Leg... |
@Test public void testWithCompleteUrl() { LegendInfo legendInfo = new LegendInfoBuilder() .withLayerName("layer1") .withLayerUrl("http: .withDefaultWidth(50) .withDefaultHeight(100) .withDefaultFormat("image/png") .withStyleName("style1") .withWidth(150) .withHeight(200) .withFormat("image/gif") .withCompleteUrl("http:... | public LegendInfoBuilder withCompleteUrl(String completeUrl) { this.completeUrl = completeUrl; return this; } | LegendInfoBuilder { public LegendInfoBuilder withCompleteUrl(String completeUrl) { this.completeUrl = completeUrl; return this; } } | LegendInfoBuilder { public LegendInfoBuilder withCompleteUrl(String completeUrl) { this.completeUrl = completeUrl; return this; } } | LegendInfoBuilder { public LegendInfoBuilder withCompleteUrl(String completeUrl) { this.completeUrl = completeUrl; return this; } LegendInfoBuilder withLayerName(String layerName); LegendInfoBuilder withLayerUrl(String layerUrl); LegendInfoBuilder withDefaultWidth(Integer defaultWidth); LegendInfoBuilder withDefaultHe... | LegendInfoBuilder { public LegendInfoBuilder withCompleteUrl(String completeUrl) { this.completeUrl = completeUrl; return this; } LegendInfoBuilder withLayerName(String layerName); LegendInfoBuilder withLayerUrl(String layerUrl); LegendInfoBuilder withDefaultWidth(Integer defaultWidth); LegendInfoBuilder withDefaultHe... |
@Test public void testEmpty() throws Exception { ListenerCollection<Runnable> collection = new ListenerCollection<>(); collection.safeForEach( (x) -> { fail("should not be called"); }); } | public synchronized void safeForEach(HandlerMethod<Listener> method) throws GeoWebCacheException, IOException { LinkedList<Exception> exceptions = listeners .stream() .map( l -> { try { method.callOn(l); return Optional.<Exception>empty(); } catch (Exception ex) { return Optional.of(ex); } }) .filter(Optional::isPresen... | ListenerCollection { public synchronized void safeForEach(HandlerMethod<Listener> method) throws GeoWebCacheException, IOException { LinkedList<Exception> exceptions = listeners .stream() .map( l -> { try { method.callOn(l); return Optional.<Exception>empty(); } catch (Exception ex) { return Optional.of(ex); } }) .filt... | ListenerCollection { public synchronized void safeForEach(HandlerMethod<Listener> method) throws GeoWebCacheException, IOException { LinkedList<Exception> exceptions = listeners .stream() .map( l -> { try { method.callOn(l); return Optional.<Exception>empty(); } catch (Exception ex) { return Optional.of(ex); } }) .filt... | ListenerCollection { public synchronized void safeForEach(HandlerMethod<Listener> method) throws GeoWebCacheException, IOException { LinkedList<Exception> exceptions = listeners .stream() .map( l -> { try { method.callOn(l); return Optional.<Exception>empty(); } catch (Exception ex) { return Optional.of(ex); } }) .filt... | ListenerCollection { public synchronized void safeForEach(HandlerMethod<Listener> method) throws GeoWebCacheException, IOException { LinkedList<Exception> exceptions = listeners .stream() .map( l -> { try { method.callOn(l); return Optional.<Exception>empty(); } catch (Exception ex) { return Optional.of(ex); } }) .filt... |
@Test public void testRemove() throws Exception { ListenerCollection<Runnable> collection = new ListenerCollection<>(); IMocksControl control = EasyMock.createControl(); Runnable l1 = control.createMock("l1", Runnable.class); Runnable l2 = control.createMock("l2", Runnable.class); control.checkOrder(true); l2.run(); Ea... | public synchronized void remove(Listener listener) { listeners.remove(listener); } | ListenerCollection { public synchronized void remove(Listener listener) { listeners.remove(listener); } } | ListenerCollection { public synchronized void remove(Listener listener) { listeners.remove(listener); } } | ListenerCollection { public synchronized void remove(Listener listener) { listeners.remove(listener); } synchronized void add(Listener listener); synchronized void remove(Listener listener); synchronized void safeForEach(HandlerMethod<Listener> method); } | ListenerCollection { public synchronized void remove(Listener listener) { listeners.remove(listener); } synchronized void add(Listener listener); synchronized void remove(Listener listener); synchronized void safeForEach(HandlerMethod<Listener> method); } |
@Test public void testAddLayer() throws Exception { int count = config.getLayerCount(); TileLayer tl = createTestLayer("testLayer"); config.addLayer(tl); assertEquals(count + 1, config.getLayerCount()); assertSame(tl, config.getLayer("testLayer").get()); try { config.addLayer(tl); fail("Expected IllegalArgumentExceptio... | public synchronized void addLayer(TileLayer tl) throws IllegalArgumentException { if (tl == null) { throw new NullPointerException(); } if (!canSaveIfNotTransient(tl)) { throw new IllegalArgumentException( "Can't add layers of type " + tl.getClass().getName()); } if (getLayer(tl.getName()).isPresent()) { throw new Ille... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void addLayer(TileLayer tl) throws IllegalArgumentExcepti... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void addLayer(TileLayer tl) throws IllegalArgumentExcepti... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void addLayer(TileLayer tl) throws IllegalArgumentExcepti... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void addLayer(TileLayer tl) throws IllegalArgumentExcepti... |
@Test public void testNotAddLayer() throws Exception { TileLayer tl = mock(WMSLayer.class); when(tl.getName()).thenReturn("testLayer"); when(tl.isTransientLayer()).thenReturn(true); assertFalse(config.canSave(tl)); } | public boolean canSave(TileLayer tl) { if (tl.isTransientLayer()) { return false; } return canSaveIfNotTransient(tl); } | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public boolean canSave(TileLayer tl) { if (tl.isTransientLayer()) { return fa... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public boolean canSave(TileLayer tl) { if (tl.isTransientLayer()) { return fa... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public boolean canSave(TileLayer tl) { if (tl.isTransientLayer()) { return fa... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public boolean canSave(TileLayer tl) { if (tl.isTransientLayer()) { return fa... |
@Test public void testModifyLayer() throws Exception { WMSLayer layer1 = createTestLayer("testLayer"); config.addLayer(layer1); int count = config.getLayerCount(); WMSLayer layer2 = createTestLayer("testLayer"); config.modifyLayer(layer2); assertEquals(count, config.getLayerCount()); assertSame(layer2, config.getLayer(... | public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementException { TileLayer previous = findLayer(tl.getName()); if (!canSaveIfNotTransient(tl)) { throw new IllegalArgumentException( "Can't add layers of type " + tl.getClass().getName()); } getGwcConfig().getLayers().remove(previous); initialize(tl); ge... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementExcept... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementExcept... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementExcept... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void modifyLayer(TileLayer tl) throws NoSuchElementExcept... |
@Test public void testGetCapEncoding() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMSService(sb, tld, mock(RuntimeStats.class), new NullURLMangler(), gwcd); @SuppressWarnings("unchecked") Map<String, String[]> kvp = ne... | @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled", "cached", "metatiled", "widt... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... |
@Test public void testRemoveLayer() { try { config.removeLayer("nonExistent"); fail("Expected exception removing nonExistant layer"); } catch (Exception e) { } Set<String> tileLayerNames = config.getLayerNames(); for (String name : tileLayerNames) { int count = config.getLayerCount(); config.removeLayer(name); assertEq... | public synchronized void removeLayer(final String layerName) throws NoSuchElementException, IllegalArgumentException { final TileLayer tileLayer = findLayer(layerName); if (tileLayer == null) { throw new NoSuchElementException("Layer " + layerName + " does not exist"); } boolean removed = getGwcConfig().getLayers().rem... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void removeLayer(final String layerName) throws NoSuchEle... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void removeLayer(final String layerName) throws NoSuchEle... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void removeLayer(final String layerName) throws NoSuchEle... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { public synchronized void removeLayer(final String layerName) throws NoSuchEle... |
@Test public void testSave() throws Exception { for (String name : config.getLayerNames()) { int count = config.getLayerCount(); config.removeLayer(name); assertEquals(count - 1, config.getLayerCount()); } String layerName = "testLayer"; String[] wmsURL = {"http: String wmsStyles = "default,line"; String wmsLayers = "s... | private synchronized void save() throws IOException { if (!resourceProvider.hasOutput()) { return; } try { resourceProvider.backup(); } catch (Exception e) { log.warn("Error creating back up of configuration file " + resourceProvider.getId(), e); } persistToFile(); } | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private synchronized void save() throws IOException { if (!resourceProvider.h... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private synchronized void save() throws IOException { if (!resourceProvider.h... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private synchronized void save() throws IOException { if (!resourceProvider.h... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private synchronized void save() throws IOException { if (!resourceProvider.h... |
@Test public void testSaveGridSet() throws Exception { String name = "testGrid"; SRS srs = SRS.getEPSG4326(); BoundingBox extent = new BoundingBox(-1, -1, 1, 1); boolean alignTopLeft = true; double[] resolutions = {3, 2, 1}; double[] scaleDenoms = null; Double metersPerUnit = 1.5; double pixelSize = 2 * GridSetFactory.... | private void saveGridSet(GridSet gridSet) throws IOException { addOrReplaceGridSet(new XMLGridSet(gridSet)); save(); } | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private void saveGridSet(GridSet gridSet) throws IOException { addOrReplaceGr... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private void saveGridSet(GridSet gridSet) throws IOException { addOrReplaceGr... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private void saveGridSet(GridSet gridSet) throws IOException { addOrReplaceGr... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { private void saveGridSet(GridSet gridSet) throws IOException { addOrReplaceGr... |
@Test public void testOverrideGridSetDefaults() throws Exception { URL source = XMLConfiguration.class.getResource("geowebcache_4326_override.xml"); FileUtils.copyURLToFile(source, configFile); XMLConfiguration config2 = new XMLConfiguration(null, configDir.getAbsolutePath()); final DefaultGridsets defaultGridSets = ne... | @Autowired @Override public void setGridSetBroker(@Qualifier("gwcGridSetBroker") GridSetBroker broker) { this.gridSetBroker = broker; } | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Autowired @Override public void setGridSetBroker(@Qualifier("gwcGridSetBroke... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Autowired @Override public void setGridSetBroker(@Qualifier("gwcGridSetBroke... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Autowired @Override public void setGridSetBroker(@Qualifier("gwcGridSetBroke... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Autowired @Override public void setGridSetBroker(@Qualifier("gwcGridSetBroke... |
@Test public void testNoBlobStores() throws Exception { assertNotNull(config.getBlobStores()); assertTrue(config.getBlobStores().isEmpty()); } | @Override public List<BlobStoreInfo> getBlobStores() { return Collections.unmodifiableList( getGwcConfig() .getBlobStores() .stream() .map( (info) -> { return (BlobStoreInfo) info.clone(); }) .collect(Collectors.toList())); } | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Override public List<BlobStoreInfo> getBlobStores() { return Collections.unm... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Override public List<BlobStoreInfo> getBlobStores() { return Collections.unm... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Override public List<BlobStoreInfo> getBlobStores() { return Collections.unm... | XMLConfiguration implements TileLayerConfiguration,
InitializingBean,
DefaultingConfiguration,
ServerConfiguration,
BlobStoreConfiguration,
GridSetConfiguration { @Override public List<BlobStoreInfo> getBlobStores() { return Collections.unm... |
@Test public void noStoresDefinedCreatesLegacyDefaultStore() throws Exception { store = create(); assertEquals(1, store.blobStores.size()); LiveStore liveStore = store.blobStores.get(CompositeBlobStore.DEFAULT_STORE_DEFAULT_ID); assertNotNull(liveStore); assertTrue(liveStore.config instanceof FileBlobStoreInfo); FileBl... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void noExplicitDefaultCreatesLegacyDefaultStore() throws Exception { final boolean isDefault = false; configs.add( config("store1", isDefault, true, tmpFolder.newFolder().getAbsolutePath(), 1024)); configs.add( config("store2", isDefault, true, tmpFolder.newFolder().getAbsolutePath(), 2048)); store = creat... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void disabledStoreHasNoLiveInstance() throws Exception { boolean enabled = false; configs.add( config("storeId", false, enabled, tmpFolder.newFolder().getAbsolutePath(), 1024)); store = create(); assertNotNull(store.blobStores.get("storeId")); assertNull(store.blobStores.get("storeId").liveInstance); } | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void configuredDefaultRespectedAndNoLegacyDefaultCreated() throws Exception { configs.add( config( "some-other", false , true, tmpFolder.newFolder().getAbsolutePath(), 1024)); FileBlobStoreInfo defaultStore = config("default-store", true, true, tmpFolder.newFolder().getAbsolutePath(), 1024); configs.add(de... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void getTileInvalidBlobStore() throws Exception { configs.add(config("default", true, true, tmpFolder.newFolder().getAbsolutePath(), 1024)); store = create(); when(defaultLayer.getBlobStoreId()).thenReturn("nonExistentStore"); ex.expect(StorageException.class); ex.expectMessage("No BlobStore with id 'nonEx... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void testGetConveyorWithParameters() throws Exception { GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMSService(sb, tld, mock(RuntimeStats.class), new NullURLMangler(), gwcd); String layerName = "mockLayer"; String timeValue =... | @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled", "cached", "metatiled", "widt... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... | WMSService extends Service { @Override public ConveyorTile getConveyor(HttpServletRequest request, HttpServletResponse response) throws GeoWebCacheException { final String encoding = request.getCharacterEncoding(); final Map requestParameterMap = request.getParameterMap(); String[] keys = {"layers", "request", "tiled",... |
@Test public void getTileDefaultsToDefaultBlobStore() throws Exception { store = create(); LiveStore liveStore = store.blobStores.get(CompositeBlobStore.DEFAULT_STORE_DEFAULT_ID); liveStore.liveInstance = spy(liveStore.liveInstance); when(defaultLayer.getBlobStoreId()).thenReturn(null); TileObject tile = queryTile(0, 0... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void getTileInvalidLayer() throws Exception { store = create(); LiveStore liveStore = store.blobStores.get(CompositeBlobStore.DEFAULT_STORE_DEFAULT_ID); liveStore.liveInstance = spy(liveStore.liveInstance); when(defaultLayer.getBlobStoreId()).thenReturn(null); TileObject tile = queryTile("someLayer", DEFAU... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void getTileDisabledStore() throws Exception { boolean isEnabled = false; configs.add( config("store1", false, isEnabled, tmpFolder.newFolder().getAbsolutePath(), 1024)); store = create(); when(defaultLayer.getBlobStoreId()).thenReturn("store1"); TileObject tile = queryTile(0, 0, 0); ex.expect(StorageExcep... | @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { @Override public boolean get(TileObject obj) throws StorageException { return readFunctionUnsafe(() -> store(obj.getLayerName()).get(obj)); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStor... |
@Test public void testSuitabilityOnStartup() throws Exception { assertThat( CompositeBlobStore.getStoreSuitabilityCheck(), equalTo(CompositeBlobStore.StoreSuitabilityCheck.EXISTING)); final BlobStoreInfo info = mock(BlobStoreInfo.class); when(info.getName()).thenReturn("testStore"); when(info.isEnabled()).thenReturn(tr... | public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... |
@Test public void testNonDefaultSuitabilityOnStartup() throws Exception { suitability.setValue(CompositeBlobStore.StoreSuitabilityCheck.EMPTY); assertThat( CompositeBlobStore.getStoreSuitabilityCheck(), equalTo(CompositeBlobStore.StoreSuitabilityCheck.EMPTY)); final BlobStoreInfo info = mock(BlobStoreInfo.class); when(... | public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } } | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... | CompositeBlobStore implements BlobStore, BlobStoreConfigurationListener { public static StoreSuitabilityCheck getStoreSuitabilityCheck() { return storeSuitability.get(); } CompositeBlobStore(
TileLayerDispatcher layers,
DefaultStorageFinder defaultStorageFinder,
ServerConfiguration s... |
@Test public void testSetApplicationContext() { ApplicationContext appContext1 = createMock(ApplicationContext.class); ApplicationContext appContext2 = createMock(ApplicationContext.class); GeoWebCacheExtensions gse = new GeoWebCacheExtensions(); gse.setApplicationContext(appContext1); GeoWebCacheExtensions.extensionsC... | @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setApplicationContext(ApplicationContext context) throws BeansException { GeoWebCacheExtensions.context = context; extensionsCache.clear(); } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setApplicationContext(ApplicationContext context) throws BeansException { GeoWebCacheExtensions.context = context; extensionsCache.clear(); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setApplicationContext(ApplicationContext context) throws BeansException { GeoWebCacheExtensions.context = context; extensionsCache.clear(); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setApplicationContext(ApplicationContext context) throws BeansException { GeoWebCacheExtensions.context = context; extensionsCache.clear(); } @SuppressFBWarnings("S... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") public void setApplicationContext(ApplicationContext context) throws BeansException { GeoWebCacheExtensions.context = context; extensionsCache.clear(); } @SuppressFBWarnings("S... |
@Test public void testExtensions() { ApplicationContext appContext = createMock(ApplicationContext.class); GeoWebCacheExtensions gse = new GeoWebCacheExtensions(); gse.setApplicationContext(appContext); Map<String, GeoWebCacheExtensionsTest> beans = new HashMap<>(); beans.put("testKey", this); beans.put("fakeKey", null... | @SuppressWarnings("unchecked") public static final <T> List<T> extensions( Class<T> extensionPoint, ApplicationContext context) { String[] names; if (GeoWebCacheExtensions.context == context) { names = extensionsCache.get(extensionPoint); } else { names = null; } if (names == null) { checkContext(context); if (context ... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressWarnings("unchecked") public static final <T> List<T> extensions( Class<T> extensionPoint, ApplicationContext context) { String[] names; if (GeoWebCacheExtensions.context == context) { names = extensionsCache.get(extensionPoint); }... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressWarnings("unchecked") public static final <T> List<T> extensions( Class<T> extensionPoint, ApplicationContext context) { String[] names; if (GeoWebCacheExtensions.context == context) { names = extensionsCache.get(extensionPoint); }... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressWarnings("unchecked") public static final <T> List<T> extensions( Class<T> extensionPoint, ApplicationContext context) { String[] names; if (GeoWebCacheExtensions.context == context) { names = extensionsCache.get(extensionPoint); }... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { @SuppressWarnings("unchecked") public static final <T> List<T> extensions( Class<T> extensionPoint, ApplicationContext context) { String[] names; if (GeoWebCacheExtensions.context == context) { names = extensionsCache.get(extensionPoint); }... |
@Test public void testSystemProperty() { testProperty.setValue("ABC"); assertEquals( "ABC", GeoWebCacheExtensions.getProperty("TEST_PROPERTY", (ApplicationContext) null)); assertEquals( "ABC", GeoWebCacheExtensions.getProperty("TEST_PROPERTY", (ServletContext) null)); } | public static String getProperty(String propertyName) { return getProperty(propertyName, context); } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") void setApplicationContext(ApplicationContext context); @SuppressWarnings("... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") void setApplicationContext(ApplicationContext context); @SuppressWarnings("... |
@Test public void testWebProperty() { testProperty.setValue("ABC"); ServletContext servletContext = createMock(ServletContext.class); expect(servletContext.getInitParameter("TEST_PROPERTY")).andReturn("DEF").anyTimes(); expect(servletContext.getInitParameter("WEB_PROPERTY")).andReturn("WWW").anyTimes(); replay(servletC... | public static String getProperty(String propertyName) { return getProperty(propertyName, context); } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } } | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") void setApplicationContext(ApplicationContext context); @SuppressWarnings("... | GeoWebCacheExtensions implements ApplicationContextAware, ApplicationListener { public static String getProperty(String propertyName) { return getProperty(propertyName, context); } @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD") void setApplicationContext(ApplicationContext context); @SuppressWarnings("... |
@Test public void testGetDefaultGridsetOld() throws IOException { GridSet existingGridSet = gridSetBroker.get(GWCConfigIntegrationTestData.GRIDSET_EPSG4326); assertThat( existingGridSet, hasProperty("name", equalTo(GWCConfigIntegrationTestData.GRIDSET_EPSG4326))); } | public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... |
@Test public void testProxyRequest() throws Exception { SecurityDispatcher secDisp = mock(SecurityDispatcher.class); when(secDisp.isSecurityEnabled()).thenReturn(false); GeoWebCacheDispatcher gwcd = mock(GeoWebCacheDispatcher.class); when(gwcd.getServletPrefix()).thenReturn(null); service = new WMSService(sb, tld, mock... | public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } } | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... | WMSService extends Service { public void setSecurityDispatcher(SecurityDispatcher securityDispatcher) { this.securityDispatcher = securityDispatcher; } protected WMSService(); WMSService(StorageBroker sb, TileLayerDispatcher tld, RuntimeStats stats); WMSService(
StorageBroker sb,
TileLayerDis... |
@Test public void testGetDefaultGridSet() throws IOException { Optional<GridSet> existingGridSet = gridSetBroker.getGridSet(GWCConfigIntegrationTestData.GRIDSET_EPSG4326); assertThat( existingGridSet, isPresent( hasProperty( "name", equalTo(GWCConfigIntegrationTestData.GRIDSET_EPSG4326)))); } | protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPresent()) { GridSet set = gridSet.get(); return Optional.of(set); } } return Optional.empty(); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... |
@Test public void testGetGridsetOld() throws IOException { GridSet existingGridSet = gridSetBroker.get(GWCConfigIntegrationTestData.GRIDSET_EPSG2163); assertThat( existingGridSet, hasProperty("name", equalTo(GWCConfigIntegrationTestData.GRIDSET_EPSG2163))); } | public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... |
@Test public void testGetGridSet() throws IOException { Optional<GridSet> existingGridSet = gridSetBroker.getGridSet(GWCConfigIntegrationTestData.GRIDSET_EPSG2163); assertThat( existingGridSet, isPresent( hasProperty( "name", equalTo(GWCConfigIntegrationTestData.GRIDSET_EPSG2163)))); } | protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPresent()) { GridSet set = gridSet.get(); return Optional.of(set); } } return Optional.empty(); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... |
@Test public void testGetNotPresentGridsetOld() throws IOException { GridSet existingGridSet = gridSetBroker.get("DOESNOTEXIST"); assertThat(existingGridSet, nullValue()); } | public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { public @Nullable GridSet get(String gridSetId) { return getGridSet(gridSetId).orElse(null); } GridSetBroker(); GridSetBroker(List<GridSetConfiguration> configurations); vo... |
@Test public void testGetNotPresentGridSet() throws IOException { Optional<GridSet> existingGridSet = gridSetBroker.getGridSet("DOESNOTEXIST"); assertThat(existingGridSet, notPresent()); } | protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPresent()) { GridSet set = gridSet.get(); return Optional.of(set); } } return Optional.empty(); } | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... | GridSetBroker implements ConfigurationAggregator<GridSetConfiguration>,
ApplicationContextAware,
InitializingBean { protected Optional<GridSet> getGridSet(String name) { for (GridSetConfiguration c : getConfigurations()) { Optional<GridSet> gridSet = c.getGridSet(name); if (gridSet.isPre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.