private Map<String, String> defaults;
/** {@inheritDoc} */
@Override
public void setUp() {
TilesApplicationContext context = EasyMock
.createMock(TilesApplicationContext.class);
Map<String, String> initParameters = new HashMap<String, String>();
initParameters.put(
AbstractTilesContainerFactory.CONTAINER_FACTORY_INIT_PARAM,
KeyedDefinitionsFactoryTilesContainerFactory.class.getName());
initParameters.put(
ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES,
RepeaterTilesApplicationContextFactory.class.getName());
initParameters.put(
ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES,
RepeaterTilesRequestContextFactory.class.getName());
initParameters.put(
KeyedDefinitionsFactoryTilesContainerFactory.CONTAINER_KEYS_INIT_PARAM,
"one,two");
initParameters.put(
KeyedDefinitionsFactoryTilesContainer.DEFINITIONS_CONFIG_PREFIX
+ "one", "/WEB-INF/tiles-one.xml");
initParameters.put(
KeyedDefinitionsFactoryTilesContainer.DEFINITIONS_CONFIG_PREFIX
+ "two", "/WEB-INF/tiles-two.xml");
EasyMock.expect(context.getInitParams()).andReturn(initParameters)
.anyTimes();
try {
Set<URL> urlSet;
URL url = getClass().getResource("/org/apache/tiles/factory/test-defs.xml");
urlSet = new HashSet<URL>();
urlSet.add(url);
EasyMock.expect(context.getResources("/WEB-INF/tiles.xml")).andReturn(urlSet);
url = getClass().getResource("/org/apache/tiles/factory/test-defs-key-one.xml");
urlSet = new HashSet<URL>();
urlSet.add(url);
EasyMock.expect(context.getResources("/WEB-INF/tiles-one.xml")).andReturn(urlSet);
url = getClass().getResource("/org/apache/tiles/factory/test-defs-key-two.xml");
urlSet = new HashSet<URL>();
urlSet.add(url);
EasyMock.expect(context.getResources("/WEB-INF/tiles-two.xml")).andReturn(urlSet);
} catch (MalformedURLException e) {
throw new RuntimeException("Error getting Tiles configuration URL",
e);
} catch (IOException e) {
throw new RuntimeException("Error getting Tiles configuration URL",