Package org.geowebcache.util

Examples of org.geowebcache.util.MockLockProvider


        // WMS layer creation
        WMSLayer layer = new WMSLayer("test:layer", urls, "aStyle", "test:layer", formatList,
                grids, null, metaWidthHeight, "vendorparam=true", false, null);
        // Layer initialization
        layer.initialize(gridSetBroker);
        layer.setLockProvider(new MockLockProvider());

        return layer;
    }
View Full Code Here


        WMSLayer layer = new WMSLayer("test:layer", urls, "aStyle", "test:layer", formatList,
                grids, null, metaWidthHeight, "vendorparam=true", false, null);

        layer.initialize(gridSetBroker);
        layer.setLockProvider(new MockLockProvider());

        return layer;
    }
View Full Code Here

    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();
    }
View Full Code Here

                expectLastCall();
                replay(response);
                return response;
            }
        });
        MockLockProvider lockProvider = new MockLockProvider();
        layer.setLockProvider(lockProvider);

       
        // setup the conveyor tile
        final StorageBroker mockStorageBroker = EasyMock.createMock(StorageBroker.class);
View Full Code Here

TOP

Related Classes of org.geowebcache.util.MockLockProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.