urlSet = new HashSet<URL>();
urlSet.add(url);
EasyMock.expect(context.getResources("/WEB-INF/tiles-two.xml")).andReturn(urlSet);
EasyMock.expect(context.getInitParameterNames()).andReturn(v.elements()).anyTimes();
EasyMock.replay(context);
KeyedDefinitionsFactoryTilesContainerFactory factory =
(KeyedDefinitionsFactoryTilesContainerFactory)
AbstractTilesContainerFactory.getTilesContainerFactory(context);
factory.setDefaultConfiguration(defaults);
container = (KeyedDefinitionsFactoryTilesContainer) factory.createContainer(context);
assertNotNull(container);
assertNotNull(container.getDefinitionsFactory());
assertNull(container.getProperDefinitionsFactory("one"));
assertNull(container.getProperDefinitionsFactory("two"));
Map<String, String> initParams = new HashMap<String, String>();
initParams.put(DefinitionsFactory.DEFINITIONS_CONFIG,
"/WEB-INF/tiles-one.xml");
DefinitionsFactory defsFactory = factory.createDefinitionsFactory(context);
defsFactory.init(initParams);
container.setDefinitionsFactory("one", defsFactory);
initParams.put(DefinitionsFactory.DEFINITIONS_CONFIG,
"/WEB-INF/tiles-two.xml");
defsFactory = factory.createDefinitionsFactory(context);
defsFactory.init(initParams);
container.setDefinitionsFactory("two", defsFactory);
assertNotNull(container.getProperDefinitionsFactory("one"));
assertNotNull(container.getProperDefinitionsFactory("two"));
}