@Test
public void testBuildUrlCornerCases() throws TmsLayerException {

	try {
		new TileMapUrlBuilder(null);
		Assert.fail();
	} catch (IllegalStateException e) {
		// As expected...
	}
	TmsLayer tmsLayer = new TmsLayer();
	tmsLayer.setBaseTmsUrl("classpath:/org/geomajas/layer/tms/tileMapCapa2.xml");
	TileMap tileMap = configurationService
			.getCapabilities(tmsLayer);
	TileMapUrlBuilder builder = new TileMapUrlBuilder(tileMap);
	try {
		builder.buildUrl(null, BASE_TMS_URL);
		Assert.fail();
	} catch (IllegalArgumentException e) {
		// As expected...
	}
	try {
		builder.buildUrl(new TileCode(), null);
		Assert.fail();
	} catch (IllegalArgumentException e) {
		// As expected...
	}
}