private BasicTilesContainer container;
/** {@inheritDoc} */
@Override
public void setUp() {
TilesApplicationContext context = EasyMock
.createMock(TilesApplicationContext.class);
Map<String, String> initParams = new HashMap<String, String>();
URL url = getClass().getResource("/org/apache/tiles/factory/test-defs.xml");
initParams.put(
ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES,
RepeaterTilesApplicationContextFactory.class.getName());
initParams.put(
ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES,
RepeaterTilesRequestContextFactory.class.getName());
try {
Set<URL> urls = new HashSet<URL>();
urls.add(url);
EasyMock.expect(context.getResources("/WEB-INF/tiles.xml"))
.andReturn(urls);
} catch (IOException e) {
throw new RuntimeException("Error getting Tiles configuration URL",
e);
}
EasyMock.expect(context.getInitParams()).andReturn(initParams)
.anyTimes();
EasyMock.replay(context);
AbstractTilesContainerFactory factory = AbstractTilesContainerFactory
.getTilesContainerFactory(context);
container = (BasicTilesContainer) factory.createContainer(context);