1/*2 * $Id: TestAlternateTilesContainerFactory.java 1297705 2012-03-06 20:44:30Z nlebas $3 *4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122package org.apache.tiles.test.alt;
2324import java.util.ArrayList;
25import java.util.List;
2627import org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO;
28import org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO;
29import org.apache.tiles.locale.LocaleResolver;
30import org.apache.tiles.request.ApplicationContext;
31import org.apache.tiles.request.ApplicationResource;
32import org.apache.tiles.test.factory.TestTilesContainerFactory;
3334/**35 * Test alternate Tiles container factory to customize Tiles behaviour.36 *37 * @version $Rev: 1297705 $ $Date: 2012-03-07 07:44:30 +1100 (Wed, 07 Mar 2012) $38 */39publicclassTestAlternateTilesContainerFactoryextendsTestTilesContainerFactory {
4041/**42 * The number of URLs to load..43 */44privatestaticfinalint URL_COUNT = 3;
4546/** {@inheritDoc} */47 @Override
48protected List<ApplicationResource> getSources(ApplicationContext applicationContext) {
49 List<ApplicationResource> urls = new ArrayList<ApplicationResource>(URL_COUNT);
50 urls.add(applicationContext.getResource("classpath:/org/apache/tiles/test/alt/defs/tiles-alt-defs.xml"));
51 urls.add(applicationContext.getResource("classpath:/org/apache/tiles/test/alt/defs/tiles-alt-freemarker-defs.xml"));
52 urls.add(applicationContext.getResource("classpath:/org/apache/tiles/test/alt/defs/tiles-alt-velocity-defs.xml"));
53return urls;
54 }
5556/** {@inheritDoc} */57 @Override
58protectedBaseLocaleUrlDefinitionDAO instantiateLocaleDefinitionDao(
59 ApplicationContext applicationContext,
60LocaleResolver resolver) {
61returnnewCachingLocaleUrlDefinitionDAO(applicationContext);
62 }
63 }