WmsTileFactory implements TileFactory { public void setLayerNames(String layerNames) { if (layerNames == null) { throw new IllegalArgumentException( Logger.logMessage(Logger.ERROR, "WmsTileFactory", "setLayerNames", "missingLayerNames")); } this.layerNames = layerNames; } WmsTileFactory(String serviceAddress, String wmsVersion, String layerNames, String styleNames);  WmsTileFactory(WmsLayerConfig config); String getServiceAddress(); void setServiceAddress(String serviceAddress); String getWmsVersion(); void setWmsVersion(String wmsVersion); String getLayerNames(); void setLayerNames(String layerNames); String getStyleNames(); void setStyleNames(String styleNames); String getCoordinateSystem(); void setCoordinateSystem(String coordinateSystem); String getImageFormat(); void setImageFormat(String imageFormat); boolean isTransparent(); void setTransparent(boolean transparent); String getTimeString(); void setTimeString(String timeString); @Override Tile createTile(Sector sector, Level level, int row, int column); String urlForTile(Sector sector, int width, int height);  }
@Test public void testSetLayerNames() { String updatedLayerNames = "layer1,layer2"; WmsLayerConfig layerConfig = new WmsLayerConfig(COMMON_SERVICE_ADDRESS, COMMON_LAYER_NAMES); WmsTileFactory standardWmsMapFactory = new WmsTileFactory(layerConfig); standardWmsMapFactory.setLayerNames(updatedLayerNames); String layerNames = standardWmsMapFactory.getLayerNames(); assertEquals("update layer names", updatedLayerNames, layerNames); standardWmsMapFactory = new WmsTileFactory(layerConfig); try { standardWmsMapFactory.setLayerNames(null); fail("null submission allowed for layer names"); } catch (IllegalArgumentException ex) { assertNotNull("null exception thrown", ex); } }