public class ConfigurationDtoPostProcessorLayerTreeTest {
@Test
public void testLayerTreeCheck() throws Exception {
try {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
context.setId("test");
context.setDisplayName("test");
context.setConfigLocation(
"/org/geomajas/spring/geomajasContext.xml " +
"/org/geomajas/layer/bean/beanContext.xml " +
"/org/geomajas/layer/bean/layerBeans.xml " +
"/org/geomajas/internal/configuration/layerTreeInvalid.xml " +
"");
context.refresh();
Assert.fail("Context initialization should have failed.");
} catch (BeanCreationException bce) {
Assert.assertTrue(bce.getCause().getMessage().startsWith(
"A LayerTreeNodeInfo object can only reference layers which are part of the map, layer "));
}