private ApplicationResource urlWildcard;
private ApplicationResource url21;
private ApplicationResource url513;
private ApplicationResource setupUrl(String filename, Locale... locales) throws IOException {
ApplicationResource url = new URLApplicationResource("org/apache/tiles/config/" + filename + ".xml", this
.getClass().getClassLoader().getResource("org/apache/tiles/config/" + filename + ".xml"));
assertNotNull("Could not load " + filename + " file.", url);
expect(applicationContext.getResource(url.getLocalePath())).andReturn(url).anyTimes();
expect(applicationContext.getResource(url, Locale.ROOT)).andReturn(url).anyTimes();
Map<Locale, ApplicationResource> localeResources = new HashMap<Locale, ApplicationResource>();
for (Locale locale : locales) {
ApplicationResource urlLocale = new URLApplicationResource("org/apache/tiles/config/" + filename + "_"
+ locale.toString() + ".xml", this.getClass().getClassLoader()
.getResource("org/apache/tiles/config/" + filename + "_" + locale.toString() + ".xml"));
assertNotNull("Could not load " + filename + "_" + locale.toString() + " file.", urlLocale);
localeResources.put(locale, urlLocale);
}