public void testResourceTranslator() throws Exception
{
RegistryBuilder builder = new RegistryBuilder();
builder.autoDetectModules();
Resource moduleResource = new ClasspathResource(_resolver,
"/hivemind/test/config/ResourceTranslator.xml");
XmlModuleReader reader = new XmlModuleReader(builder.getRegistryDefinition(),
_resolver, builder.getErrorHandler());
reader.readModule(moduleResource);
Registry r = builder.constructRegistry(Locale.FRENCH);
interceptLogging();
List l = (List) r.getConfiguration("hivemind.test.config.ResourceTranslator");
assertEquals(4, l.size());
ResourceHolder h = (ResourceHolder) l.get(0);
assertEquals(moduleResource.getRelativeResource("Empty.xml"), h.getResource());
h = (ResourceHolder) l.get(1);
assertEquals(moduleResource.getRelativeResource("Localized_fr.properties"), h.getResource());
h = (ResourceHolder) l.get(2);
assertNull(h.getResource());
h = (ResourceHolder) l.get(3);