public void testBuildFromXmlElement() throws Exception {
try {
File descriptor = JUnitExtension
.getFile("ResourceManagerConfigurationImplTest/TestResourceManagerConfiguration.xml");
ResourceManagerConfiguration rmc = UIMAFramework.getXMLParser()
.parseResourceManagerConfiguration(new XMLInputSource(descriptor));
ExternalResourceDescription[] resources = rmc.getExternalResources();
ExternalResourceBinding[] bindings = rmc.getExternalResourceBindings();
assertEquals(4, resources.length);
assertEquals(4, bindings.length);
assertEquals("Test Resource Manager Configuration", rmc.getName());
assertEquals("This is a test. This is only a test.", rmc.getDescription());
assertEquals("0.1", rmc.getVersion());
assertEquals("The Apache Software Foundation", rmc.getVendor());
descriptor = JUnitExtension
.getFile("ResourceManagerConfigurationImplTest/ResourceManagerConfigurationWithImports.xml");
rmc = UIMAFramework.getXMLParser().parseResourceManagerConfiguration(
new XMLInputSource(descriptor));
Import[] imports = rmc.getImports();
resources = rmc.getExternalResources();
bindings = rmc.getExternalResourceBindings();
assertEquals(1, imports.length);
assertEquals(0, resources.length);
assertEquals(1, bindings.length);
} catch (Exception e) {
JUnitExtension.handleException(e);