public synchronized void addGridSet(final GridSet gridSet) throws IllegalArgumentException, IOException { checkNotNull(gridSet); tld.addGridSet(gridSet); }
public synchronized void addGridSet(final GridSet gridSet) throws IllegalArgumentException, IOException { checkNotNull(gridSet); tld.addGridSet(gridSet); }
@Test public void testAddBadGridset() throws IOException { // existing GridSet existingGridSet = gridSetBroker.get(GWCConfigIntegrationTestData.GRIDSET_EPSG2163); try { tileLayerDispatcher.addGridSet(existingGridSet); fail("Expected exception adding existing gridset"); } catch (IllegalArgumentException e) { } try { tileLayerDispatcher.addGridSet(null); fail("Expected exception adding null gridset"); } catch (NullPointerException e) { } }
public void testAddGridset() throws Exception { try { mediator.addGridSet(null); fail(); } catch (NullPointerException e) { assertTrue(true); } GridSet gset = mock(GridSet.class); GridSet gset2 = mock(GridSet.class); doThrow(new IOException("fake")).when(tld).addGridSet(same(gset)); try { mediator.addGridSet(gset); fail(); } catch (IOException e) { assertEquals("fake", e.getMessage()); } mediator.addGridSet(gset2); verify(tld, times(1)).addGridSet(same(gset2)); }
@Test public void testAddGridset() throws GeoWebCacheException, IOException { String gridsetName = "EPSG:3005"; GridSet epsg3005 = GridSetFactory.createGridSet( gridsetName, SRS.getSRS(gridsetName), new BoundingBox(35043.6538, 440006.8768, 1885895.3117, 1735643.8497), false, null, new double[] {25000000, 1250000, 500000, 250000}, null, GridSetFactory.DEFAULT_PIXEL_SIZE_METER, null, 256, 256, false); tileLayerDispatcher.addGridSet(epsg3005); assertTrue(gridSetBroker.getNames().contains(gridsetName)); assertEquals(gridSetBroker.get(gridsetName), epsg3005); }