public void testSeedMetaTiled() throws Exception {
WMSLayer layer = createWMSLayer("image/png");
WMSSourceHelper mockSourceHelper = new MockWMSSourceHelper();
MockLockProvider lockProvider = new MockLockProvider();
layer.setSourceHelper(mockSourceHelper);
layer.setLockProvider(lockProvider);
final StorageBroker mockStorageBroker = EasyMock.createMock(StorageBroker.class);
Capture<TileObject> captured = new Capture<TileObject>();
expect(mockStorageBroker.put(EasyMock.capture(captured))).andReturn(true).anyTimes();
replay(mockStorageBroker);
String layerId = layer.getName();
HttpServletRequest servletReq = new MockHttpServletRequest();
HttpServletResponse servletResp = new MockHttpServletResponse();
long[] gridLoc = { 0, 0, 0 };// x, y, level
MimeType mimeType = layer.getMimeTypes().get(0);
GridSet gridSet = gridSetBroker.WORLD_EPSG4326;
String gridSetId = gridSet.getName();
ConveyorTile tile = new ConveyorTile(mockStorageBroker, layerId, gridSetId, gridLoc,
mimeType, null, servletReq, servletResp);
boolean tryCache = false;
layer.seedTile(tile, tryCache);
assertEquals(1, captured.getValues().size());
TileObject value = captured.getValue();
assertNotNull(value);
assertEquals("image/png", value.getBlobFormat());
assertNotNull(value.getBlob());
assertTrue(value.getBlob().getSize() > 0);
verify(mockStorageBroker);
// check the lock provider was called in a symmetric way
lockProvider.verify();
lockProvider.clear();
}