protected void loadVisualizationFile(File file) { try { FileSystemXmlApplicationContext context = new FileSystemXmlApplicationContext(new String[]{file.getPath()}, false); context.setClassLoader(getClass().getClassLoader()); context.refresh(); Map beans = context.getBeansOfType(IVisualization.class); for (Object key : beans.keySet()) { IVisualization vis = (IVisualization)beans.get(key); if (vis.getOrder() >= 0) { visualizations.add(vis); } } } catch (XmlBeanDefinitionStoreException e) { // TODO: introduce logging e.printStackTrace(); } }
@Test(expected = XmlBeanDefinitionStoreException.class) public void testWithInvalidWeight() throws Exception { check("spring/XmlConfigPlaceholderTest5.xml", DEFAULT_TIMEOUT, DEFAULT_BATCH); }