EasyMock.replay(context);
TilesContainerFactory factory = (TilesContainerFactory) AbstractTilesContainerFactory
.getTilesContainerFactory(context);
factory.setDefaultConfiguration(defaults);
TilesContainer container = factory.createContainer(context);
assertNotNull(container);
assertTrue("The container is not an instance of KeyedDefinitionsFactoryTilesContainer",
container instanceof KeyedDefinitionsFactoryTilesContainer);
KeyedDefinitionsFactoryTilesContainer keyedContainer =
(KeyedDefinitionsFactoryTilesContainer) container;
assertNotNull(keyedContainer.getDefinitionsFactory());
assertNotNull(keyedContainer.getDefinitionsFactory("one"));
assertNotNull(keyedContainer.getDefinitionsFactory("two"));
//now make sure it's initialized
try {
container.init(new HashMap<String, String>());
fail("Container should have already been initialized");
} catch (IllegalStateException te) {
if (LOG.isDebugEnabled()) {
LOG.debug("The container has been initialized, the exception is ok", te);
}