You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2022/11/27 08:24:47 UTC
[struts] 04/23: WW-5233 Copies Tiles Core related tests
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch WW-5233-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git
commit c77dcb53044faeff751d539d148eb15addefbf82
Author: Lukasz Lenart <lu...@apache.org>
AuthorDate: Sun Oct 2 12:58:25 2022 +0200
WW-5233 Copies Tiles Core related tests
---
bom/pom.xml | 4 +-
plugins/tiles/pom.xml | 5 +
.../main/java/org/apache/tiles/api/Attribute.java | 2 -
.../org/apache/tiles/api/AttributeContext.java | 2 -
.../apache/tiles/api/BasicAttributeContext.java | 2 -
.../main/java/org/apache/tiles/api/Definition.java | 2 -
.../main/java/org/apache/tiles/api/Expression.java | 2 -
.../java/org/apache/tiles/api/ListAttribute.java | 2 -
.../apache/tiles/api/NoSuchContainerException.java | 2 -
.../java/org/apache/tiles/api/TilesContainer.java | 2 -
.../apache/tiles/api/TilesContainerWrapper.java | 2 -
.../java/org/apache/tiles/api/TilesException.java | 2 -
.../org/apache/tiles/api/access/TilesAccess.java | 2 -
.../tiles/api/mgmt/MutableTilesContainer.java | 2 -
.../apache/tiles/api/preparer/ViewPreparer.java | 2 -
.../autotag/core/runtime/AbstractModelBody.java | 2 -
.../tiles/autotag/core/runtime/AutotagRuntime.java | 2 -
.../tiles/autotag/core/runtime/ModelBody.java | 2 -
.../autotag/core/runtime/annotation/Parameter.java | 2 -
.../core/runtime/annotation/package-info.java | 2 -
.../tiles/autotag/core/runtime/package-info.java | 2 -
.../autotag/core/runtime/util/NullWriter.java | 2 -
.../autotag/core/runtime/util/package-info.java | 2 -
.../apache/tiles/autotag/model/TemplateClass.java | 2 -
.../apache/tiles/autotag/model/TemplateMethod.java | 2 -
.../tiles/autotag/model/TemplateParameter.java | 2 -
.../apache/tiles/autotag/model/TemplateSuite.java | 2 -
.../apache/tiles/autotag/model/package-info.java | 2 -
.../tiles/core/definition/DefinitionsFactory.java | 2 -
.../definition/DefinitionsFactoryException.java | 2 -
.../tiles/core/definition/DefinitionsReader.java | 2 -
.../core/definition/NoSuchDefinitionException.java | 2 -
.../tiles/core/definition/RefreshMonitor.java | 2 -
.../UnresolvingLocaleDefinitionsFactory.java | 2 -
.../definition/dao/BaseLocaleUrlDefinitionDAO.java | 2 -
.../dao/CachingLocaleUrlDefinitionDAO.java | 5 +-
.../tiles/core/definition/dao/DefinitionDAO.java | 2 -
.../dao/ResolvingLocaleUrlDefinitionDAO.java | 2 -
.../tiles/core/definition/dao/package-info.java | 2 -
.../digester/DigesterDefinitionsReader.java | 2 -
.../DigesterDefinitionsReaderException.java | 2 -
.../core/definition/digester/package-info.java | 2 -
.../apache/tiles/core/definition/package-info.java | 2 -
.../pattern/AbstractPatternDefinitionResolver.java | 2 -
.../pattern/BasicPatternDefinitionResolver.java | 2 -
.../pattern/DefinitionPatternMatcher.java | 2 -
.../pattern/DefinitionPatternMatcherFactory.java | 2 -
.../pattern/PatternDefinitionResolver.java | 2 -
.../pattern/PatternDefinitionResolverAware.java | 2 -
.../core/definition/pattern/PatternRecognizer.java | 2 -
.../tiles/core/definition/pattern/PatternUtil.java | 2 -
.../pattern/PrefixedPatternDefinitionResolver.java | 2 -
.../core/definition/pattern/package-info.java | 2 -
.../regexp/RegexpDefinitionPatternMatcher.java | 2 -
.../RegexpDefinitionPatternMatcherFactory.java | 2 -
.../definition/pattern/regexp/package-info.java | 2 -
.../wildcard/WildcardDefinitionPatternMatcher.java | 2 -
.../WildcardDefinitionPatternMatcherFactory.java | 2 -
.../definition/pattern/wildcard/package-info.java | 2 -
.../core/evaluator/AbstractAttributeEvaluator.java | 2 -
.../tiles/core/evaluator/AttributeEvaluator.java | 2 -
.../core/evaluator/AttributeEvaluatorFactory.java | 2 -
.../evaluator/AttributeEvaluatorFactoryAware.java | 2 -
.../evaluator/BasicAttributeEvaluatorFactory.java | 2 -
.../tiles/core/evaluator/EvaluationException.java | 2 -
.../evaluator/impl/DirectAttributeEvaluator.java | 2 -
.../tiles/core/evaluator/impl/package-info.java | 2 -
.../apache/tiles/core/evaluator/package-info.java | 2 -
.../factory/AbstractTilesContainerFactory.java | 2 -
.../core/factory/BasicTilesContainerFactory.java | 2 -
.../factory/TilesContainerFactoryException.java | 2 -
.../apache/tiles/core/factory/package-info.java | 2 -
.../tiles/core/impl/BasicTilesContainer.java | 2 -
.../tiles/core/impl/InvalidTemplateException.java | 2 -
.../core/impl/mgmt/CachingTilesContainer.java | 2 -
.../apache/tiles/core/impl/mgmt/package-info.java | 2 -
.../org/apache/tiles/core/impl/package-info.java | 2 -
.../apache/tiles/core/locale/LocaleResolver.java | 2 -
.../core/locale/impl/DefaultLocaleResolver.java | 2 -
.../tiles/core/locale/impl/package-info.java | 2 -
.../org/apache/tiles/core/locale/package-info.java | 2 -
.../core/prepare/factory/BasicPreparerFactory.java | 2 -
.../prepare/factory/NoSuchPreparerException.java | 2 -
.../core/prepare/factory/PreparerFactory.java | 2 -
.../tiles/core/prepare/factory/package-info.java | 2 -
.../tiles/core/renderer/DefinitionRenderer.java | 2 -
.../apache/tiles/core/renderer/package-info.java | 2 -
.../core/startup/AbstractTilesInitializer.java | 2 -
.../tiles/core/startup/TilesInitializer.java | 2 -
.../apache/tiles/core/startup/package-info.java | 2 -
.../apache/tiles/core/util/CombinedBeanInfo.java | 2 -
.../org/apache/tiles/core/util/WildcardHelper.java | 2 -
.../org/apache/tiles/core/util/package-info.java | 2 -
.../org/apache/tiles/el/ELAttributeEvaluator.java | 2 -
.../java/org/apache/tiles/el/ELContextImpl.java | 2 -
.../apache/tiles/el/ExpressionFactoryFactory.java | 2 -
.../tiles/el/JspExpressionFactoryFactory.java | 2 -
.../java/org/apache/tiles/el/ScopeELResolver.java | 2 -
.../tiles/el/TilesContextBeanELResolver.java | 2 -
.../java/org/apache/tiles/el/package-info.java | 2 -
.../org/apache/tiles/freemarker/package-info.java | 2 -
.../tiles/ognl/AnyScopePropertyAccessor.java | 2 -
.../tiles/ognl/DelegatePropertyAccessor.java | 2 -
.../ognl/NestedObjectDelegatePropertyAccessor.java | 2 -
.../apache/tiles/ognl/NestedObjectExtractor.java | 2 -
.../apache/tiles/ognl/OGNLAttributeEvaluator.java | 2 -
.../ognl/PropertyAccessorDelegateFactory.java | 2 -
.../apache/tiles/ognl/ScopePropertyAccessor.java | 2 -
...lesApplicationContextNestedObjectExtractor.java | 2 -
...ilesContextPropertyAccessorDelegateFactory.java | 2 -
.../java/org/apache/tiles/ognl/package-info.java | 2 -
.../tiles/request/AbstractClientRequest.java | 2 -
.../org/apache/tiles/request/AbstractRequest.java | 2 -
.../apache/tiles/request/AbstractViewRequest.java | 2 -
.../apache/tiles/request/ApplicationAccess.java | 2 -
.../apache/tiles/request/ApplicationContext.java | 2 -
.../tiles/request/ApplicationContextAware.java | 2 -
.../apache/tiles/request/ApplicationResource.java | 2 -
.../org/apache/tiles/request/DispatchRequest.java | 2 -
.../tiles/request/DispatchRequestWrapper.java | 2 -
.../request/NotAvailableFeatureException.java | 2 -
.../java/org/apache/tiles/request/Request.java | 2 -
.../org/apache/tiles/request/RequestException.java | 2 -
.../org/apache/tiles/request/RequestWrapper.java | 2 -
.../apache/tiles/request/attribute/Addable.java | 2 -
.../request/attribute/AttributeExtractor.java | 2 -
.../attribute/EnumeratedValuesExtractor.java | 2 -
.../tiles/request/attribute/HasAddableKeys.java | 2 -
.../apache/tiles/request/attribute/HasKeys.java | 2 -
.../tiles/request/attribute/HasRemovableKeys.java | 2 -
.../tiles/request/attribute/package-info.java | 2 -
.../tiles/request/collection/CollectionUtil.java | 2 -
.../tiles/request/collection/HeaderValuesMap.java | 2 -
.../apache/tiles/request/collection/KeySet.java | 2 -
.../apache/tiles/request/collection/MapEntry.java | 2 -
.../request/collection/MapEntryArrayValues.java | 2 -
.../request/collection/ReadOnlyEnumerationMap.java | 2 -
.../tiles/request/collection/RemovableKeySet.java | 2 -
.../apache/tiles/request/collection/ScopeMap.java | 2 -
.../tiles/request/collection/package-info.java | 2 -
.../request/freemarker/EnvironmentScopeMap.java | 2 -
.../request/freemarker/FreemarkerRequest.java | 2 -
.../freemarker/FreemarkerRequestException.java | 2 -
.../request/freemarker/FreemarkerRequestUtil.java | 2 -
.../NotAvailableFreemarkerServletException.java | 2 -
.../autotag/FreemarkerAutotagException.java | 2 -
.../autotag/FreemarkerAutotagRuntime.java | 2 -
.../freemarker/autotag/FreemarkerModelBody.java | 2 -
.../request/freemarker/autotag/FreemarkerUtil.java | 2 -
.../request/freemarker/autotag/package-info.java | 2 -
.../extractor/EnvironmentScopeExtractor.java | 2 -
.../render/AttributeValueFreemarkerServlet.java | 2 -
.../freemarker/servlet/SharedVariableFactory.java | 2 -
.../SharedVariableLoaderFreemarkerServlet.java | 2 -
.../servlet/WebappClassTemplateLoader.java | 2 -
.../tiles/request/jsp/JspPrintWriterAdapter.java | 2 -
.../org/apache/tiles/request/jsp/JspRequest.java | 2 -
.../java/org/apache/tiles/request/jsp/JspUtil.java | 2 -
.../request/jsp/autotag/JspAutotagRuntime.java | 2 -
.../tiles/request/jsp/autotag/JspModelBody.java | 2 -
.../tiles/request/jsp/autotag/package-info.java | 2 -
.../request/jsp/extractor/ScopeExtractor.java | 2 -
.../jsp/extractor/SessionScopeExtractor.java | 2 -
.../apache/tiles/request/locale/LocaleUtil.java | 2 -
.../locale/PostfixedApplicationResource.java | 2 -
.../request/locale/URLApplicationResource.java | 2 -
.../reflect/CannotInstantiateObjectException.java | 2 -
.../apache/tiles/request/reflect/ClassUtil.java | 2 -
.../apache/tiles/request/reflect/package-info.java | 2 -
.../tiles/request/render/BasicRendererFactory.java | 2 -
.../request/render/CannotRenderException.java | 2 -
.../request/render/ChainedDelegateRenderer.java | 2 -
.../tiles/request/render/DispatchRenderer.java | 2 -
.../request/render/NoSuchRendererException.java | 2 -
.../tiles/request/render/RenderException.java | 2 -
.../org/apache/tiles/request/render/Renderer.java | 2 -
.../tiles/request/render/RendererFactory.java | 2 -
.../tiles/request/render/StringRenderer.java | 2 -
.../servlet/NotAServletEnvironmentException.java | 2 -
.../request/servlet/ServletApplicationContext.java | 2 -
.../tiles/request/servlet/ServletRequest.java | 2 -
.../apache/tiles/request/servlet/ServletUtil.java | 2 -
.../extractor/ApplicationScopeExtractor.java | 2 -
.../request/servlet/extractor/HeaderExtractor.java | 2 -
.../servlet/extractor/InitParameterExtractor.java | 2 -
.../servlet/extractor/ParameterExtractor.java | 2 -
.../servlet/extractor/RequestScopeExtractor.java | 2 -
.../servlet/extractor/SessionScopeExtractor.java | 2 -
.../tiles/template/AddListAttributeModel.java | 2 -
.../apache/tiles/template/AttributeResolver.java | 2 -
.../apache/tiles/template/ComposeStackUtil.java | 2 -
.../tiles/template/DefaultAttributeResolver.java | 2 -
.../org/apache/tiles/template/DefinitionModel.java | 2 -
.../apache/tiles/template/GetAsStringModel.java | 2 -
.../tiles/template/ImportAttributeModel.java | 2 -
.../tiles/template/InsertAttributeModel.java | 2 -
.../tiles/template/InsertDefinitionModel.java | 2 -
.../apache/tiles/template/InsertTemplateModel.java | 2 -
.../tiles/template/NoSuchAttributeException.java | 2 -
.../apache/tiles/template/PutAttributeModel.java | 2 -
.../tiles/template/PutListAttributeModel.java | 2 -
.../tiles/template/SetCurrentContainerModel.java | 2 -
.../tiles/web/jsp/taglib/UseAttributeTag.java | 2 -
.../apache/tiles/web/jsp/taglib/package-info.java | 2 -
.../tiles/web/startup/AbstractTilesListener.java | 2 -
.../tiles/web/util/AttributeContextMutator.java | 2 -
.../tiles/web/util/TilesDispatchServlet.java | 2 -
.../java/org/apache/tiles/api/AttributeTest.java | 2 -
.../tiles/api/BasicAttributeContextTest.java | 2 -
.../java/org/apache/tiles/api/ExpressionTest.java | 2 -
.../org/apache/tiles/api/ListAttributeTest.java | 2 -
.../tiles/api/NoSuchContainerExceptionTest.java | 2 -
.../java/org/apache/tiles/api/TestDefinition.java | 2 -
.../tiles/api/TilesContainerWrapperTest.java | 2 -
.../org/apache/tiles/api/TilesExceptionTest.java | 2 -
.../tiles/api/preparer/PreparerExceptionTest.java | 2 -
.../DefinitionsFactoryExceptionTest.java} | 32 +-
.../core/definition/MockDefinitionsReader.java} | 26 +-
.../definition/NoSuchDefinitionExceptionTest.java} | 15 +-
.../UnresolvingLocaleDefinitionsFactoryTest.java | 63 ++
.../dao/BaseLocaleUrlDefinitionDAOTest.java | 156 ++++
.../dao/CachingLocaleUrlDefinitionDAOTest.java | 371 +++++++++
.../dao/ResolvingLocaleUrlDefinitionDAOTest.java | 391 ++++++++++
.../DigesterDefinitionsReaderExceptionTest.java} | 16 +-
.../digester/TestDigesterDefinitionsReader.java | 279 +++++++
.../AbstractPatternDefinitionResolverTest.java | 119 +++
.../BasicPatternDefinitionResolverTest.java | 78 ++
.../core/definition/pattern/PatternUtilTest.java | 316 ++++++++
.../PrefixedPatternDefinitionResolverTest.java | 77 ++
...RegexpDefinitionPatternMatcherFactoryTest.java} | 29 +-
.../regexp/RegexpDefinitionPatternMatcherTest.java | 47 ++
...ildcardDefinitionPatternMatcherFactoryTest.java | 61 ++
.../WildcardDefinitionPatternMatcherTest.java | 53 ++
.../BasicAttributeEvaluatorFactoryTest.java | 85 +++
.../evaluator/EvaluatorExceptionTest.java} | 37 +-
.../impl/DirectAttributeEvaluatorTest.java | 84 +++
.../core/factory/BasicPreparerFactoryTest.java | 72 ++
.../factory/BasicTilesContainerFactoryTest.java | 252 +++++++
.../factory/NoSuchPreparerExceptionTest.java} | 16 +-
.../TilesContainerFactoryExceptionTest.java} | 19 +-
.../tiles/core/impl/BasicTilesContainerTest.java | 126 ++++
.../core/impl/BasicTilesContainerUnitTest.java | 836 +++++++++++++++++++++
.../impl/CannotRenderExceptionTest.java} | 38 +-
.../tiles/core/impl/DefaultLocaleResolverTest.java | 58 ++
.../impl/InvalidTemplateExceptionTest.java} | 37 +-
.../core/impl/mgmt/CachingTilesContainerTest.java | 305 ++++++++
.../core/renderer/DefinitionRendererTest.java | 106 +++
.../core/startup/AbstractTilesInitializerTest.java | 130 ++++
.../tiles/core/util/CombinedBeanInfoTest.java | 93 +++
.../apache/tiles/core/config/defs-tiles-513.xml | 48 ++
.../org/apache/tiles/core/config/defs-wildcard.xml | 62 ++
.../org/apache/tiles/core/config/defs1.xml | 75 ++
.../org/apache/tiles/core/config/defs1_en_US.xml | 45 ++
.../org/apache/tiles/core/config/defs1_fr.xml | 58 ++
.../org/apache/tiles/core/config/defs1_fr_CA.xml | 45 ++
.../org/apache/tiles/core/config/defs2.xml | 44 ++
.../org/apache/tiles/core/config/defs3.xml | 44 ++
.../core/config/defs_regression_TILES-352.xml} | 40 +-
.../org/apache/tiles/core/config/invalid-defs.xml | 44 ++
.../apache/tiles/core/config/malformed-defs.xml | 42 ++
.../org/apache/tiles/core/config/temp-defs.xml | 45 ++
.../apache/tiles/core/config/tiles-defs-2.1.xml | 88 +++
.../tiles/core/config/tiles-defs-2.1_it.xml} | 33 +-
.../org/apache/tiles/core/config/tiles-defs.xml | 143 ++++
.../tiles/core/factory/test-defs-key-one.xml} | 35 +-
.../tiles/core/factory/test-defs-key-two.xml} | 35 +-
.../org/apache/tiles/core/factory/test-defs.xml} | 35 +-
pom.xml | 6 +
268 files changed, 5151 insertions(+), 679 deletions(-)
diff --git a/bom/pom.xml b/bom/pom.xml
index f1db01489..40b3934a2 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -24,8 +24,8 @@
<parent>
<groupId>org.apache.struts</groupId>
- <artifactId>struts-master</artifactId>
- <version>14</version>
+ <artifactId>struts2-parent</artifactId>
+ <version>6.1.0-SNAPSHOT</version>
</parent>
<artifactId>struts2-bom</artifactId>
diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index 1ee16c1f6..c92bd571c 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -51,6 +51,11 @@
<artifactId>easymock</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jcl</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/Attribute.java b/plugins/tiles/src/main/java/org/apache/tiles/api/Attribute.java
index 5a2df3e32..c49f07a96 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/Attribute.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/Attribute.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java b/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
index 23e4fc124..24c4fa5fa 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/BasicAttributeContext.java b/plugins/tiles/src/main/java/org/apache/tiles/api/BasicAttributeContext.java
index 0c13933b8..8fdc5b8aa 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/BasicAttributeContext.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/BasicAttributeContext.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/Definition.java b/plugins/tiles/src/main/java/org/apache/tiles/api/Definition.java
index 85f1d9220..3cd217b1c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/Definition.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/Definition.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/Expression.java b/plugins/tiles/src/main/java/org/apache/tiles/api/Expression.java
index d96a9f154..6efe6ce1b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/Expression.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/Expression.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/ListAttribute.java b/plugins/tiles/src/main/java/org/apache/tiles/api/ListAttribute.java
index d618b66ec..3daeff4f5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/ListAttribute.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/ListAttribute.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java b/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
index 858db324d..6d6d19307 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainer.java b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainer.java
index 20199772d..00afe9dac 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainerWrapper.java b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainerWrapper.java
index 28687c194..e8707e34f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainerWrapper.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesContainerWrapper.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesException.java b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesException.java
index 77088c3d5..520c24419 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/TilesException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/TilesException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/access/TilesAccess.java b/plugins/tiles/src/main/java/org/apache/tiles/api/access/TilesAccess.java
index cdfaa753e..81cf48864 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/access/TilesAccess.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/access/TilesAccess.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/mgmt/MutableTilesContainer.java b/plugins/tiles/src/main/java/org/apache/tiles/api/mgmt/MutableTilesContainer.java
index 6e8765cc2..5348f239c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/mgmt/MutableTilesContainer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/mgmt/MutableTilesContainer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/preparer/ViewPreparer.java b/plugins/tiles/src/main/java/org/apache/tiles/api/preparer/ViewPreparer.java
index 14bd08308..94527a45b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/preparer/ViewPreparer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/preparer/ViewPreparer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AbstractModelBody.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AbstractModelBody.java
index 3e3f1ede7..1054f338a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AbstractModelBody.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AbstractModelBody.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AutotagRuntime.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AutotagRuntime.java
index 4d5c818d7..f95e39d77 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AutotagRuntime.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/AutotagRuntime.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/ModelBody.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/ModelBody.java
index 81178eedd..feedca8c8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/ModelBody.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/ModelBody.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/Parameter.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/Parameter.java
index 6f9c99b8c..1c6373f7f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/Parameter.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/Parameter.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/package-info.java
index 261b48ebd..2b68de79d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/annotation/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/package-info.java
index 1e8324a66..8d7b72483 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/NullWriter.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/NullWriter.java
index 6a66fb3a3..76a19b6b4 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/NullWriter.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/NullWriter.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/package-info.java
index 7f2e35629..76efc98f1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/runtime/util/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateClass.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateClass.java
index f869c9526..f130fa9d1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateClass.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateClass.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateMethod.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateMethod.java
index d5703c54e..2390c2119 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateMethod.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateMethod.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateParameter.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateParameter.java
index 360e019ee..ab4e8dc58 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateParameter.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateParameter.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateSuite.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateSuite.java
index 25361c866..ff96b9eda 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateSuite.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/TemplateSuite.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/package-info.java
index a1130d2aa..7eddcd1f5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/model/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactory.java
index 150d66294..a7165a981 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactoryException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactoryException.java
index cc7468e3f..3d07b20bb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactoryException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsFactoryException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java
index 3369f6aa0..39d61a52b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/NoSuchDefinitionException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/NoSuchDefinitionException.java
index 460dcd78b..aa78661bd 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/NoSuchDefinitionException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/NoSuchDefinitionException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/RefreshMonitor.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/RefreshMonitor.java
index bcd5569d9..d5f62d8d2 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/RefreshMonitor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/RefreshMonitor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactory.java
index 4fac31f71..ca69310f4 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAO.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAO.java
index d5766fc7d..45aa73840 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAO.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAO.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAO.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAO.java
index 84c44f949..b280fc97b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAO.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAO.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -223,8 +221,7 @@ public class CachingLocaleUrlDefinitionDAO extends BaseLocaleUrlDefinitionDAO im
* @return The loaded definitions.
* @since 2.1.3
*/
- protected Map<String, Definition> loadRawDefinitionsFromResources(
- Locale customizationKey) {
+ protected Map<String, Definition> loadRawDefinitionsFromResources(Locale customizationKey) {
Map<String, Definition> localeDefsMap;
Locale parentLocale = LocaleUtil.getParentLocale(customizationKey);
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
index e42772fe6..45358a25a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAO.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAO.java
index df7eef304..d6af2f87b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAO.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAO.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/package-info.java
index 225d581ba..93cee8617 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReader.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReader.java
index 9fd3700f0..b751c5607 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReader.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReader.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java
index cd9c1c6c5..0aeb324bc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/package-info.java
index f76e46d68..49764f7cc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/package-info.java
index 2e570e061..1dc51fc77 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolver.java
index dae01776f..a960ec9bf 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolver.java
index a2d5fbed7..541805c23 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcher.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcher.java
index 59461af25..8e913bca1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcher.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcher.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcherFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcherFactory.java
index 454dada62..d58858a50 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcherFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/DefinitionPatternMatcherFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
index 07c78157d..0e3d397a3 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolverAware.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolverAware.java
index 790a64e8c..e91945973 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolverAware.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolverAware.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternRecognizer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternRecognizer.java
index 3ae899f9e..0f3b23e66 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternRecognizer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternRecognizer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternUtil.java
index d7894b922..6d3dc39bc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
index f50f4498b..42095e43f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/package-info.java
index 13c53ec83..d23eb0cad 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcher.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcher.java
index b575c2a27..f060d69a5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcher.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcher.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java
index 3cbffaf99..77ae96c16 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/package-info.java
index 15389afdb..dd679897a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcher.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcher.java
index fe2d54349..265047159 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcher.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcher.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactory.java
index 0804a9d21..34c1c793c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/package-info.java
index dfbb05225..2b7f1231e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/wildcard/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AbstractAttributeEvaluator.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AbstractAttributeEvaluator.java
index 702ba5a6d..b035a0bbc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AbstractAttributeEvaluator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AbstractAttributeEvaluator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluator.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluator.java
index 93feb168a..487c306c4 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactory.java
index efac52ed4..56725d065 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactoryAware.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactoryAware.java
index 9e472c555..f7dee1eec 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactoryAware.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/AttributeEvaluatorFactoryAware.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactory.java
index e6f8a47b4..7f87dc38d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/EvaluationException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/EvaluationException.java
index 7f5cb9c80..f5073706f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/EvaluationException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/EvaluationException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluator.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluator.java
index 35157812d..7900872ac 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/package-info.java
index 40bc521ec..c8b19297c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/impl/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/package-info.java
index da5b4bc26..2285788b6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/evaluator/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/AbstractTilesContainerFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/AbstractTilesContainerFactory.java
index fc5ca1f17..c64a30931 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/AbstractTilesContainerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/AbstractTilesContainerFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/BasicTilesContainerFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/BasicTilesContainerFactory.java
index 311172e28..7a424d31c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/BasicTilesContainerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/BasicTilesContainerFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/TilesContainerFactoryException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/TilesContainerFactoryException.java
index 24d927788..8f1bdd4e5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/TilesContainerFactoryException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/TilesContainerFactoryException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/package-info.java
index c305b60c7..a9848e865 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/factory/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/factory/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/BasicTilesContainer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/BasicTilesContainer.java
index 400c3bc44..922d01613 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/BasicTilesContainer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/BasicTilesContainer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/InvalidTemplateException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/InvalidTemplateException.java
index 51c46b215..7b95722ff 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/InvalidTemplateException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/InvalidTemplateException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainer.java
index 40e64c906..0a18c7333 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/package-info.java
index ad44a742f..e63fbe3fb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/mgmt/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/package-info.java
index 638599c00..7b89ff86e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/impl/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/impl/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/LocaleResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/LocaleResolver.java
index e377fa8d6..de73dc17e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/LocaleResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/LocaleResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/DefaultLocaleResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/DefaultLocaleResolver.java
index b592978a0..57d63b597 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/DefaultLocaleResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/DefaultLocaleResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/package-info.java
index 93b2f96fb..d8bb3d6bc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/impl/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/package-info.java
index aeed07e6b..0470b39df 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/locale/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/locale/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/BasicPreparerFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/BasicPreparerFactory.java
index 75c5fc8e6..b28151da2 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/BasicPreparerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/BasicPreparerFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/NoSuchPreparerException.java b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/NoSuchPreparerException.java
index 1430264ee..1d4b50282 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/NoSuchPreparerException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/NoSuchPreparerException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/PreparerFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/PreparerFactory.java
index 9e80c572b..073ab3fb6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/PreparerFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/PreparerFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/package-info.java
index f249ccdff..c228befe8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/prepare/factory/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/DefinitionRenderer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/DefinitionRenderer.java
index 976bf87da..9becc6e43 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/DefinitionRenderer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/DefinitionRenderer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/package-info.java
index 2485d3c31..089580e86 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/renderer/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/AbstractTilesInitializer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/AbstractTilesInitializer.java
index a74d4bb30..012665bf0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/AbstractTilesInitializer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/AbstractTilesInitializer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/TilesInitializer.java b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/TilesInitializer.java
index 55d0292b3..d9bfc0f6e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/TilesInitializer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/TilesInitializer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/package-info.java
index 3410efe1d..3c06d86e3 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/startup/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/startup/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/util/CombinedBeanInfo.java b/plugins/tiles/src/main/java/org/apache/tiles/core/util/CombinedBeanInfo.java
index 9854897a4..425a3d7bf 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/util/CombinedBeanInfo.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/util/CombinedBeanInfo.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/util/WildcardHelper.java b/plugins/tiles/src/main/java/org/apache/tiles/core/util/WildcardHelper.java
index 09c176144..35f54a064 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/util/WildcardHelper.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/util/WildcardHelper.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/util/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/core/util/package-info.java
index c6e6a4c68..9d03dc0e5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/util/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/util/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/ELAttributeEvaluator.java b/plugins/tiles/src/main/java/org/apache/tiles/el/ELAttributeEvaluator.java
index 14f2e3e54..cfa68da8a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/ELAttributeEvaluator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/ELAttributeEvaluator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/ELContextImpl.java b/plugins/tiles/src/main/java/org/apache/tiles/el/ELContextImpl.java
index 7b62dd48a..8e162ae40 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/ELContextImpl.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/ELContextImpl.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/ExpressionFactoryFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/el/ExpressionFactoryFactory.java
index 99a99f81a..f19a9e0e8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/ExpressionFactoryFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/ExpressionFactoryFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/JspExpressionFactoryFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/el/JspExpressionFactoryFactory.java
index 3b822cef1..5b9bd108b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/JspExpressionFactoryFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/JspExpressionFactoryFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/ScopeELResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/el/ScopeELResolver.java
index bd304f1fc..8086e113a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/ScopeELResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/ScopeELResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/TilesContextBeanELResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/el/TilesContextBeanELResolver.java
index d69432fe9..117b4e614 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/TilesContextBeanELResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/TilesContextBeanELResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/el/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/el/package-info.java
index 01731df4c..f1886e81f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/el/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/el/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/freemarker/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/freemarker/package-info.java
index c64cec92f..7f77267d6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/freemarker/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/freemarker/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/AnyScopePropertyAccessor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/AnyScopePropertyAccessor.java
index 2f3d6d6cf..aca95ce5f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/AnyScopePropertyAccessor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/AnyScopePropertyAccessor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/DelegatePropertyAccessor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/DelegatePropertyAccessor.java
index c23d2fd93..637823a9b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/DelegatePropertyAccessor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/DelegatePropertyAccessor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectDelegatePropertyAccessor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectDelegatePropertyAccessor.java
index 323f53169..dbafb66c7 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectDelegatePropertyAccessor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectDelegatePropertyAccessor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectExtractor.java
index c11d19968..ba994d31b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/NestedObjectExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/OGNLAttributeEvaluator.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/OGNLAttributeEvaluator.java
index 6f10d7f61..cac54fdcb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/OGNLAttributeEvaluator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/OGNLAttributeEvaluator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/PropertyAccessorDelegateFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/PropertyAccessorDelegateFactory.java
index 741e3f3ba..b781b402a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/PropertyAccessorDelegateFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/PropertyAccessorDelegateFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/ScopePropertyAccessor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/ScopePropertyAccessor.java
index ea4841b23..bb45085b6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/ScopePropertyAccessor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/ScopePropertyAccessor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesApplicationContextNestedObjectExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesApplicationContextNestedObjectExtractor.java
index 41ac16bae..60f4321af 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesApplicationContextNestedObjectExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesApplicationContextNestedObjectExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesContextPropertyAccessorDelegateFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesContextPropertyAccessorDelegateFactory.java
index 4c3431e86..5106f656a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesContextPropertyAccessorDelegateFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/TilesContextPropertyAccessorDelegateFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/ognl/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/ognl/package-info.java
index 116082cdd..69d74a282 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/ognl/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/ognl/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractClientRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractClientRequest.java
index b013c11d1..459c54c1b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractClientRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractClientRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractRequest.java
index cbc7454ad..7fd52d9c6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractViewRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractViewRequest.java
index ae118f929..9cd74cd74 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractViewRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/AbstractViewRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationAccess.java b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationAccess.java
index 726b19ef3..35a1d29ed 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationAccess.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationAccess.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContext.java b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContext.java
index 67300e108..d45d90720 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContext.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContext.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContextAware.java b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContextAware.java
index 9eff28c21..5775c72e9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContextAware.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationContextAware.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationResource.java b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationResource.java
index d2adddfa6..cf868e888 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationResource.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/ApplicationResource.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequest.java
index 52b9bba20..30d208ca0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequestWrapper.java b/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequestWrapper.java
index 460500504..cc2ca6a1e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequestWrapper.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/DispatchRequestWrapper.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/NotAvailableFeatureException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/NotAvailableFeatureException.java
index 3c78faf9c..ded24acd9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/NotAvailableFeatureException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/NotAvailableFeatureException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/Request.java b/plugins/tiles/src/main/java/org/apache/tiles/request/Request.java
index acfd2158f..9a1709f15 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/Request.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/Request.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/RequestException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/RequestException.java
index ddabff9ed..192dff6b7 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/RequestException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/RequestException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/RequestWrapper.java b/plugins/tiles/src/main/java/org/apache/tiles/request/RequestWrapper.java
index 2477e0eb7..a9826d369 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/RequestWrapper.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/RequestWrapper.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/Addable.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/Addable.java
index e827b21a2..0a6178a56 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/Addable.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/Addable.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/AttributeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/AttributeExtractor.java
index be61940f0..b855123f7 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/AttributeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/AttributeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/EnumeratedValuesExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/EnumeratedValuesExtractor.java
index 0a252cb88..13240b044 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/EnumeratedValuesExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/EnumeratedValuesExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasAddableKeys.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasAddableKeys.java
index d8e399a42..1bff1f2c5 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasAddableKeys.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasAddableKeys.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasKeys.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasKeys.java
index 9f88ee1bd..692cf61cb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasKeys.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasKeys.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasRemovableKeys.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasRemovableKeys.java
index 30b368d10..4cb31e317 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasRemovableKeys.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/HasRemovableKeys.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/package-info.java
index 0eebcc13a..054b0e4f9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/attribute/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/CollectionUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/CollectionUtil.java
index 54fa91aa1..54cc254a6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/CollectionUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/CollectionUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/HeaderValuesMap.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/HeaderValuesMap.java
index 53f6e14d5..6c91895ad 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/HeaderValuesMap.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/HeaderValuesMap.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/KeySet.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/KeySet.java
index 62ecfedb1..e89d60bdc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/KeySet.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/KeySet.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntry.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntry.java
index 38b930cb0..58e590816 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntry.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntry.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntryArrayValues.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntryArrayValues.java
index 21aeb131b..c9aff7fd3 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntryArrayValues.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/MapEntryArrayValues.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ReadOnlyEnumerationMap.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ReadOnlyEnumerationMap.java
index 3ab475eae..85c17b656 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ReadOnlyEnumerationMap.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ReadOnlyEnumerationMap.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/RemovableKeySet.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/RemovableKeySet.java
index feaefa568..1ce23f66b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/RemovableKeySet.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/RemovableKeySet.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ScopeMap.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ScopeMap.java
index de1d99a6b..a03ec1f3b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ScopeMap.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/ScopeMap.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/package-info.java
index cfd47eb8e..e236964a8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/collection/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/collection/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/EnvironmentScopeMap.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/EnvironmentScopeMap.java
index 540a9d562..e55c38582 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/EnvironmentScopeMap.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/EnvironmentScopeMap.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequest.java
index d23b72608..cd82fccb0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestException.java
index 9b11d8591..a03ae300e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestUtil.java
index 366dd24b7..6c43f231e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/FreemarkerRequestUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/NotAvailableFreemarkerServletException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/NotAvailableFreemarkerServletException.java
index e35a3294d..13c5dd0f8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/NotAvailableFreemarkerServletException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/NotAvailableFreemarkerServletException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagException.java
index 467d0c0d4..dfd95cd06 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagRuntime.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagRuntime.java
index a0188ea8e..9fe1a7de6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagRuntime.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerAutotagRuntime.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerModelBody.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerModelBody.java
index 78ecb1305..85f52b7e3 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerModelBody.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerModelBody.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerUtil.java
index 6eb862f53..37362edc3 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/FreemarkerUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/package-info.java
index fb875dca7..af78d7b2d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/autotag/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/extractor/EnvironmentScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/extractor/EnvironmentScopeExtractor.java
index 2ea117035..e7ce577d6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/extractor/EnvironmentScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/extractor/EnvironmentScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/render/AttributeValueFreemarkerServlet.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/render/AttributeValueFreemarkerServlet.java
index 47cd991c4..8162c815d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/render/AttributeValueFreemarkerServlet.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/render/AttributeValueFreemarkerServlet.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableFactory.java
index 788b0fbc7..18642640d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableLoaderFreemarkerServlet.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableLoaderFreemarkerServlet.java
index 340d5ed54..8cec74b1f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableLoaderFreemarkerServlet.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/SharedVariableLoaderFreemarkerServlet.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/WebappClassTemplateLoader.java b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/WebappClassTemplateLoader.java
index b66e625d7..ce5629fa7 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/WebappClassTemplateLoader.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/freemarker/servlet/WebappClassTemplateLoader.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspPrintWriterAdapter.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspPrintWriterAdapter.java
index 2a8778336..81c6e579f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspPrintWriterAdapter.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspPrintWriterAdapter.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspRequest.java
index f338235de..7e94e331e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspUtil.java
index e282d6053..0a79145a0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/JspUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspAutotagRuntime.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspAutotagRuntime.java
index 9c2922fb3..ac15efa7e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspAutotagRuntime.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspAutotagRuntime.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspModelBody.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspModelBody.java
index 683eff38e..ad9721575 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspModelBody.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/JspModelBody.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/package-info.java
index 08adc1ba4..ce77fc427 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/autotag/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/ScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/ScopeExtractor.java
index ab90f3488..e3485226a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/ScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/ScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/SessionScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/SessionScopeExtractor.java
index 22099903c..73eec8df1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/SessionScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/jsp/extractor/SessionScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/LocaleUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/LocaleUtil.java
index 2b5fd4d53..0b3650480 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/LocaleUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/LocaleUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/PostfixedApplicationResource.java b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/PostfixedApplicationResource.java
index 4f854b5e3..85c44745b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/PostfixedApplicationResource.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/PostfixedApplicationResource.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/URLApplicationResource.java b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/URLApplicationResource.java
index f648945bf..8f867b7fb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/locale/URLApplicationResource.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/locale/URLApplicationResource.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/CannotInstantiateObjectException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/CannotInstantiateObjectException.java
index 067c73149..953ae68c4 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/CannotInstantiateObjectException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/CannotInstantiateObjectException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/ClassUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/ClassUtil.java
index 60d9b6ca9..8211b3ac6 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/ClassUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/ClassUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/package-info.java
index 299c145d3..c7b0d3cdc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/reflect/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/BasicRendererFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/BasicRendererFactory.java
index 899e2d7b9..eb6b00fdf 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/BasicRendererFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/BasicRendererFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/CannotRenderException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/CannotRenderException.java
index 6c246ebf2..d2c5e39f8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/CannotRenderException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/CannotRenderException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/ChainedDelegateRenderer.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/ChainedDelegateRenderer.java
index 71abc2c59..ff0bdc136 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/ChainedDelegateRenderer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/ChainedDelegateRenderer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/DispatchRenderer.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/DispatchRenderer.java
index 49a661eed..fa5b78749 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/DispatchRenderer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/DispatchRenderer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/NoSuchRendererException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/NoSuchRendererException.java
index 2f59a9ead..f3a71983f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/NoSuchRendererException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/NoSuchRendererException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/RenderException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/RenderException.java
index e159bfa8a..f99ee6024 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/RenderException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/RenderException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/Renderer.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/Renderer.java
index 8349507ba..076837240 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/Renderer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/Renderer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/RendererFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/RendererFactory.java
index 4b4bec1a5..7119d6455 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/RendererFactory.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/RendererFactory.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/render/StringRenderer.java b/plugins/tiles/src/main/java/org/apache/tiles/request/render/StringRenderer.java
index 1b10e380e..309546a2f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/render/StringRenderer.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/render/StringRenderer.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/NotAServletEnvironmentException.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/NotAServletEnvironmentException.java
index a9830c5d3..ce4bf5471 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/NotAServletEnvironmentException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/NotAServletEnvironmentException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletApplicationContext.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletApplicationContext.java
index 540dec593..27f2b0e63 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletApplicationContext.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletApplicationContext.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletRequest.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletRequest.java
index 0a62722cd..a21a025d4 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletRequest.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletRequest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletUtil.java
index 71c6fee29..0646774b0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/ServletUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ApplicationScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ApplicationScopeExtractor.java
index 178cbcdde..52af00a9c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ApplicationScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ApplicationScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/HeaderExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/HeaderExtractor.java
index 56cb68686..e7c366238 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/HeaderExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/HeaderExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/InitParameterExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/InitParameterExtractor.java
index bfaedd43f..6c67aaed9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/InitParameterExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/InitParameterExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ParameterExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ParameterExtractor.java
index 4e1e69c8b..6925d253f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ParameterExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/ParameterExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/RequestScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/RequestScopeExtractor.java
index dbac85608..8bb3682e8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/RequestScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/RequestScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/SessionScopeExtractor.java b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/SessionScopeExtractor.java
index 008dcb671..3753d9f2b 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/SessionScopeExtractor.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/request/servlet/extractor/SessionScopeExtractor.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/AddListAttributeModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/AddListAttributeModel.java
index fac35511c..09e7433c1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/AddListAttributeModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/AddListAttributeModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/AttributeResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/template/AttributeResolver.java
index 82f3dd9de..786e258f8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/AttributeResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/AttributeResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/ComposeStackUtil.java b/plugins/tiles/src/main/java/org/apache/tiles/template/ComposeStackUtil.java
index b425ac629..0b255e58e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/ComposeStackUtil.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/ComposeStackUtil.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/DefaultAttributeResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/template/DefaultAttributeResolver.java
index b3464ef4f..c1ee10ae1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/DefaultAttributeResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/DefaultAttributeResolver.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/DefinitionModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/DefinitionModel.java
index 760c33947..7302d2ea1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/DefinitionModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/DefinitionModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/GetAsStringModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/GetAsStringModel.java
index c292aece9..b2d7db437 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/GetAsStringModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/GetAsStringModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/ImportAttributeModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/ImportAttributeModel.java
index 05f3a2f3b..ecf07bf7e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/ImportAttributeModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/ImportAttributeModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertAttributeModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertAttributeModel.java
index a84ed4221..2ee9bb396 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertAttributeModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertAttributeModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertDefinitionModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertDefinitionModel.java
index 113977891..cff71b65f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertDefinitionModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertDefinitionModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertTemplateModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertTemplateModel.java
index bf80c73c5..0856e24d8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/InsertTemplateModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/InsertTemplateModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java b/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java
index aaab7652c..5de6b0f18 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/PutAttributeModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/PutAttributeModel.java
index c83ff1d13..9391f14bf 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/PutAttributeModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/PutAttributeModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/PutListAttributeModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/PutListAttributeModel.java
index c61e0213f..30e858802 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/PutListAttributeModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/PutListAttributeModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/SetCurrentContainerModel.java b/plugins/tiles/src/main/java/org/apache/tiles/template/SetCurrentContainerModel.java
index 90412570e..80b7174ed 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/SetCurrentContainerModel.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/template/SetCurrentContainerModel.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/UseAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/UseAttributeTag.java
index 21e17f2f6..0262029d8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/UseAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/UseAttributeTag.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/package-info.java
index f20836b6e..c40a0a955 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/package-info.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/package-info.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/startup/AbstractTilesListener.java b/plugins/tiles/src/main/java/org/apache/tiles/web/startup/AbstractTilesListener.java
index f6f363d0e..465431b06 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/startup/AbstractTilesListener.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/startup/AbstractTilesListener.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/util/AttributeContextMutator.java b/plugins/tiles/src/main/java/org/apache/tiles/web/util/AttributeContextMutator.java
index b73e94bad..aa99ca099 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/util/AttributeContextMutator.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/util/AttributeContextMutator.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java b/plugins/tiles/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java
index 67142ad40..d456848c8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/util/TilesDispatchServlet.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/AttributeTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/AttributeTest.java
index d081e5634..875431c6f 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/AttributeTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/AttributeTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/BasicAttributeContextTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/BasicAttributeContextTest.java
index 23f021491..8b60953b5 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/BasicAttributeContextTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/BasicAttributeContextTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/ExpressionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/ExpressionTest.java
index 2aa091fdd..6c2d618b1 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/ExpressionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/ExpressionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/ListAttributeTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/ListAttributeTest.java
index 1bff6eb93..582f041e8 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/ListAttributeTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/ListAttributeTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
index 777ecd57c..7634873b8 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TestDefinition.java b/plugins/tiles/src/test/java/org/apache/tiles/api/TestDefinition.java
index 2da936a3b..520fd997c 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TestDefinition.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/TestDefinition.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesContainerWrapperTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/TilesContainerWrapperTest.java
index c7a6f49c0..c4a3bb919 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesContainerWrapperTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/TilesContainerWrapperTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
index fc26afeb0..cb6b8012b 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java
index 61700f0b2..35cbc3bbb 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/DefinitionsFactoryExceptionTest.java
similarity index 57%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/definition/DefinitionsFactoryExceptionTest.java
index 61700f0b2..c9f4d5bd2 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/preparer/PreparerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/DefinitionsFactoryExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,7 +17,7 @@
* under the License.
*/
-package org.apache.tiles.api.preparer;
+package org.apache.tiles.core.definition;
import org.junit.Test;
@@ -27,48 +25,48 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link PreparerException}.
+ * Tests {@link DefinitionsFactoryException}.
*/
-public class PreparerExceptionTest {
+public class DefinitionsFactoryExceptionTest {
/**
- * Test method for {@link PreparerException#PreparerException()}.
+ * Test method for {@link DefinitionsFactoryException#DefinitionsFactoryException()}.
*/
@Test
- public void testPreparerException() {
- PreparerException exception = new PreparerException();
+ public void testDefinitionsFactoryException() {
+ DefinitionsFactoryException exception = new DefinitionsFactoryException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
}
/**
- * Test method for {@link PreparerException#PreparerException(String)}.
+ * Test method for {@link DefinitionsFactoryException#DefinitionsFactoryException(String)}.
*/
@Test
- public void testPreparerExceptionString() {
- PreparerException exception = new PreparerException("my message");
+ public void testDefinitionsFactoryExceptionString() {
+ DefinitionsFactoryException exception = new DefinitionsFactoryException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
/**
- * Test method for {@link PreparerException#PreparerException(Throwable)}.
+ * Test method for {@link DefinitionsFactoryException#DefinitionsFactoryException(Throwable)}.
*/
@Test
- public void testPreparerExceptionThrowable() {
+ public void testDefinitionsFactoryExceptionThrowable() {
Throwable cause = new Throwable();
- PreparerException exception = new PreparerException(cause);
+ DefinitionsFactoryException exception = new DefinitionsFactoryException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
}
/**
- * Test method for {@link PreparerException#PreparerException(String, Throwable)}.
+ * Test method for {@link DefinitionsFactoryException#DefinitionsFactoryException(String, Throwable)}.
*/
@Test
- public void testPreparerExceptionStringThrowable() {
+ public void testDefinitionsFactoryExceptionStringThrowable() {
Throwable cause = new Throwable();
- PreparerException exception = new PreparerException("my message", cause);
+ DefinitionsFactoryException exception = new DefinitionsFactoryException("my message", cause);
assertEquals("my message", exception.getMessage());
assertEquals(cause, exception.getCause());
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/MockDefinitionsReader.java
similarity index 59%
copy from plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/definition/MockDefinitionsReader.java
index 3369f6aa0..865e2230f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/DefinitionsReader.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/MockDefinitionsReader.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,37 +16,29 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.tiles.core.definition;
import org.apache.tiles.api.Definition;
+import java.util.LinkedHashMap;
import java.util.Map;
/**
- * Interface for reading <code>{@link Definition}</code> from a source.
- * <p/>
- * <p>This interface provides a standard way to read
- * <code>{@link Definition}</code> objects from a source. Implementations
- * should define what the source is, whether it be a persistent store such as a
- * configuration file or database, or something like a web service. The
- * DefinitionsReader is responsible for reading from a single location. It does
- * not perform any internationalization duties or inheritance of Definitions.
- * It only reads from the source and returns a Map of objects read.</p>
+ * Mock Definitions Reader implementation. Stubs out all functionality.
*/
-public interface DefinitionsReader {
+public class MockDefinitionsReader implements DefinitionsReader {
/**
* Reads <code>{@link Definition}</code> objects from a source.
- * <p/>
* Implementations should publish what type of source object is expected.
*
* @param source The source from which definitions will be read.
* @return a Map of <code>Definition</code> objects read from
* the source.
- * @throws DefinitionsFactoryException if the source is invalid or
- * an error occurs when reading definitions.
+ * @throws org.apache.tiles.core.definition.DefinitionsFactoryException if the source is invalid or
+ * an error occurs when reading definitions.
*/
- Map<String, Definition> read(Object source);
-
+ public Map<String, Definition> read(Object source) {
+ return new LinkedHashMap<>();
+ }
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/NoSuchDefinitionExceptionTest.java
similarity index 73%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/definition/NoSuchDefinitionExceptionTest.java
index 777ecd57c..9e2c2faab 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/NoSuchDefinitionExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,7 +17,7 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.definition;
import org.junit.Test;
@@ -27,13 +25,16 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link NoSuchContainerException}.
+ * Tests {@link NoSuchDefinitionException}.
*/
-public class NoSuchContainerExceptionTest {
+public class NoSuchDefinitionExceptionTest {
+ /**
+ * Test method for {@link NoSuchDefinitionException#NoSuchDefinitionException(String)}.
+ */
@Test
- public void testNoSuchContainerExceptionString() {
- NoSuchContainerException exception = new NoSuchContainerException("my message");
+ public void testNoSuchDefinitionExceptionString() {
+ NoSuchDefinitionException exception = new NoSuchDefinitionException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactoryTest.java
new file mode 100644
index 000000000..1d136589f
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/UnresolvingLocaleDefinitionsFactoryTest.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition;
+
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.core.definition.dao.DefinitionDAO;
+import org.apache.tiles.core.locale.LocaleResolver;
+import org.apache.tiles.request.Request;
+import org.junit.Test;
+
+import java.util.Locale;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link UnresolvingLocaleDefinitionsFactory}.
+ */
+public class UnresolvingLocaleDefinitionsFactoryTest {
+
+ /**
+ * Test method for {@link UnresolvingLocaleDefinitionsFactory#getDefinition(String, Request)}.
+ */
+ @Test
+ public void testGetDefinition() {
+ DefinitionDAO<Locale> dao = createMock(DefinitionDAO.class);
+ LocaleResolver localeResolver = createMock(LocaleResolver.class);
+ UnresolvingLocaleDefinitionsFactory factory = new UnresolvingLocaleDefinitionsFactory();
+ Request request = createMock(Request.class);
+ Definition definition = createMock(Definition.class);
+ Locale locale = Locale.ITALY;
+
+ expect(localeResolver.resolveLocale(request)).andReturn(locale);
+ expect(dao.getDefinition("myDefinition", locale)).andReturn(definition);
+
+ replay(dao, localeResolver, request, definition);
+ factory.setDefinitionDAO(dao);
+ factory.setLocaleResolver(localeResolver);
+ assertEquals(definition, factory.getDefinition("myDefinition", request));
+ verify(dao, localeResolver, request, definition);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAOTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAOTest.java
new file mode 100644
index 000000000..77dc4fba9
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/BaseLocaleUrlDefinitionDAOTest.java
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.definition.dao;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.core.definition.DefinitionsReader;
+import org.apache.tiles.core.definition.RefreshMonitor;
+import org.apache.tiles.core.definition.digester.DigesterDefinitionsReader;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.locale.PostfixedApplicationResource;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.createMockBuilder;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests {@link BaseLocaleUrlDefinitionDAO}.
+ */
+public class BaseLocaleUrlDefinitionDAOTest {
+
+ private static final class MutableApplicationResource extends PostfixedApplicationResource {
+ private long lastModified = System.currentTimeMillis();
+ private String xml = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"
+ + "<!DOCTYPE tiles-definitions PUBLIC "
+ + "\"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN\" "
+ + "\"http://tiles.apache.org/dtds/tiles-config_3_0.dtd\">\n\n" + "<tiles-definitions>"
+ + "<definition name=\"rewrite.test\" template=\"/test.jsp\">"
+ + "<put-attribute name=\"testparm\" value=\"testval\"/>" + "</definition>" //
+ + "</tiles-definitions>";
+
+ private MutableApplicationResource(String localePath) {
+ super(localePath);
+ }
+
+ public void modify(String xml) {
+ lastModified = System.currentTimeMillis();
+ this.xml = xml;
+ }
+
+ @Override
+ public long getLastModified() {
+ return lastModified;
+ }
+
+ @Override
+ public InputStream getInputStream() throws IOException {
+ return new ByteArrayInputStream(xml.getBytes(StandardCharsets.ISO_8859_1));
+ }
+ }
+
+ /**
+ * The time (in milliseconds) to wait to be sure that the system updates the
+ * modify date of a file.
+ */
+ private static final int SLEEP_MILLIS = 2000;
+
+ private BaseLocaleUrlDefinitionDAO dao;
+ private MutableApplicationResource resource;
+
+ @Before
+ public void setUp() throws IOException {
+ resource = new MutableApplicationResource("org/apache/tiles/core/config/temp-defs.xml");
+
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ expect(applicationContext.getResource("org/apache/tiles/core/config/temp-defs.xml")).andReturn(resource).anyTimes();
+ replay(applicationContext);
+ dao = createMockBuilder(BaseLocaleUrlDefinitionDAO.class).withConstructor(applicationContext).createMock();
+ }
+
+ /**
+ * Test method for {@link org.apache.tiles.core.definition.dao.BaseLocaleUrlDefinitionDAO#refreshRequired()}.
+ *
+ * @throws InterruptedException If something goes wrong.
+ */
+ @Test
+ public void testRefreshRequired() throws InterruptedException {
+ // Set up multiple data sources.
+ Map<String, Attribute> attribs = new HashMap<>();
+ attribs.put("testparm", new Attribute("testval"));
+ Definition rewriteTest = new Definition("rewrite.test", Attribute.createTemplateAttribute("/test.jsp"), attribs);
+ expect(dao.getDefinition("rewrite.test", null)).andReturn(rewriteTest);
+
+ replay(dao);
+
+ List<ApplicationResource> sources = new ArrayList<>();
+ sources.add(resource);
+ dao.setSources(sources);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ dao.setReader(reader);
+
+ Request context = createMock(Request.class);
+ expect(context.getContext("session")).andReturn(new HashMap<>()).anyTimes();
+ expect(context.getRequestLocale()).andReturn(null).anyTimes();
+ replay(context);
+
+ Definition definition = dao.getDefinition("rewrite.test", null);
+ assertNotNull("rewrite.test definition not found.", definition);
+ assertEquals("Incorrect initial template value", "/test.jsp", definition.getTemplateAttribute().getValue());
+
+ RefreshMonitor reloadable = dao;
+ dao.loadDefinitionsFromResource(resource);
+ assertFalse("Factory should be fresh.", reloadable.refreshRequired());
+
+ // Make sure the system actually updates the timestamp.
+ Thread.sleep(SLEEP_MILLIS);
+
+ // Set up multiple data sources.
+ resource.modify("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n" + "<!DOCTYPE tiles-definitions PUBLIC "
+ + "\"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN\" "
+ + "\"http://tiles.apache.org/dtds/tiles-config_3_0.dtd\">\n\n" + "<tiles-definitions>"
+ + "<definition name=\"rewrite.test\" template=\"/newtest.jsp\">"
+ + "<put-attribute name=\"testparm\" value=\"testval\"/>" + "</definition>" //
+ + "</tiles-definitions>");
+
+ assertTrue("Factory should be stale.", reloadable.refreshRequired());
+
+ verify(context, dao);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAOTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAOTest.java
new file mode 100644
index 000000000..048577321
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/CachingLocaleUrlDefinitionDAOTest.java
@@ -0,0 +1,371 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.dao;
+
+import junit.framework.TestCase;
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.ListAttribute;
+import org.apache.tiles.core.definition.DefinitionsReader;
+import org.apache.tiles.core.definition.MockDefinitionsReader;
+import org.apache.tiles.core.definition.digester.DigesterDefinitionsReader;
+import org.apache.tiles.core.definition.pattern.BasicPatternDefinitionResolver;
+import org.apache.tiles.core.definition.pattern.PatternDefinitionResolver;
+import org.apache.tiles.core.definition.pattern.wildcard.WildcardDefinitionPatternMatcherFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.locale.URLApplicationResource;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+
+/**
+ * Tests {@link CachingLocaleUrlDefinitionDAO}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CachingLocaleUrlDefinitionDAOTest extends TestCase {
+
+ /**
+ * The object to test.
+ */
+ private CachingLocaleUrlDefinitionDAO definitionDao;
+
+ private ApplicationContext applicationContext;
+
+ private ApplicationResource url1;
+
+ private ApplicationResource url2;
+
+ private ApplicationResource url3;
+
+ private ApplicationResource urlWildcard;
+
+ private ApplicationResource url21;
+
+ private ApplicationResource setupUrl(String filename, Locale... locales) {
+ ApplicationResource url = new URLApplicationResource(
+ "org/apache/tiles/core/config/" + filename + ".xml",
+ Objects.requireNonNull(this.getClass().getClassLoader().getResource("org/apache/tiles/core/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/core/config/" + filename + "_" + locale.toString() + ".xml",
+ Objects.requireNonNull(this.getClass().getClassLoader().getResource("org/apache/tiles/core/config/" + filename + "_" + locale + ".xml"))
+ );
+ assertNotNull("Could not load " + filename + "_" + locale + " file.", urlLocale);
+ localeResources.put(locale, urlLocale);
+ }
+ for (Locale locale : new Locale[]{Locale.CANADA_FRENCH, Locale.FRENCH, Locale.US, Locale.ENGLISH,
+ Locale.CHINA, Locale.CHINESE, Locale.ITALY, Locale.ITALIAN}) {
+ ApplicationResource urlLocale = localeResources.get(locale);
+ expect(applicationContext.getResource(url, locale)).andReturn(urlLocale).anyTimes();
+ }
+ return url;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ applicationContext = createMock(ApplicationContext.class);
+ url1 = setupUrl("defs1", Locale.FRENCH, Locale.CANADA_FRENCH, Locale.US);
+ url2 = setupUrl("defs2");
+ url3 = setupUrl("defs3");
+ urlWildcard = setupUrl("defs-wildcard");
+ url21 = setupUrl("tiles-defs-2.1", Locale.ITALIAN);
+ replay(applicationContext);
+ definitionDao = new CachingLocaleUrlDefinitionDAO(applicationContext);
+ WildcardDefinitionPatternMatcherFactory definitionPatternMatcherFactory =
+ new WildcardDefinitionPatternMatcherFactory();
+ PatternDefinitionResolver<Locale> definitionResolver = new BasicPatternDefinitionResolver<>(
+ definitionPatternMatcherFactory,
+ definitionPatternMatcherFactory);
+ definitionDao.setPatternDefinitionResolver(definitionResolver);
+ }
+
+ public void testGetDefinition() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+
+ assertNotNull("test.def1 definition not found.", definitionDao
+ .getDefinition("test.def1", null));
+ assertNotNull("test.def2 definition not found.", definitionDao
+ .getDefinition("test.def2", null));
+ assertNotNull("test.def3 definition not found.", definitionDao
+ .getDefinition("test.def3", null));
+ assertNotNull("test.common definition not found.", definitionDao
+ .getDefinition("test.common", null));
+ assertNotNull("test.common definition in US locale not found.",
+ definitionDao.getDefinition("test.common", Locale.US));
+ assertNotNull("test.common definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.common", Locale.FRENCH));
+ assertNotNull("test.common definition in CHINA locale not found.",
+ definitionDao.getDefinition("test.common", Locale.CHINA));
+ assertNotNull(
+ "test.common.french definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.common.french",
+ Locale.FRENCH));
+ assertNotNull(
+ "test.common.french definition in CANADA_FRENCH locale not found.",
+ definitionDao.getDefinition("test.common.french",
+ Locale.CANADA_FRENCH));
+ assertNotNull("test.def.toextend definition not found.", definitionDao
+ .getDefinition("test.def.toextend", null));
+ assertNotNull("test.def.overridden definition not found.",
+ definitionDao.getDefinition("test.def.overridden", null));
+ assertNotNull(
+ "test.def.overridden definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.def.overridden",
+ Locale.FRENCH));
+
+ assertEquals("Incorrect default country value", "default",
+ definitionDao.getDefinition("test.def1", null).getAttribute(
+ "country").getValue());
+ assertEquals("Incorrect US country value", "US", definitionDao
+ .getDefinition("test.def1", Locale.US).getAttribute("country")
+ .getValue());
+ assertEquals("Incorrect France country value", "France", definitionDao
+ .getDefinition("test.def1", Locale.FRENCH).getAttribute(
+ "country").getValue());
+ assertEquals("Incorrect Chinese country value (should be default)",
+ "default", definitionDao.getDefinition("test.def1",
+ Locale.CHINA).getAttribute("country").getValue());
+ assertEquals("Incorrect default country value", "default",
+ definitionDao.getDefinition("test.def.overridden", null)
+ .getAttribute("country").getValue());
+ assertEquals("Incorrect default title value",
+ "Definition to be overridden", definitionDao.getDefinition(
+ "test.def.overridden", null).getAttribute("title")
+ .getValue());
+ assertEquals("Incorrect France country value", "France", definitionDao
+ .getDefinition("test.def.overridden", Locale.FRENCH)
+ .getAttribute("country").getValue());
+ assertNull("Definition in French not found", definitionDao
+ .getDefinition("test.def.overridden", Locale.FRENCH)
+ .getAttribute("title"));
+ }
+
+ public void testGetDefinitions() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+
+ Map<String, Definition> defaultDefinitions = definitionDao
+ .getDefinitions(null);
+ Map<String, Definition> usDefinitions = definitionDao
+ .getDefinitions(Locale.US);
+ Map<String, Definition> frenchDefinitions = definitionDao
+ .getDefinitions(Locale.FRENCH);
+ Map<String, Definition> chinaDefinitions = definitionDao
+ .getDefinitions(Locale.CHINA);
+ Map<String, Definition> canadaFrenchDefinitions = definitionDao
+ .getDefinitions(Locale.CANADA_FRENCH);
+
+ assertNotNull("test.def1 definition not found.", defaultDefinitions
+ .get("test.def1"));
+ assertNotNull("test.def2 definition not found.", defaultDefinitions
+ .get("test.def2"));
+ assertNotNull("test.def3 definition not found.", defaultDefinitions
+ .get("test.def3"));
+ assertNotNull("test.common definition not found.", defaultDefinitions
+ .get("test.common"));
+ assertNotNull("test.common definition in US locale not found.",
+ usDefinitions.get("test.common"));
+ assertNotNull("test.common definition in FRENCH locale not found.",
+ frenchDefinitions.get("test.common"));
+ assertNotNull("test.common definition in CHINA locale not found.",
+ chinaDefinitions.get("test.common"));
+ assertNotNull(
+ "test.common.french definition in FRENCH locale not found.",
+ frenchDefinitions.get("test.common.french"));
+ assertNotNull(
+ "test.common.french definition in CANADA_FRENCH locale not found.",
+ canadaFrenchDefinitions.get("test.common.french"));
+ assertNotNull("test.def.toextend definition not found.",
+ defaultDefinitions.get("test.def.toextend"));
+ assertNotNull("test.def.overridden definition not found.",
+ defaultDefinitions.get("test.def.overridden"));
+ assertNotNull(
+ "test.def.overridden definition in FRENCH locale not found.",
+ frenchDefinitions.get("test.def.overridden"));
+
+ assertEquals("Incorrect default country value", "default",
+ defaultDefinitions.get("test.def1").getAttribute("country")
+ .getValue());
+ assertEquals("Incorrect US country value", "US", usDefinitions.get(
+ "test.def1").getAttribute("country").getValue());
+ assertEquals("Incorrect France country value", "France",
+ frenchDefinitions.get("test.def1").getAttribute("country")
+ .getValue());
+ assertEquals("Incorrect Chinese country value (should be default)",
+ "default", chinaDefinitions.get("test.def1").getAttribute(
+ "country").getValue());
+ assertEquals("Incorrect default country value", "default",
+ defaultDefinitions.get("test.def.overridden").getAttribute(
+ "country").getValue());
+ assertEquals("Incorrect default title value",
+ "Definition to be overridden", defaultDefinitions.get(
+ "test.def.overridden").getAttribute("title").getValue());
+ assertEquals("Incorrect France country value", "France",
+ frenchDefinitions.get("test.def.overridden").getAttribute(
+ "country").getValue());
+ assertNull("Definition in French not found", frenchDefinitions.get(
+ "test.def.overridden").getAttribute("title"));
+ }
+
+ public void testSetSourceURLs() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The source URLs are not set correctly", sourceURLs,
+ definitionDao.sources);
+ }
+
+ public void testSetReader() {
+ DefinitionsReader reader = createMock(DefinitionsReader.class);
+ definitionDao.setReader(reader);
+ assertEquals("There reader has not been set correctly", reader,
+ definitionDao.reader);
+ }
+
+ public void testInit() {
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ Set<ApplicationResource> urlSet = new HashSet<>();
+ urlSet.add(url1);
+ expect(applicationContext.getResources("/WEB-INF/tiles.xml"))
+ .andReturn(urlSet);
+ replay(applicationContext);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The reader is not of the correct class",
+ DigesterDefinitionsReader.class, definitionDao.reader
+ .getClass());
+ assertEquals("The source URLs are not correct", sourceURLs,
+ definitionDao.sources);
+ reset(applicationContext);
+
+ definitionDao.setReader(new MockDefinitionsReader());
+ assertEquals("The reader is not of the correct class",
+ MockDefinitionsReader.class, definitionDao.reader.getClass());
+ sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The source URLs are not correct", sourceURLs,
+ definitionDao.sources);
+ }
+
+ /**
+ * Tests wildcard mappings.
+ */
+ public void testWildcardMapping() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(urlWildcard);
+ definitionDao.setSources(urls);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+
+ Definition definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALY);
+ assertEquals("The template is not correct", "/testName.jsp", definition
+ .getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct",
+ "/common/headerLayered.jsp", definition.getAttribute("header")
+ .getValue());
+ definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALIAN);
+ assertEquals("The template is not correct", "/testName.jsp", definition
+ .getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct",
+ "/common/headerLayered.jsp", definition.getAttribute("header")
+ .getValue());
+ definition = definitionDao.getDefinition("test.defName.subLayered", null);
+ assertEquals("The template is not correct", "/testName.jsp", definition
+ .getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct",
+ "/common/headerLayered.jsp", definition.getAttribute("header")
+ .getValue());
+ definition = definitionDao.getDefinition("test.defName.noAttribute", null);
+ assertEquals("/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertNull(definition.getLocalAttributeNames());
+ definition = definitionDao.getDefinition("test.def3", null);
+ assertNotNull("The simple definition is null", definition);
+
+ definition = definitionDao.getDefinition("test.extended.defName.subLayered", null);
+ assertEquals("test.defName.subLayered", definition.getExtends());
+ assertNull(definition.getTemplateAttribute().getValue());
+ assertEquals(1, definition.getLocalAttributeNames().size());
+ assertEquals("Overridden Title", definition.getAttribute("title").getValue());
+ }
+
+ /**
+ * Tests
+ * {@link ResolvingLocaleUrlDefinitionDAO#getDefinition(String, Locale)}
+ * when loading multiple files for a locale.
+ */
+ public void testListAttributeLocaleInheritance() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(url21);
+ definitionDao.setSources(urls);
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+ replay(applicationContext);
+
+ Definition definition = definitionDao.getDefinition(
+ "test.inherit.list", Locale.ITALIAN);
+ ListAttribute listAttribute = (ListAttribute) definition
+ .getAttribute("list");
+ List<Attribute> attributes = listAttribute.getValue();
+ // It is right not to resolve inheritance in this DAO.
+ assertEquals(1, attributes.size());
+ verify(applicationContext);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAOTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAOTest.java
new file mode 100644
index 000000000..727617b69
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/dao/ResolvingLocaleUrlDefinitionDAOTest.java
@@ -0,0 +1,391 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.dao;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.ListAttribute;
+import org.apache.tiles.core.definition.DefinitionsReader;
+import org.apache.tiles.core.definition.MockDefinitionsReader;
+import org.apache.tiles.core.definition.NoSuchDefinitionException;
+import org.apache.tiles.core.definition.digester.DigesterDefinitionsReader;
+import org.apache.tiles.core.definition.pattern.BasicPatternDefinitionResolver;
+import org.apache.tiles.core.definition.pattern.PatternDefinitionResolver;
+import org.apache.tiles.core.definition.pattern.wildcard.WildcardDefinitionPatternMatcherFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.locale.URLApplicationResource;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Tests {@link ResolvingLocaleUrlDefinitionDAO}.
+ */
+public class ResolvingLocaleUrlDefinitionDAOTest {
+
+ /**
+ * The number of attribute names.
+ */
+ private static final int ATTRIBUTE_NAMES_COUNT = 6;
+
+ /**
+ * The object to test.
+ */
+ private ResolvingLocaleUrlDefinitionDAO definitionDao;
+
+ private ApplicationContext applicationContext;
+
+ private ApplicationResource url1;
+ private ApplicationResource url2;
+ private ApplicationResource url3;
+ private ApplicationResource urlWildcard;
+ private ApplicationResource url21;
+ private ApplicationResource url513;
+
+ private ApplicationResource setupUrl(String filename, Locale... locales) {
+ ApplicationResource url = new URLApplicationResource(
+ "org/apache/tiles/core/config/" + filename + ".xml",
+ Objects.requireNonNull(this.getClass().getClassLoader().getResource("org/apache/tiles/core/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<>();
+ for (Locale locale : locales) {
+ ApplicationResource urlLocale = new URLApplicationResource(
+ "org/apache/tiles/core/config/" + filename + "_" + locale + ".xml",
+ Objects.requireNonNull(this.getClass().getClassLoader().getResource("org/apache/tiles/core/config/" + filename + "_" + locale.toString() + ".xml"))
+ );
+ assertNotNull("Could not load " + filename + "_" + locale + " file.", urlLocale);
+ localeResources.put(locale, urlLocale);
+ }
+ Locale[] supportedLocales = {
+ Locale.CANADA_FRENCH,
+ Locale.FRENCH,
+ Locale.US,
+ Locale.ENGLISH,
+ Locale.CHINA,
+ Locale.CHINESE,
+ Locale.ITALY,
+ Locale.ITALIAN,
+ new Locale("es"),
+ new Locale("es", "CO"),
+ new Locale("en", "CA")
+ };
+ for (Locale locale : supportedLocales) {
+ ApplicationResource urlLocale = localeResources.get(locale);
+ expect(applicationContext.getResource(url, locale)).andReturn(urlLocale).anyTimes();
+ }
+ return url;
+ }
+
+ @Before
+ public void setUp() throws IOException {
+ // Set up multiple data sources.
+ applicationContext = createMock(ApplicationContext.class);
+ url1 = setupUrl("defs1", Locale.FRENCH, Locale.CANADA_FRENCH, Locale.US);
+ url2 = setupUrl("defs2");
+ url3 = setupUrl("defs3");
+ urlWildcard = setupUrl("defs-wildcard");
+ url21 = setupUrl("tiles-defs-2.1", Locale.ITALIAN);
+ url513 = setupUrl("defs-tiles-513");
+ replay(applicationContext);
+
+ definitionDao = new ResolvingLocaleUrlDefinitionDAO(applicationContext);
+ WildcardDefinitionPatternMatcherFactory definitionPatternMatcherFactory = new WildcardDefinitionPatternMatcherFactory();
+ PatternDefinitionResolver<Locale> definitionResolver = new BasicPatternDefinitionResolver<>(
+ definitionPatternMatcherFactory, definitionPatternMatcherFactory);
+ definitionDao.setPatternDefinitionResolver(definitionResolver);
+ }
+
+ @Test
+ public void testGetDefinition() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+
+ assertNotNull("test.def1 definition not found.", definitionDao.getDefinition("test.def1", null));
+ assertNotNull("test.def2 definition not found.", definitionDao.getDefinition("test.def2", null));
+ assertNotNull("test.def3 definition not found.", definitionDao.getDefinition("test.def3", null));
+ assertNotNull("test.common definition not found.", definitionDao.getDefinition("test.common", null));
+ assertNotNull("test.common definition in US locale not found.",
+ definitionDao.getDefinition("test.common", Locale.US));
+ assertNotNull("test.common definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.common", Locale.FRENCH));
+ assertNotNull("test.common definition in CHINA locale not found.",
+ definitionDao.getDefinition("test.common", Locale.CHINA));
+ assertNotNull("test.common.french definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.common.french", Locale.FRENCH));
+ assertNotNull("test.common.french definition in CANADA_FRENCH locale not found.",
+ definitionDao.getDefinition("test.common.french", Locale.CANADA_FRENCH));
+ assertNotNull("test.def.toextend definition not found.", definitionDao.getDefinition("test.def.toextend", null));
+ assertNotNull("test.def.overridden definition not found.",
+ definitionDao.getDefinition("test.def.overridden", null));
+ assertNotNull("test.def.overridden definition in FRENCH locale not found.",
+ definitionDao.getDefinition("test.def.overridden", Locale.FRENCH));
+
+ assertEquals("Incorrect default country value", "default", definitionDao.getDefinition("test.def1", null)
+ .getAttribute("country").getValue());
+ assertEquals("Incorrect US country value", "US", definitionDao.getDefinition("test.def1", Locale.US)
+ .getAttribute("country").getValue());
+ assertEquals("Incorrect France country value", "France", definitionDao
+ .getDefinition("test.def1", Locale.FRENCH).getAttribute("country").getValue());
+ assertEquals("Incorrect Chinese country value (should be default)", "default",
+ definitionDao.getDefinition("test.def1", Locale.CHINA).getAttribute("country").getValue());
+ assertEquals("Incorrect default country value", "default",
+ definitionDao.getDefinition("test.def.overridden", null).getAttribute("country").getValue());
+ assertEquals("Incorrect default title value", "Definition to be overridden",
+ definitionDao.getDefinition("test.def.overridden", null).getAttribute("title").getValue());
+ assertEquals("Incorrect France country value", "France",
+ definitionDao.getDefinition("test.def.overridden", Locale.FRENCH).getAttribute("country").getValue());
+ assertEquals("Incorrect France title value", "Definition to be extended",
+ definitionDao.getDefinition("test.def.overridden", Locale.FRENCH).getAttribute("title").getValue());
+ }
+
+ @Test
+ public void testGetDefinitions() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+
+ Map<String, Definition> defaultDefinitions = definitionDao.getDefinitions(null);
+ Map<String, Definition> usDefinitions = definitionDao.getDefinitions(Locale.US);
+ Map<String, Definition> frenchDefinitions = definitionDao.getDefinitions(Locale.FRENCH);
+ Map<String, Definition> chinaDefinitions = definitionDao.getDefinitions(Locale.CHINA);
+ Map<String, Definition> canadaFrendDefinitions = definitionDao.getDefinitions(Locale.CANADA_FRENCH);
+
+ assertNotNull("test.def1 definition not found.", defaultDefinitions.get("test.def1"));
+ assertNotNull("test.def2 definition not found.", defaultDefinitions.get("test.def2"));
+ assertNotNull("test.def3 definition not found.", defaultDefinitions.get("test.def3"));
+ assertNotNull("test.common definition not found.", defaultDefinitions.get("test.common"));
+ assertNotNull("test.common definition in US locale not found.", usDefinitions.get("test.common"));
+ assertNotNull("test.common definition in FRENCH locale not found.", frenchDefinitions.get("test.common"));
+ assertNotNull("test.common definition in CHINA locale not found.", chinaDefinitions.get("test.common"));
+ assertNotNull("test.common.french definition in FRENCH locale not found.",
+ canadaFrendDefinitions.get("test.common.french"));
+ assertNotNull("test.common.french definition in CANADA_FRENCH locale not found.",
+ canadaFrendDefinitions.get("test.common.french"));
+ assertNotNull("test.def.toextend definition not found.", defaultDefinitions.get("test.def.toextend"));
+ assertNotNull("test.def.overridden definition not found.", defaultDefinitions.get("test.def.overridden"));
+ assertNotNull("test.def.overridden definition in FRENCH locale not found.",
+ frenchDefinitions.get("test.def.overridden"));
+
+ assertEquals("Incorrect default country value", "default",
+ defaultDefinitions.get("test.def1").getAttribute("country").getValue());
+ assertEquals("Incorrect US country value", "US", usDefinitions.get("test.def1").getAttribute("country")
+ .getValue());
+ assertEquals("Incorrect France country value", "France",
+ frenchDefinitions.get("test.def1").getAttribute("country").getValue());
+ assertEquals("Incorrect Chinese country value (should be default)", "default", chinaDefinitions
+ .get("test.def1").getAttribute("country").getValue());
+ assertEquals("Incorrect default country value", "default", defaultDefinitions.get("test.def.overridden")
+ .getAttribute("country").getValue());
+ assertEquals("Incorrect default title value", "Definition to be overridden",
+ defaultDefinitions.get("test.def.overridden").getAttribute("title").getValue());
+ assertEquals("Incorrect France country value", "France", frenchDefinitions.get("test.def.overridden")
+ .getAttribute("country").getValue());
+ assertEquals("Incorrect France title value", "Definition to be extended",
+ frenchDefinitions.get("test.def.overridden").getAttribute("title").getValue());
+ }
+
+ @Test
+ public void testSetSourceURLs() {
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The source URLs are not set correctly", sourceURLs, definitionDao.sources);
+ }
+
+ @Test
+ public void testSetReader() {
+ DefinitionsReader reader = createMock(DefinitionsReader.class);
+ definitionDao.setReader(reader);
+ assertEquals("There reader has not been set correctly", reader, definitionDao.reader);
+ }
+
+ /**
+ * Tests {@link ResolvingLocaleUrlDefinitionDAO#resolveInheritance(Definition, Map, Locale, Set)}.
+ */
+ @Test(expected = NoSuchDefinitionException.class)
+ public void testResolveInheritanceNoParent() {
+ Definition definition = new Definition("mydef", null, null);
+ definition.setExtends("otherDef");
+ definitionDao.resolveInheritance(definition, new HashMap<>(), Locale.ITALY,
+ new HashSet<>());
+ }
+
+ /**
+ * Tests execution.
+ */
+ @Test
+ public void testInit() {
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ Set<ApplicationResource> urlSet = new HashSet<>();
+ urlSet.add(url1);
+ expect(applicationContext.getResources("/WEB-INF/tiles.xml")).andReturn(urlSet);
+ replay(applicationContext);
+ DefinitionsReader reader = new DigesterDefinitionsReader();
+ definitionDao.setReader(reader);
+ List<ApplicationResource> sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The reader is not of the correct class", DigesterDefinitionsReader.class,
+ definitionDao.reader.getClass());
+ assertEquals("The source URLs are not correct", sourceURLs, definitionDao.sources);
+ reset(applicationContext);
+
+ applicationContext = createMock(ApplicationContext.class);
+ replay(applicationContext);
+ definitionDao.setReader(new MockDefinitionsReader());
+ assertEquals("The reader is not of the correct class", MockDefinitionsReader.class,
+ definitionDao.reader.getClass());
+ sourceURLs = new ArrayList<>();
+ sourceURLs.add(url1);
+ sourceURLs.add(url2);
+ sourceURLs.add(url3);
+ definitionDao.setSources(sourceURLs);
+ assertEquals("The source URLs are not correct", sourceURLs, definitionDao.sources);
+ verify(applicationContext);
+ }
+
+ /**
+ * Tests wildcard mappings.
+ */
+ @Test
+ public void testWildcardMapping() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(urlWildcard);
+ definitionDao.setSources(urls);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+
+ Definition definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALY);
+ assertEquals("The template is not correct", "/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct", "/common/headerLayered.jsp",
+ definition.getAttribute("header").getValue());
+ definition = definitionDao.getDefinition("test.defName.subLayered", Locale.ITALIAN);
+ assertEquals("The template is not correct", "/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct", "/common/headerLayered.jsp",
+ definition.getAttribute("header").getValue());
+ definition = definitionDao.getDefinition("test.defName.subLayered", null);
+ assertEquals("The template is not correct", "/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertEquals("The header attribute is not correct", "/common/headerLayered.jsp",
+ definition.getAttribute("header").getValue());
+ definition = definitionDao.getDefinition("test.defName.noAttribute", null);
+ assertEquals("/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertNull(definition.getLocalAttributeNames());
+ definition = definitionDao.getDefinition("test.def3", null);
+ assertNotNull("The simple definition is null", definition);
+
+ definition = definitionDao.getDefinition("test.extended.defName.subLayered", null);
+ assertEquals("test.defName.subLayered", definition.getExtends());
+ assertEquals(ATTRIBUTE_NAMES_COUNT, definition.getLocalAttributeNames().size());
+ assertEquals("The template is not correct", "/testName.jsp", definition.getTemplateAttribute().getValue());
+ assertEquals("Overridden Title", definition.getAttribute("title").getValue());
+ assertEquals("The header attribute is not correct", "/common/headerLayered.jsp",
+ definition.getAttribute("header").getValue());
+ }
+
+ /**
+ * Tests
+ * {@link ResolvingLocaleUrlDefinitionDAO#getDefinition(String, Locale)}
+ * when loading multiple files for a locale.
+ */
+ @Test
+ public void testListAttributeLocaleInheritance() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(url21);
+ definitionDao.setSources(urls);
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+ replay(applicationContext);
+
+ Definition definition = definitionDao.getDefinition("test.inherit.list", Locale.ITALIAN);
+ ListAttribute listAttribute = (ListAttribute) definition.getAttribute("list");
+ List<Attribute> attributes = listAttribute.getValue();
+ assertEquals(2, attributes.size());
+ verify(applicationContext);
+ }
+
+ @Test
+ public void testTiles512() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(url21);
+ definitionDao.setSources(urls);
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+ replay(applicationContext);
+
+ Definition definition = definitionDao.getDefinition("test.inherit.othertype", Locale.ITALIAN);
+ assertEquals("/layout.ftl", definition.getTemplateAttribute().getValue());
+ assertEquals("freemarker", definition.getTemplateAttribute().getRenderer());
+ }
+
+ @Test
+ public void testTiles513() {
+ List<ApplicationResource> urls = new ArrayList<>();
+ urls.add(url513);
+ definitionDao.setSources(urls);
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ definitionDao.setReader(new DigesterDefinitionsReader());
+ replay(applicationContext);
+
+ Definition definition = definitionDao.getDefinition("test.anonymous", null);
+ definitionDao.getDefinition("test.anonymous", new Locale("es", "CO"));
+ definitionDao.getDefinition("test.anonymous", new Locale("en", "CA"));
+ Attribute attribute = definition.getAttribute("header");
+ Definition child = definitionDao.getDefinition((String) attribute.getValue(), null);
+ assertNotNull(child);
+ attribute = definition.getAttribute("menu");
+ child = definitionDao.getDefinition((String) attribute.getValue(), null);
+ assertNotNull(child);
+ attribute = definition.getAttribute("footer");
+ child = definitionDao.getDefinition((String) attribute.getValue(), null);
+ assertNotNull(child);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderExceptionTest.java
similarity index 69%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderExceptionTest.java
index 777ecd57c..55403cbbb 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,8 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
-
-package org.apache.tiles.api;
+package org.apache.tiles.core.definition.digester;
import org.junit.Test;
@@ -27,13 +24,16 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link NoSuchContainerException}.
+ * Tests {@link DigesterDefinitionsReaderException}.
*/
-public class NoSuchContainerExceptionTest {
+public class DigesterDefinitionsReaderExceptionTest {
+ /**
+ * Test method for {@link DigesterDefinitionsReaderException#DigesterDefinitionsReaderException(String)}.
+ */
@Test
- public void testNoSuchContainerExceptionString() {
- NoSuchContainerException exception = new NoSuchContainerException("my message");
+ public void testDigesterDefinitionsReaderExceptionString() {
+ DigesterDefinitionsReaderException exception = new DigesterDefinitionsReaderException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/TestDigesterDefinitionsReader.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/TestDigesterDefinitionsReader.java
new file mode 100644
index 000000000..f8a5ee0a3
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/digester/TestDigesterDefinitionsReader.java
@@ -0,0 +1,279 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.digester;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.ListAttribute;
+import org.apache.tiles.core.definition.DefinitionsFactoryException;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+/**
+ * Tests the <code>org.apache.tiles.definition.digester.DigesterDefinitionsReader</code> class.
+ */
+public class TestDigesterDefinitionsReader {
+
+ private DigesterDefinitionsReader reader;
+
+ @Before
+ public void setUp() {
+ reader = new DigesterDefinitionsReader();
+ }
+
+ /**
+ * Tests the read method under normal conditions.
+ *
+ * @throws IOException If something goes wrong.
+ */
+ @Test
+ public void testRead() throws IOException {
+ URL configFile = this.getClass().getClassLoader().getResource("org/apache/tiles/core/config/tiles-defs.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ Map<String, Definition> definitions = reader.read(source);
+
+ assertNotNull("Definitions not returned.", definitions);
+ assertNotNull("Couldn't find doc.mainLayout tile.", definitions.get("doc.mainLayout"));
+ assertNotNull("Couldn't Find title attribute.", definitions.get("doc.mainLayout").getAttribute("title").getValue());
+ assertEquals("Incorrect Find title attribute.", "Tiles Library Documentation", definitions.get("doc.mainLayout").getAttribute("title").getValue());
+
+ Definition def = definitions.get("doc.role.test");
+ assertNotNull("Couldn't find doc.role.test tile.", def);
+ Attribute attribute = def.getAttribute("title");
+ assertNotNull("Couldn't Find title attribute.", attribute.getValue());
+ assertEquals("Role 'myrole' expected", attribute.getRole(), "myrole");
+
+ def = definitions.get("doc.listattribute.test");
+ assertNotNull("Couldn't find doc.listattribute.test tile.", def);
+ attribute = def.getAttribute("items");
+ assertNotNull("Couldn't Find items attribute.", attribute);
+ assertTrue("The class of the attribute is not right", attribute instanceof ListAttribute);
+ assertTrue("The class of value of the attribute is not right", attribute.getValue() instanceof List);
+ }
+
+
+ /**
+ * Tests the read method under normal conditions for the new features in 2.1
+ * version of the DTD.
+ *
+ * @throws IOException If something goes wrong.
+ */
+ @Test
+ public void testRead21Version() throws IOException {
+ URL configFile = this.getClass().getClassLoader().getResource("org/apache/tiles/core/config/tiles-defs-2.1.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ Map<String, Definition> definitions = reader.read(source);
+
+ assertNotNull("Definitions not returned.", definitions);
+ Definition def = definitions.get("doc.cascaded.test");
+
+ assertNotNull("Couldn't find doc.role.test tile.", def);
+ Attribute attribute = def.getLocalAttribute("title");
+ assertNotNull("Couldn't Find title local attribute.", attribute);
+ attribute = def.getCascadedAttribute("title2");
+ assertNotNull("Couldn't Find title2 cascaded attribute.", attribute);
+ attribute = def.getLocalAttribute("items1");
+ assertNotNull("Couldn't Find items1 local attribute.", attribute);
+ attribute = def.getCascadedAttribute("items2");
+ assertNotNull("Couldn't Find items2 cascaded attribute.", attribute);
+
+ def = definitions.get("test.nesting.definitions");
+ assertNotNull("Couldn't find test.nesting.definitions tile.", def);
+ assertEquals("/layout.jsp", def.getTemplateAttribute().getValue());
+ assertEquals("template", def.getTemplateAttribute().getRenderer());
+ attribute = def.getAttribute("body");
+ assertNotNull("Couldn't Find body attribute.", attribute);
+ assertEquals("Attribute not of 'definition' type", "definition", attribute.getRenderer());
+ assertNotNull("Attribute value null", attribute.getValue());
+ String defName = attribute.getValue().toString();
+ def = definitions.get(defName);
+ assertNotNull("Couldn't find " + defName + " tile.", def);
+
+ def = definitions.get("test.nesting.list.definitions");
+ assertNotNull("Couldn't find test.nesting.list.definitions tile.", def);
+ attribute = def.getAttribute("list");
+ assertNotNull("Couldn't Find list attribute.", attribute);
+ assertTrue("Attribute not of valid type", attribute instanceof ListAttribute);
+ ListAttribute listAttribute = (ListAttribute) attribute;
+ List<Attribute> list = listAttribute.getValue();
+ assertEquals("The list is not of correct size", 1, list.size());
+ attribute = list.get(0);
+ assertNotNull("Couldn't Find element attribute.", attribute);
+ assertEquals("Attribute not of 'definition' type", "definition", attribute.getRenderer());
+ assertNotNull("Attribute value null", attribute.getValue());
+ defName = attribute.getValue().toString();
+ def = definitions.get(defName);
+ assertNotNull("Couldn't find " + defName + " tile.", def);
+
+ defName = "test.inherit.list.base";
+ def = definitions.get(defName);
+ assertNotNull("Couldn't find " + defName + " tile.", def);
+ defName = "test.inherit.list";
+ def = definitions.get(defName);
+ assertNotNull("Couldn't find " + defName + " tile.", def);
+ listAttribute = (ListAttribute) def.getAttribute("list");
+ assertTrue("This definition does not inherit its list attribute", listAttribute.isInherit());
+ defName = "test.noinherit.list";
+ def = definitions.get(defName);
+ listAttribute = (ListAttribute) def.getAttribute("list");
+ assertFalse("This definition inherits its list attribute", listAttribute.isInherit());
+
+ defName = "test.new.attributes";
+ def = definitions.get(defName);
+ assertNotNull("Couldn't find " + defName + " tile.", def);
+ Attribute templateAttribute = def.getTemplateAttribute();
+ assertEquals(templateAttribute.getExpressionObject().getExpression(), "${my.expression}");
+ assertEquals("mytype", templateAttribute.getRenderer());
+ attribute = def.getAttribute("body");
+ assertNotNull("Couldn't Find body attribute.", attribute);
+ assertEquals("${my.attribute.expression}", attribute.getExpressionObject().getExpression());
+ }
+
+ /**
+ * Tests read with bad input source.
+ */
+ @Test
+ public void testBadSource() {
+ try {
+ reader.read("Bad Input");
+ fail("Should've thrown an exception.");
+ } catch (DefinitionsFactoryException e) {
+ assertTrue(true);
+ } catch (Exception e) {
+ fail("Exception reading configuration." + e);
+ }
+ }
+
+ /**
+ * Tests read with bad XML source.
+ */
+ @Test
+ public void testBadXml() {
+ try {
+ URL configFile = this.getClass().getClassLoader().getResource(
+ "org/apache/tiles/config/malformed-defs.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ reader.read(source);
+ fail("Should've thrown an exception.");
+ } catch (DefinitionsFactoryException e) {
+ assertTrue(true);
+ } catch (Exception e) {
+ fail("Exception reading configuration." + e);
+ }
+ }
+
+ /**
+ * Tests the validating input parameter.
+ * <p>
+ * This test case enables Digester's validating property then passes in a
+ * configuration file with invalid XML.
+ */
+ @Test
+ public void testValidatingParameter() {
+ // Testing with default (validation ON).
+ try {
+ URL configFile = this.getClass().getClassLoader().getResource(
+ "org/apache/tiles/config/invalid-defs.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ reader.setValidating(true);
+ reader.read(source);
+ fail("Should've thrown an exception.");
+ } catch (DefinitionsFactoryException e) {
+ assertTrue(true);
+ } catch (Exception e) {
+ fail("Exception reading configuration." + e);
+ }
+
+ // Testing with validation OFF.
+ try {
+ setUp();
+ URL configFile = this.getClass().getClassLoader().getResource(
+ "org/apache/tiles/config/invalid-defs.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ reader.read(source);
+ } catch (DefinitionsFactoryException e) {
+ fail("Should not have thrown an exception." + e);
+ } catch (Exception e) {
+ fail("Exception reading configuration." + e);
+ }
+ }
+
+ /**
+ * Regression test for bug TILES-352.
+ *
+ * @throws IOException If something goes wrong.
+ */
+ @Test
+ public void testRegressionTiles352() throws IOException {
+ URL configFile = this.getClass().getClassLoader().getResource(
+ "org/apache/tiles/config/defs_regression_TILES-352.xml");
+ assertNotNull("Config file not found", configFile);
+
+ InputStream source = configFile.openStream();
+ Map<String, Definition> name2defs = reader.read(source);
+ source.close();
+ Definition root = name2defs.get("root");
+ Attribute attribute = root.getAttribute("body");
+ Definition child = name2defs.get(attribute.getValue());
+ ListAttribute listAttribute = (ListAttribute) child.getAttribute("list");
+ List<Attribute> list = listAttribute.getValue();
+ assertEquals((list.get(0)).getValue(), "This is a value");
+ }
+
+ /**
+ * Tests {@link DigesterDefinitionsReader#read(Object)}.
+ */
+ @Test
+ public void testReadNoSource() {
+ assertNull(reader.read(null));
+ }
+
+ /**
+ * Tests {@link DigesterDefinitionsReader#addDefinition(Definition)}.
+ */
+ @Test(expected = DigesterDefinitionsReaderException.class)
+ public void testAddDefinitionNoName() {
+ Definition def = new Definition();
+ reader.addDefinition(def);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolverTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolverTest.java
new file mode 100644
index 000000000..db9c00f6e
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/AbstractPatternDefinitionResolverTest.java
@@ -0,0 +1,119 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.pattern;
+
+import org.apache.tiles.api.Definition;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Tests {@link AbstractPatternDefinitionResolver}.
+ */
+public class AbstractPatternDefinitionResolverTest {
+
+ private DefinitionPatternMatcher firstMatcher;
+ private DefinitionPatternMatcher thirdMatcher;
+
+ private final PatternDefinitionResolver<Integer> resolver = new AbstractPatternDefinitionResolver<Integer>() {
+ @Override
+ protected Map<String, Definition> addDefinitionsAsPatternMatchers(List<DefinitionPatternMatcher> matchers, Map<String, Definition> defsMap) {
+ if (defsMap.containsKey("first")) {
+ matchers.add(firstMatcher);
+ }
+ if (defsMap.containsKey("third")) {
+ matchers.add(thirdMatcher);
+ }
+ Map<String, Definition> retValue = new HashMap<>(defsMap);
+ retValue.remove("first");
+ retValue.remove("third");
+ return retValue;
+ }
+ };
+
+ /**
+ * Test method for
+ * {@link BasicPatternDefinitionResolver#resolveDefinition(String, Object)}.
+ */
+ @Test
+ public void testResolveDefinition() {
+ testResolveDefinitionImpl();
+ }
+
+ /**
+ * Test method for
+ * {@link BasicPatternDefinitionResolver#clearPatternPaths(Object)}.
+ */
+ @Test
+ public void testClearPatternPaths() {
+ testResolveDefinitionImpl();
+ resolver.clearPatternPaths(1);
+ resolver.clearPatternPaths(2);
+ testResolveDefinitionImpl();
+ }
+
+ private void testResolveDefinitionImpl() {
+
+ firstMatcher = createMock(DefinitionPatternMatcher.class);
+ thirdMatcher = createMock(DefinitionPatternMatcher.class);
+
+ Definition firstDefinition = new Definition("first", null, null);
+ Definition secondDefinition = new Definition("second", null, null);
+ Definition thirdDefinition = new Definition("third", null, null);
+
+ Definition firstTransformedDefinition = new Definition("firstTransformed", null, null);
+ Definition thirdTransformedDefinition = new Definition("thirdTransformed", null, null);
+
+ expect(firstMatcher.createDefinition("firstTransformed")).andReturn(firstTransformedDefinition);
+ expect(firstMatcher.createDefinition("secondTransformed")).andReturn(null);
+ expect(firstMatcher.createDefinition("thirdTransformed")).andReturn(null);
+ expect(thirdMatcher.createDefinition("thirdTransformed")).andReturn(thirdTransformedDefinition).times(2);
+ expect(thirdMatcher.createDefinition("firstTransformed")).andReturn(null);
+ expect(thirdMatcher.createDefinition("secondTransformed")).andReturn(null).times(2);
+
+ replay(firstMatcher, thirdMatcher);
+
+ Map<String, Definition> localeDefsMap = new LinkedHashMap<>();
+ localeDefsMap.put("first", firstDefinition);
+ localeDefsMap.put("second", secondDefinition);
+ localeDefsMap.put("third", thirdDefinition);
+ resolver.storeDefinitionPatterns(localeDefsMap, 1);
+ localeDefsMap = new LinkedHashMap<>();
+ localeDefsMap.put("third", thirdDefinition);
+ resolver.storeDefinitionPatterns(localeDefsMap, 2);
+ assertEquals(firstTransformedDefinition, resolver.resolveDefinition("firstTransformed", 1));
+ assertNull(resolver.resolveDefinition("secondTransformed", 1));
+ assertEquals(thirdTransformedDefinition, resolver.resolveDefinition("thirdTransformed", 1));
+ assertNull(resolver.resolveDefinition("firstTransformed", 2));
+ assertNull(resolver.resolveDefinition("secondTransformed", 2));
+ assertEquals(thirdTransformedDefinition, resolver.resolveDefinition("thirdTransformed", 2));
+ verify(firstMatcher, thirdMatcher);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolverTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolverTest.java
new file mode 100644
index 000000000..7cd651b98
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/BasicPatternDefinitionResolverTest.java
@@ -0,0 +1,78 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.pattern;
+
+import org.apache.tiles.api.Definition;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link BasicPatternDefinitionResolver}.
+ */
+public class BasicPatternDefinitionResolverTest {
+
+ /**
+ * Test method for
+ * {@link BasicPatternDefinitionResolver#addDefinitionsAsPatternMatchers(List, Map)}.
+ */
+ @Test
+ public void testAddDefinitionsAsPatternMatchers() {
+ DefinitionPatternMatcherFactory factory = createMock(DefinitionPatternMatcherFactory.class);
+ PatternRecognizer recognizer = createMock(PatternRecognizer.class);
+ DefinitionPatternMatcher firstMatcher = createMock(DefinitionPatternMatcher.class);
+ DefinitionPatternMatcher thirdMatcher = createMock(DefinitionPatternMatcher.class);
+
+ expect(recognizer.isPatternRecognized("first")).andReturn(true);
+ expect(recognizer.isPatternRecognized("second")).andReturn(false);
+ expect(recognizer.isPatternRecognized("third")).andReturn(true);
+
+ Definition firstDefinition = new Definition("first", null, null);
+ Definition secondDefinition = new Definition("second", null, null);
+ Definition thirdDefinition = new Definition("third", null, null);
+
+ expect(factory.createDefinitionPatternMatcher("first", firstDefinition))
+ .andReturn(firstMatcher);
+ expect(factory.createDefinitionPatternMatcher("third", thirdDefinition))
+ .andReturn(thirdMatcher);
+
+ replay(factory, recognizer, firstMatcher, thirdMatcher);
+ BasicPatternDefinitionResolver<Integer> resolver = new BasicPatternDefinitionResolver<>(factory, recognizer);
+ Map<String, Definition> localeDefsMap = new LinkedHashMap<>();
+ localeDefsMap.put("first", firstDefinition);
+ localeDefsMap.put("second", secondDefinition);
+ localeDefsMap.put("third", thirdDefinition);
+ List<DefinitionPatternMatcher> matchers = new ArrayList<>();
+ resolver.addDefinitionsAsPatternMatchers(matchers, localeDefsMap);
+ assertEquals(2, matchers.size());
+ assertEquals(firstMatcher, matchers.get(0));
+ assertEquals(thirdMatcher, matchers.get(1));
+ verify(factory, recognizer, firstMatcher, thirdMatcher);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PatternUtilTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PatternUtilTest.java
new file mode 100644
index 000000000..8dea7b4af
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PatternUtilTest.java
@@ -0,0 +1,316 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.definition.pattern;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.Expression;
+import org.apache.tiles.api.ListAttribute;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+public class PatternUtilTest {
+
+ /**
+ * The size of the list in the main list attribute.
+ */
+ private static final int LIST_ATTRIBUTE_SIZE = 3;
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholders() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ attributes.put("attrib1", new Attribute("value{2}"));
+ attributes.put("attrib2", new Attribute("value{2}{3}"));
+ attributes.put("attrib3", new Attribute(null, Expression
+ .createExpression("expr{1}", "EL"), null, null));
+ Definition definition = new Definition("definitionName", new Attribute(
+ "template{1}"), attributes);
+ definition.setExtends("{2}ext");
+ definition.setPreparer("{3}prep");
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef",
+ "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+ assertEquals("value2ext", nudef.getExtends());
+ assertEquals("value3prep", nudef.getPreparer());
+ Attribute attribute = nudef.getTemplateAttribute();
+ assertEquals("templatevalue1", attribute.getValue());
+ attribute = nudef.getAttribute("attrib1");
+ assertEquals("valuevalue2", attribute.getValue());
+ attribute = nudef.getAttribute("attrib2");
+ assertEquals("valuevalue2value3", attribute.getValue());
+ attribute = nudef.getAttribute("attrib3");
+ assertEquals("exprvalue1", attribute.getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersNullTemplate() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ attributes.put("attrib1", new Attribute("value{2}"));
+ attributes.put("attrib2", new Attribute("value{2}{3}"));
+ Definition definition = new Definition("definitionName", null, attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef",
+ "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+ assertNull(nudef.getTemplateAttribute());
+ Attribute attribute = nudef.getAttribute("attrib1");
+ assertEquals("valuevalue2", attribute.getValue());
+ attribute = nudef.getAttribute("attrib2");
+ assertEquals("valuevalue2value3", attribute.getValue());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersCascadedAttributes() {
+ Definition definition = new Definition("definitionName", new Attribute(
+ "template{1}"), null);
+ definition.putAttribute("attrib1", new Attribute("value{2}"), true);
+ definition.putAttribute("attrib2", new Attribute("value{2}{3}"), true);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef",
+ "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+ Attribute attribute = nudef.getTemplateAttribute();
+ assertEquals("templatevalue1", attribute.getValue());
+ attribute = nudef.getAttribute("attrib1");
+ assertEquals("valuevalue2", attribute.getValue());
+ attribute = nudef.getAttribute("attrib2");
+ assertEquals("valuevalue2value3", attribute.getValue());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersListAttribute() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ ListAttribute listAttribute = new ListAttribute();
+ ListAttribute internalListAttribute = new ListAttribute();
+ listAttribute.setInherit(true);
+ attributes.put("myList", listAttribute);
+ listAttribute.add(new Attribute("value{2}"));
+ listAttribute.add(new Attribute("value{2}{3}"));
+ listAttribute.add(internalListAttribute);
+ internalListAttribute.add(new Attribute("secondvalue{2}"));
+ internalListAttribute.add(new Attribute("secondvalue{2}{3}"));
+ Definition definition = new Definition("definitionName", new Attribute(
+ "template{1}"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef",
+ "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+ Attribute attribute = nudef.getTemplateAttribute();
+ assertEquals("templatevalue1", attribute.getValue());
+ ListAttribute nuListAttribute = (ListAttribute) nudef.getAttribute("myList");
+ assertTrue(nuListAttribute.isInherit());
+ List<Attribute> list = nuListAttribute.getValue();
+ assertEquals(LIST_ATTRIBUTE_SIZE, list.size());
+ attribute = list.get(0);
+ assertEquals("valuevalue2", attribute.getValue());
+ attribute = list.get(1);
+ assertEquals("valuevalue2value3", attribute.getValue());
+ ListAttribute evaluatedListAttribute = (ListAttribute) list.get(2);
+ assertFalse(evaluatedListAttribute.isInherit());
+ list = evaluatedListAttribute.getValue();
+ assertEquals(2, list.size());
+ attribute = list.get(0);
+ assertEquals("secondvaluevalue2", attribute.getValue());
+ attribute = list.get(1);
+ assertEquals("secondvaluevalue2value3", attribute.getValue());
+ }
+
+
+ /**
+ * Tests {@link PatternUtil#createExtractedMap(Map, Set)}.
+ */
+ @Test
+ public void testCreateExtractedMap() {
+ Map<Integer, String> map = new HashMap<>();
+ map.put(0, "value0");
+ map.put(1, "value1");
+ map.put(2, "value2");
+ Set<Integer> set = new HashSet<>();
+ set.add(1);
+ set.add(2);
+ Map<Integer, String> extractedMap = PatternUtil.createExtractedMap(map, set);
+ assertEquals(2, extractedMap.size());
+ assertEquals("value1", extractedMap.get(1));
+ assertEquals("value2", extractedMap.get(2));
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ * See TILES-502
+ */
+ @Test
+ public void testReplacePlaceholdersEL_0() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("some-{1}-${requestScope.someVariable}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "some-value1-${requestScope.someVariable}.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "some-value1-${requestScope.someVariable}.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ * See TILES-574
+ */
+ @Test
+ public void testReplacePlaceholdersEL_1() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("some-{1}-${requestScope.someVariable}-other-{2}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "some-value1-${requestScope.someVariable}-other-value2.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "some-value1-${requestScope.someVariable}-other-value2.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ * See TILES-574
+ */
+ @Test
+ public void testReplacePlaceholdersEL_2() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("some-${requestScope.someVariable}-other-{1}-${requestScope.someOtherVariable}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "some-${requestScope.someVariable}-other-value1-${requestScope.someOtherVariable}.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "some-${requestScope.someVariable}-other-value1-${requestScope.someOtherVariable}.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersEL_conditional() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("{1}/some-other-{2}-${requestScope.someBoolean ? 'a' : 'b'}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "value1/some-other-value2-${requestScope.someBoolean ? 'a' : 'b'}.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "value1/some-other-value2-${requestScope.someBoolean ? 'a' : 'b'}.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersEL_twice() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("some-${requestScope.firstVariable}-${requestScope.secondVariable}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "some-${requestScope.firstVariable}-${requestScope.secondVariable}.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "some-${requestScope.firstVariable}-${requestScope.secondVariable}.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+
+ /**
+ * Test method for
+ * {@link PatternUtil#replacePlaceholders(Definition, String, Object[])}.
+ */
+ @Test
+ public void testReplacePlaceholdersEL_options() {
+ Map<String, Attribute> attributes = new HashMap<>();
+ Attribute attribute = new Attribute("{1}/{options[my_fallback}}/some-other-{2}-${requestScope.someVariable}.jsp");
+ attribute.setExpressionObject(new Expression((String)attribute.getValue()));
+ attributes.put("something", attribute);
+ Definition definition = new Definition("definitionName", new Attribute("template"), attributes);
+ Definition nudef = PatternUtil.replacePlaceholders(definition, "nudef", "value0", "value1", "value2", "value3");
+ assertEquals("nudef", nudef.getName());
+
+ assertEquals(
+ "value1/{options[my_fallback}}/some-other-value2-${requestScope.someVariable}.jsp",
+ nudef.getAttribute("something").getValue());
+
+ assertEquals(
+ "value1/{options[my_fallback}}/some-other-value2-${requestScope.someVariable}.jsp",
+ nudef.getAttribute("something").getExpressionObject().getExpression());
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolverTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolverTest.java
new file mode 100644
index 000000000..bdeaca258
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolverTest.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.pattern;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link PrefixedPatternDefinitionResolver}.
+ */
+public class PrefixedPatternDefinitionResolverTest {
+
+ /**
+ * Test method for {@link PrefixedPatternDefinitionResolver#addDefinitionsAsPatternMatchers(List, Map)}.
+ */
+ @Test
+ public void testAddDefinitionsAsPatternMatchers() {
+ DefinitionPatternMatcherFactory factory1 = createMock(DefinitionPatternMatcherFactory.class);
+ DefinitionPatternMatcherFactory factory2 = createMock(DefinitionPatternMatcherFactory.class);
+ DefinitionPatternMatcher matcher1 = createMock(DefinitionPatternMatcher.class);
+ DefinitionPatternMatcher matcher2 = createMock(DefinitionPatternMatcher.class);
+ Definition definition1 = new Definition("DF1:definition1", null, null);
+ Definition definition2 = new Definition("DF2:definition2", null, null);
+ Definition definition3 = new Definition("noLanguageHere", null, null);
+
+ expect(factory1.createDefinitionPatternMatcher("definition1", definition1)).andReturn(matcher1);
+ expect(factory2.createDefinitionPatternMatcher("definition2", definition2)).andReturn(matcher2);
+
+ replay(factory1, factory2, matcher1, matcher2);
+
+ PrefixedPatternDefinitionResolver<Integer> resolver = new PrefixedPatternDefinitionResolver<>();
+ resolver.registerDefinitionPatternMatcherFactory("DF1", factory1);
+ resolver.registerDefinitionPatternMatcherFactory("DF2", factory2);
+ List<DefinitionPatternMatcher> matchers = new ArrayList<>();
+ Map<String, Definition> definitions = new LinkedHashMap<>();
+ definitions.put("DF1:definition1", definition1);
+ definitions.put("DF2:definition2", definition2);
+ definitions.put("noLanguageHere", definition3);
+
+ resolver.addDefinitionsAsPatternMatchers(matchers, definitions);
+
+ assertEquals(2, matchers.size());
+ assertEquals(matcher1, matchers.get(0));
+ assertEquals(matcher2, matchers.get(1));
+
+ verify(factory1, factory2, matcher1, matcher2);
+ }
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactoryTest.java
similarity index 59%
copy from plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactoryTest.java
index 3cbffaf99..35e9826cb 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactory.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherFactoryTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -21,18 +19,31 @@
package org.apache.tiles.core.definition.pattern.regexp;
import org.apache.tiles.api.Definition;
-import org.apache.tiles.core.definition.pattern.DefinitionPatternMatcher;
-import org.apache.tiles.core.definition.pattern.DefinitionPatternMatcherFactory;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertTrue;
/**
- * Creates instances of {@link RegexpDefinitionPatternMatcher}.
+ * Tests {@link RegexpDefinitionPatternMatcherFactory}.
*/
-public class RegexpDefinitionPatternMatcherFactory implements DefinitionPatternMatcherFactory {
+public class RegexpDefinitionPatternMatcherFactoryTest {
/**
- * {@inheritDoc}
+ * The object to test.
*/
- public DefinitionPatternMatcher createDefinitionPatternMatcher(String pattern, Definition definition) {
- return new RegexpDefinitionPatternMatcher(pattern, definition);
+ private RegexpDefinitionPatternMatcherFactory factory;
+
+ /**
+ * Sets up the object to test.
+ */
+ @Before
+ public void setUp() {
+ factory = new RegexpDefinitionPatternMatcherFactory();
+ }
+
+ @Test
+ public void testCreateDefinitionPatternMatcher() {
+ assertTrue(factory.createDefinitionPatternMatcher("myPattern", new Definition()) instanceof RegexpDefinitionPatternMatcher);
}
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherTest.java
new file mode 100644
index 000000000..291918fc2
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/regexp/RegexpDefinitionPatternMatcherTest.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.definition.pattern.regexp;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.core.definition.pattern.DefinitionPatternMatcher;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests {@link RegexpDefinitionPatternMatcher}.
+ */
+public class RegexpDefinitionPatternMatcherTest {
+
+ @Test
+ public void testResolveDefinition() {
+ Definition def = new Definition();
+ def.setName("testDef(.*)\\.message(.*)");
+ def.setTemplateAttribute(Attribute.createTemplateAttribute("/test{1}.jsp"));
+ def.putAttribute("body", new Attribute("message{2}"));
+ DefinitionPatternMatcher patternMatcher = new RegexpDefinitionPatternMatcher("testDef(.*)\\.message(.*)", def);
+ Definition result = patternMatcher.createDefinition("testDefOne.messageTwo");
+ assertNotNull(result);
+ assertEquals("testDefOne.messageTwo", result.getName());
+ assertEquals("/testOne.jsp", result.getTemplateAttribute().getValue());
+ assertEquals("messageTwo", result.getAttribute("body").getValue());
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactoryTest.java
new file mode 100644
index 000000000..dc98f2033
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherFactoryTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.pattern.wildcard;
+
+import org.apache.tiles.api.Definition;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests {@link WildcardDefinitionPatternMatcherFactory}.
+ */
+public class WildcardDefinitionPatternMatcherFactoryTest {
+
+ /**
+ * The object to test.
+ */
+ private WildcardDefinitionPatternMatcherFactory factory;
+
+ /**
+ * Sets up the object to test.
+ */
+ @Before
+ public void setUp() {
+ factory = new WildcardDefinitionPatternMatcherFactory();
+ }
+
+ @Test
+ public void testCreateDefinitionPatternMatcher() {
+ assertTrue(factory.createDefinitionPatternMatcher("myPattern", new Definition()) instanceof WildcardDefinitionPatternMatcher);
+ }
+
+ /**
+ * Test method for {@link WildcardDefinitionPatternMatcherFactory#isPatternRecognized(String)}.
+ */
+ @Test
+ public void testIsPatternRecognized() {
+ assertTrue(factory.isPatternRecognized("my*pattern"));
+ assertFalse(factory.isPatternRecognized("mypattern"));
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherTest.java
new file mode 100644
index 000000000..90eea7eb6
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/definition/pattern/wildcard/WildcardDefinitionPatternMatcherTest.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.definition.pattern.wildcard;
+
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.core.definition.pattern.DefinitionPatternMatcher;
+import org.apache.tiles.core.util.WildcardHelper;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+/**
+ * Tests {@link WildcardDefinitionPatternMatcher}.
+ */
+public class WildcardDefinitionPatternMatcherTest {
+
+ /**
+ * Test method for {@link WildcardDefinitionPatternMatcher#createDefinition(String)}.
+ */
+ @Test
+ public void testResolveDefinition() {
+ Definition def = new Definition();
+ def.setName("testDef*.message*");
+ def.setTemplateAttribute(Attribute.createTemplateAttribute("/test{1}.jsp"));
+ def.putAttribute("body", new Attribute("message{2}"));
+ DefinitionPatternMatcher patternMatcher = new WildcardDefinitionPatternMatcher("testDef*.message*", def, new WildcardHelper());
+ Definition result = patternMatcher.createDefinition("testDefOne.messageTwo");
+ assertNotNull(result);
+ assertEquals("testDefOne.messageTwo", result.getName());
+ assertEquals("/testOne.jsp", result.getTemplateAttribute().getValue());
+ assertEquals("messageTwo", result.getAttribute("body").getValue());
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactoryTest.java
new file mode 100644
index 000000000..ccba2299b
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/BasicAttributeEvaluatorFactoryTest.java
@@ -0,0 +1,85 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.evaluator;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Expression;
+import org.junit.Test;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertSame;
+
+/**
+ * Tests {@link BasicAttributeEvaluatorFactory}.
+ */
+public class BasicAttributeEvaluatorFactoryTest {
+
+ /**
+ * Test method for {@link BasicAttributeEvaluatorFactory#getAttributeEvaluator(String)}.
+ */
+ @Test
+ public void testGetAttributeEvaluatorString() {
+ AttributeEvaluator defaultEvaluator = createMock(AttributeEvaluator.class);
+ AttributeEvaluator evaluator1 = createMock(AttributeEvaluator.class);
+ AttributeEvaluator evaluator2 = createMock(AttributeEvaluator.class);
+ replay(defaultEvaluator, evaluator1, evaluator2);
+ BasicAttributeEvaluatorFactory factory = new BasicAttributeEvaluatorFactory(defaultEvaluator);
+ factory.registerAttributeEvaluator("LANG1", evaluator1);
+ factory.registerAttributeEvaluator("LANG2", evaluator2);
+ assertSame(evaluator1, factory.getAttributeEvaluator("LANG1"));
+ assertSame(evaluator2, factory.getAttributeEvaluator("LANG2"));
+ assertSame(defaultEvaluator, factory.getAttributeEvaluator("LANG3"));
+ verify(defaultEvaluator, evaluator1, evaluator2);
+ }
+
+ /**
+ * Test method for {@link BasicAttributeEvaluatorFactory#getAttributeEvaluator(Attribute)}.
+ */
+ @Test
+ public void testGetAttributeEvaluatorAttribute() {
+ AttributeEvaluator defaultEvaluator = createMock(AttributeEvaluator.class);
+ AttributeEvaluator evaluator1 = createMock(AttributeEvaluator.class);
+ AttributeEvaluator evaluator2 = createMock(AttributeEvaluator.class);
+ replay(defaultEvaluator, evaluator1, evaluator2);
+ BasicAttributeEvaluatorFactory factory = new BasicAttributeEvaluatorFactory(defaultEvaluator);
+ factory.registerAttributeEvaluator("LANG1", evaluator1);
+ factory.registerAttributeEvaluator("LANG2", evaluator2);
+ assertSame(evaluator1, factory
+ .getAttributeEvaluator(createExpressionAttribute("LANG1")));
+ assertSame(evaluator2, factory
+ .getAttributeEvaluator(createExpressionAttribute("LANG2")));
+ assertSame(defaultEvaluator, factory
+ .getAttributeEvaluator(createExpressionAttribute("LANG3")));
+ verify(defaultEvaluator, evaluator1, evaluator2);
+ }
+
+ /**
+ * Creates a sample attribute with an expression.
+ *
+ * @param language The expression language.
+ * @return The attribute.
+ */
+ private Attribute createExpressionAttribute(String language) {
+ return new Attribute(null, Expression.createExpression("myExpression", language), null, "string");
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/EvaluatorExceptionTest.java
similarity index 60%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/EvaluatorExceptionTest.java
index fc26afeb0..d3fc07215 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/EvaluatorExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,44 +17,35 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.evaluator;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
/**
- * Tests {@link TilesException}.
+ * Tests {@link EvaluationException}.
*/
-public class TilesExceptionTest {
-
- @Test
- public void testTilesException() {
- TilesException exception = new TilesException();
- assertNull(exception.getMessage());
- assertNull(exception.getCause());
- }
-
- @Test
- public void testTilesExceptionString() {
- TilesException exception = new TilesException("my message");
- assertEquals("my message", exception.getMessage());
- assertNull(exception.getCause());
- }
+public class EvaluatorExceptionTest {
+ /**
+ * Test method for {@link EvaluationException#EvaluationException(Throwable)}.
+ */
@Test
- public void testTilesExceptionThrowable() {
+ public void testEvaluationExceptionThrowable() {
Throwable cause = new Throwable();
- TilesException exception = new TilesException(cause);
+ EvaluationException exception = new EvaluationException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
}
+ /**
+ * Test method for {@link EvaluationException#EvaluationException(String, Throwable)}.
+ */
@Test
- public void testTilesExceptionStringThrowable() {
+ public void testEvaluationExceptionStringThrowable() {
Throwable cause = new Throwable();
- TilesException exception = new TilesException("my message", cause);
+ EvaluationException exception = new EvaluationException("my message", cause);
assertEquals("my message", exception.getMessage());
assertEquals(cause, exception.getCause());
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluatorTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluatorTest.java
new file mode 100644
index 000000000..1af84a7d0
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/evaluator/impl/DirectAttributeEvaluatorTest.java
@@ -0,0 +1,84 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.evaluator.impl;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.Expression;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link DirectAttributeEvaluator}.
+ */
+public class DirectAttributeEvaluatorTest {
+
+ /**
+ * The evaluator to test.
+ */
+ private DirectAttributeEvaluator evaluator;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ evaluator = new DirectAttributeEvaluator();
+ }
+
+ /**
+ * Tests
+ * {@link DirectAttributeEvaluator#evaluate(Attribute, org.apache.tiles.request.Request)}.
+ */
+ @Test
+ public void testEvaluate() {
+ String expression = "This is an expression";
+ Attribute attribute = new Attribute(null, Expression.createExpression(expression, null), null, null);
+ Object result = evaluator.evaluate(attribute, null);
+ assertEquals("The expression has not been evaluated correctly", result, expression);
+ expression = "${attributeName}";
+ attribute.setExpressionObject(new Expression(expression));
+ result = evaluator.evaluate(attribute, null);
+ assertEquals("The expression has not been evaluated correctly", result, expression);
+ }
+
+ /**
+ * Tests
+ * {@link DirectAttributeEvaluator#evaluate(Attribute, org.apache.tiles.request.Request)}.
+ */
+ @Test(expected = IllegalArgumentException.class)
+ public void testEvaluateNullAttribute() {
+ evaluator.evaluate((Attribute) null, null);
+ }
+
+ /**
+ * Tests
+ * {@link DirectAttributeEvaluator#evaluate(String, org.apache.tiles.request.Request)}.
+ */
+ @Test
+ public void testEvaluateString() {
+ String expression = "This is an expression";
+ Object result = evaluator.evaluate(expression, null);
+ assertEquals("The expression has not been evaluated correctly", result, expression);
+ expression = "${attributeName}";
+ result = evaluator.evaluate(expression, null);
+ assertEquals("The expression has not been evaluated correctly", result, expression);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicPreparerFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicPreparerFactoryTest.java
new file mode 100644
index 000000000..0e5ffed61
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicPreparerFactoryTest.java
@@ -0,0 +1,72 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.factory;
+
+import junit.framework.TestCase;
+import org.apache.tiles.api.AttributeContext;
+import org.apache.tiles.api.preparer.ViewPreparer;
+import org.apache.tiles.core.prepare.factory.BasicPreparerFactory;
+import org.apache.tiles.request.Request;
+
+/**
+ * Tests the basic preparer factory.
+ */
+public class BasicPreparerFactoryTest extends TestCase {
+
+ /**
+ * The preparer factory.
+ */
+ private BasicPreparerFactory factory;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public void setUp() {
+ factory = new BasicPreparerFactory();
+ }
+
+ /**
+ * Tests getting a preparer.
+ */
+ public void testGetPreparer() {
+ String name = MockViewPreparer.class.getName();
+ ViewPreparer p = factory.getPreparer(name, null);
+ assertNotNull(p);
+ assertTrue(p instanceof MockViewPreparer);
+
+ name = "org.doesnotexist.Class";
+ p = factory.getPreparer(name, null);
+ assertNull(p);
+ }
+
+ /**
+ * Mock view preparer.
+ *
+ * @version $Rev$ $Date$
+ */
+ public static class MockViewPreparer implements ViewPreparer {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute(Request tilesContext, AttributeContext attributeContext) {
+ }
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicTilesContainerFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicTilesContainerFactoryTest.java
new file mode 100644
index 000000000..788584650
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/BasicTilesContainerFactoryTest.java
@@ -0,0 +1,252 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.factory;
+
+import junit.framework.TestCase;
+import org.apache.tiles.api.TilesContainer;
+import org.apache.tiles.core.definition.DefinitionsFactory;
+import org.apache.tiles.core.definition.DefinitionsReader;
+import org.apache.tiles.core.definition.UnresolvingLocaleDefinitionsFactory;
+import org.apache.tiles.core.definition.digester.DigesterDefinitionsReader;
+import org.apache.tiles.core.evaluator.AttributeEvaluatorFactory;
+import org.apache.tiles.core.evaluator.impl.DirectAttributeEvaluator;
+import org.apache.tiles.core.impl.BasicTilesContainer;
+import org.apache.tiles.core.locale.LocaleResolver;
+import org.apache.tiles.core.locale.impl.DefaultLocaleResolver;
+import org.apache.tiles.core.prepare.factory.BasicPreparerFactory;
+import org.apache.tiles.core.prepare.factory.PreparerFactory;
+import org.apache.tiles.core.renderer.DefinitionRenderer;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.ApplicationResource;
+import org.apache.tiles.request.locale.URLApplicationResource;
+import org.apache.tiles.request.render.BasicRendererFactory;
+import org.apache.tiles.request.render.ChainedDelegateRenderer;
+import org.apache.tiles.request.render.DispatchRenderer;
+import org.apache.tiles.request.render.Renderer;
+import org.apache.tiles.request.render.RendererFactory;
+import org.apache.tiles.request.render.StringRenderer;
+
+import java.util.List;
+import java.util.Objects;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+
+/**
+ * Tests {@link BasicTilesContainerFactory}.
+ */
+public class BasicTilesContainerFactoryTest extends TestCase {
+
+ /**
+ * The factory to test.
+ */
+ private BasicTilesContainerFactory factory;
+
+ /**
+ * The context object.
+ */
+ private ApplicationContext applicationContext;
+
+ /**
+ * The resource to load.
+ */
+ private ApplicationResource resource;
+
+ /** {@inheritDoc} */
+ @Override
+ protected void setUp() throws Exception {
+ applicationContext = createMock(ApplicationContext.class);
+ resource = new URLApplicationResource(
+ "/org/apache/tiles/core/config/tiles-defs.xml",
+ Objects.requireNonNull(getClass().getResource("/org/apache/tiles/core/config/tiles-defs.xml"))
+ );
+ expect(applicationContext.getResource("/WEB-INF/tiles.xml")).andReturn(resource);
+ replay(applicationContext);
+ factory = new BasicTilesContainerFactory();
+ }
+
+ /**
+ * Tests {@link BasicTilesContainerFactory#createContainer(ApplicationContext)}.
+ */
+ public void testCreateContainer() {
+ TilesContainer container = factory.createContainer(applicationContext);
+ assertTrue("The class of the container is not correct", container instanceof BasicTilesContainer);
+ }
+
+ /**
+ * Tests {@link BasicTilesContainerFactory#createDefinitionsFactory(
+ * ApplicationContext, LocaleResolver)}.
+ */
+ public void testCreateDefinitionsFactory() {
+ LocaleResolver resolver = factory.createLocaleResolver(applicationContext);
+ DefinitionsFactory defsFactory = factory.createDefinitionsFactory(applicationContext, resolver);
+ assertTrue("The class of the definitions factory is not correct",
+ defsFactory instanceof UnresolvingLocaleDefinitionsFactory);
+ }
+
+ /**
+ * Tests {@link BasicTilesContainerFactory#createLocaleResolver(
+ * ApplicationContext)}.
+ */
+ public void testCreateLocaleResolver() {
+ LocaleResolver localeResolver = factory.createLocaleResolver(applicationContext);
+ assertTrue("The class of the locale resolver is not correct", localeResolver instanceof DefaultLocaleResolver);
+ }
+
+ /**
+ * Tests {@link BasicTilesContainerFactory#createDefinitionsReader(
+ * ApplicationContext)}.
+ */
+ public void testCreateDefinitionsReader() {
+ DefinitionsReader reader = factory.createDefinitionsReader(applicationContext);
+ assertTrue("The class of the reader is not correct", reader instanceof DigesterDefinitionsReader);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#getSources(ApplicationContext)}.
+ */
+ public void testGetSources() {
+ List<ApplicationResource> resources = factory.getSources(applicationContext);
+ assertEquals("The urls list is not one-sized", 1, resources.size());
+ assertEquals("The URL is not correct", resource, resources.get(0));
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createAttributeEvaluatorFactory(
+ * ApplicationContext, LocaleResolver)}.
+ */
+ public void testCreateAttributeEvaluatorFactory() {
+ LocaleResolver resolver = factory.createLocaleResolver(applicationContext);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = factory.createAttributeEvaluatorFactory(
+ applicationContext, resolver);
+ assertTrue("The class of the evaluator is not correct",
+ attributeEvaluatorFactory.getAttributeEvaluator((String) null) instanceof DirectAttributeEvaluator);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createPreparerFactory(ApplicationContext)}.
+ */
+ public void testCreatePreparerFactory() {
+ PreparerFactory preparerFactory = factory.createPreparerFactory(applicationContext);
+ assertTrue("The class of the preparer factory is not correct", preparerFactory instanceof BasicPreparerFactory);
+ }
+
+ /**
+ * Tests {@link BasicTilesContainerFactory#createRendererFactory(
+ * ApplicationContext, TilesContainer, AttributeEvaluatorFactory)}.
+ */
+ public void testCreateRendererFactory() {
+ TilesContainer container = factory.createContainer(applicationContext);
+ LocaleResolver resolver = factory.createLocaleResolver(applicationContext);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = factory.createAttributeEvaluatorFactory(
+ applicationContext, resolver);
+ RendererFactory rendererFactory = factory.createRendererFactory(applicationContext, container,
+ attributeEvaluatorFactory);
+ assertTrue("The class of the renderer factory is not correct", rendererFactory instanceof BasicRendererFactory);
+ Renderer renderer = rendererFactory.getRenderer("string");
+ assertNotNull("The string renderer is null", renderer);
+ assertTrue("The string renderer class is not correct", renderer instanceof StringRenderer);
+ renderer = rendererFactory.getRenderer("template");
+ assertNotNull("The template renderer is null", renderer);
+ assertTrue("The template renderer class is not correct", renderer instanceof DispatchRenderer);
+ renderer = rendererFactory.getRenderer("definition");
+ assertNotNull("The definition renderer is null", renderer);
+ assertTrue("The definition renderer class is not correct", renderer instanceof DefinitionRenderer);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createDefaultAttributeRenderer(BasicRendererFactory,
+ * ApplicationContext, TilesContainer, AttributeEvaluatorFactory)}.
+ */
+ public void testCreateDefaultAttributeRenderer() {
+ TilesContainer container = createMock(TilesContainer.class);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
+ BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
+ Renderer stringRenderer = createMock(Renderer.class);
+ Renderer templateRenderer = createMock(Renderer.class);
+ Renderer definitionRenderer = createMock(Renderer.class);
+
+ expect(rendererFactory.getRenderer("string")).andReturn(stringRenderer);
+ expect(rendererFactory.getRenderer("template")).andReturn(templateRenderer);
+ expect(rendererFactory.getRenderer("definition")).andReturn(definitionRenderer);
+
+ replay(container, attributeEvaluatorFactory, rendererFactory);
+ Renderer renderer = factory.createDefaultAttributeRenderer(rendererFactory, applicationContext, container,
+ attributeEvaluatorFactory);
+ assertTrue("The default renderer class is not correct", renderer instanceof ChainedDelegateRenderer);
+ verify(container, attributeEvaluatorFactory, rendererFactory);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createStringAttributeRenderer(BasicRendererFactory,
+ * ApplicationContext, TilesContainer, AttributeEvaluatorFactory)}.
+ */
+ public void testCreateStringAttributeRenderer() {
+ TilesContainer container = createMock(TilesContainer.class);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
+ BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
+
+ replay(container, attributeEvaluatorFactory, rendererFactory);
+ Renderer renderer = factory.createStringAttributeRenderer(rendererFactory, applicationContext, container,
+ attributeEvaluatorFactory);
+ assertTrue("The renderer class is not correct", renderer instanceof StringRenderer);
+ verify(container, attributeEvaluatorFactory, rendererFactory);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createTemplateAttributeRenderer(BasicRendererFactory,
+ * ApplicationContext, TilesContainer, AttributeEvaluatorFactory)}.
+ */
+ public void testCreateTemplateAttributeRenderer() {
+ TilesContainer container = createMock(TilesContainer.class);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
+ BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
+
+ replay(container, attributeEvaluatorFactory, rendererFactory);
+ Renderer renderer = factory.createTemplateAttributeRenderer(rendererFactory, applicationContext, container,
+ attributeEvaluatorFactory);
+ assertTrue("The renderer class is not correct", renderer instanceof DispatchRenderer);
+ verify(container, attributeEvaluatorFactory, rendererFactory);
+ }
+
+ /**
+ * Tests
+ * {@link BasicTilesContainerFactory#createDefinitionAttributeRenderer(BasicRendererFactory,
+ * ApplicationContext, TilesContainer, AttributeEvaluatorFactory)}.
+ */
+ public void testCreateDefinitionAttributeRenderer() {
+ TilesContainer container = createMock(TilesContainer.class);
+ AttributeEvaluatorFactory attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
+ BasicRendererFactory rendererFactory = createMock(BasicRendererFactory.class);
+
+ replay(container, attributeEvaluatorFactory, rendererFactory);
+ Renderer renderer = factory.createDefinitionAttributeRenderer(rendererFactory, applicationContext, container,
+ attributeEvaluatorFactory);
+ assertTrue("The renderer class is not correct", renderer instanceof DefinitionRenderer);
+ verify(container, attributeEvaluatorFactory, rendererFactory);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/NoSuchPreparerExceptionTest.java
similarity index 70%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/factory/NoSuchPreparerExceptionTest.java
index 777ecd57c..2255f1667 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/NoSuchPreparerExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,21 +17,25 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.factory;
+import org.apache.tiles.core.prepare.factory.NoSuchPreparerException;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link NoSuchContainerException}.
+ * Tests {@link NoSuchPreparerException}.
*/
-public class NoSuchContainerExceptionTest {
+public class NoSuchPreparerExceptionTest {
+ /**
+ * Test method for {@link NoSuchPreparerException#NoSuchPreparerException(String)}.
+ */
@Test
- public void testNoSuchContainerExceptionString() {
- NoSuchContainerException exception = new NoSuchContainerException("my message");
+ public void testNoSuchPreparerExceptionString() {
+ NoSuchPreparerException exception = new NoSuchPreparerException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/TilesContainerFactoryExceptionTest.java
similarity index 64%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/factory/TilesContainerFactoryExceptionTest.java
index 777ecd57c..bc1aaec3d 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/NoSuchContainerExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/factory/TilesContainerFactoryExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,23 +17,26 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.factory;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
/**
- * Tests {@link NoSuchContainerException}.
+ * Tests {@link TilesContainerFactoryException}.
*/
-public class NoSuchContainerExceptionTest {
+public class TilesContainerFactoryExceptionTest {
+ /**
+ * Test method for {@link TilesContainerFactoryException#TilesContainerFactoryException(String, Throwable)}.
+ */
@Test
- public void testNoSuchContainerExceptionString() {
- NoSuchContainerException exception = new NoSuchContainerException("my message");
+ public void testTilesContainerFactoryExceptionStringThrowable() {
+ Throwable cause = new Throwable();
+ TilesContainerFactoryException exception = new TilesContainerFactoryException("my message", cause);
assertEquals("my message", exception.getMessage());
- assertNull(exception.getCause());
+ assertEquals(cause, exception.getCause());
}
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerTest.java
new file mode 100644
index 000000000..2e7328481
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerTest.java
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.impl;
+
+import junit.framework.TestCase;
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.core.factory.AbstractTilesContainerFactory;
+import org.apache.tiles.core.factory.BasicTilesContainerFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.locale.URLApplicationResource;
+import org.apache.tiles.request.render.CannotRenderException;
+import org.easymock.EasyMock;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Objects;
+
+public class BasicTilesContainerTest extends TestCase {
+
+ /**
+ * A sample integer value to check object rendering.
+ */
+ private static final int SAMPLE_INT = 15;
+
+ /**
+ * The container.
+ */
+ private BasicTilesContainer container;
+
+ @Override
+ public void setUp() {
+ ApplicationContext context = EasyMock.createMock(ApplicationContext.class);
+ URLApplicationResource resource = new URLApplicationResource(
+ "/WEB-INF/tiles.xml",
+ Objects.requireNonNull(getClass().getResource("/org/apache/tiles/core/factory/test-defs.xml"))
+ );
+
+ EasyMock.expect(context.getResource("/WEB-INF/tiles.xml")).andReturn(resource);
+ EasyMock.replay(context);
+ AbstractTilesContainerFactory factory = new BasicTilesContainerFactory();
+ container = (BasicTilesContainer) factory.createContainer(context);
+ }
+
+ /**
+ * Tests basic Tiles container initialization.
+ */
+ public void testInitialization() {
+ assertNotNull(container);
+ }
+
+ /**
+ * Tests that attributes of type "object" won't be rendered.
+ *
+ * @throws IOException If something goes wrong, but it's not a Tiles
+ * exception.
+ */
+ public void testObjectAttribute() throws IOException {
+ Attribute attribute = new Attribute();
+ Request request = EasyMock.createMock(Request.class);
+ EasyMock.replay(request);
+ boolean exceptionFound = false;
+
+ attribute.setValue(SAMPLE_INT);
+ try {
+ container.render(attribute, request);
+ } catch (CannotRenderException e) {
+ exceptionFound = true;
+ }
+
+ assertTrue("An attribute of 'object' type cannot be rendered", exceptionFound);
+ }
+
+ /**
+ * Tests is attributes are rendered correctly according to users roles.
+ *
+ * @throws IOException If a problem arises during rendering or writing in the writer.
+ */
+ public void testAttributeCredentials() throws IOException {
+ Request request = EasyMock.createMock(Request.class);
+ EasyMock.expect(request.isUserInRole("myrole")).andReturn(Boolean.TRUE);
+ StringWriter writer = new StringWriter();
+ EasyMock.expect(request.getWriter()).andReturn(writer);
+ EasyMock.replay(request);
+ Attribute attribute = new Attribute("This is the value", "myrole");
+ attribute.setRenderer("string");
+ container.render(attribute, request);
+ writer.close();
+ assertEquals("The attribute should have been rendered", "This is the value", writer.toString());
+ EasyMock.reset(request);
+ request = EasyMock.createMock(Request.class);
+ EasyMock.expect(request.isUserInRole("myrole")).andReturn(Boolean.FALSE);
+ EasyMock.replay(request);
+ writer = new StringWriter();
+ container.render(attribute, request);
+ writer.close();
+ assertNotSame("The attribute should have not been rendered", "This is the value", writer.toString());
+ }
+
+ /**
+ * Tests {@link BasicTilesContainer#evaluate(Attribute, Request)}.
+ */
+ public void testEvaluate() {
+ Request request = EasyMock.createMock(Request.class);
+ EasyMock.replay(request);
+ Attribute attribute = new Attribute("This is the value");
+ Object value = container.evaluate(attribute, request);
+ assertEquals("The attribute has not been evaluated correctly", "This is the value", value);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerUnitTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerUnitTest.java
new file mode 100644
index 000000000..7f4c9d0c4
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/BasicTilesContainerUnitTest.java
@@ -0,0 +1,836 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.impl;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.AttributeContext;
+import org.apache.tiles.api.BasicAttributeContext;
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.preparer.ViewPreparer;
+import org.apache.tiles.core.definition.DefinitionsFactory;
+import org.apache.tiles.core.definition.NoSuchDefinitionException;
+import org.apache.tiles.core.evaluator.AttributeEvaluator;
+import org.apache.tiles.core.evaluator.AttributeEvaluatorFactory;
+import org.apache.tiles.core.prepare.factory.NoSuchPreparerException;
+import org.apache.tiles.core.prepare.factory.PreparerFactory;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.render.CannotRenderException;
+import org.apache.tiles.request.render.NoSuchRendererException;
+import org.apache.tiles.request.render.Renderer;
+import org.apache.tiles.request.render.RendererFactory;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.util.Deque;
+import java.util.LinkedList;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests {@link BasicTilesContainer}.
+ */
+public class BasicTilesContainerUnitTest {
+
+ /**
+ * Name used to store attribute context stack.
+ */
+ private static final String ATTRIBUTE_CONTEXT_STACK =
+ "org.apache.tiles.AttributeContext.STACK";
+
+ /**
+ * The application context.
+ */
+ private ApplicationContext applicationContext;
+
+ /**
+ * The definitions factory.
+ */
+ private DefinitionsFactory definitionsFactory;
+
+ /**
+ * The preparer factory.
+ */
+ private PreparerFactory preparerFactory;
+
+ /**
+ * The renderer factory.
+ */
+ private RendererFactory rendererFactory;
+
+ /**
+ * The evaluator factory.
+ */
+ private AttributeEvaluatorFactory attributeEvaluatorFactory;
+
+ /**
+ * The container to test.
+ */
+ private BasicTilesContainer container;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ applicationContext = createMock(ApplicationContext.class);
+ definitionsFactory = createMock(DefinitionsFactory.class);
+ preparerFactory = createMock(PreparerFactory.class);
+ rendererFactory = createMock(RendererFactory.class);
+ attributeEvaluatorFactory = createMock(AttributeEvaluatorFactory.class);
+ container = new BasicTilesContainer();
+ container.setApplicationContext(applicationContext);
+ container.setAttributeEvaluatorFactory(attributeEvaluatorFactory);
+ container.setDefinitionsFactory(definitionsFactory);
+ container.setPreparerFactory(preparerFactory);
+ container.setRendererFactory(rendererFactory);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#startContext(Request)}.
+ */
+ @Test
+ public void testStartContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ expect(attributeContext.getCascadedAttributeNames()).andReturn(null);
+ deque.push(isA(BasicAttributeContext.class));
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ assertTrue(container.startContext(request) instanceof BasicAttributeContext);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#endContext(Request)}.
+ */
+ @Test
+ public void testEndContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.pop()).andReturn(attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ container.endContext(request);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#renderContext(Request)}.
+ *
+ * @throws IOException If something goes wrong.
+ */
+ @Test
+ public void testRenderContext() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ Renderer renderer = createMock(Renderer.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ expect(attributeContext.getPreparer()).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ renderer.render("/mytemplate.jsp", request);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, templateAttribute, renderer);
+ container.renderContext(request);
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, templateAttribute, renderer);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getApplicationContext()}.
+ */
+ @Test
+ public void testGetApplicationContext() {
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory);
+ assertEquals(applicationContext, container.getApplicationContext());
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getAttributeContext(Request)}.
+ */
+ @Test
+ public void testGetAttributeContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ assertEquals(attributeContext, container.getAttributeContext(request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getAttributeContext(Request)}.
+ */
+ @Test
+ public void testGetAttributeContextNew() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope).times(2);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque).times(2);
+ expect(deque.isEmpty()).andReturn(true);
+ deque.push(isA(BasicAttributeContext.class));
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ assertTrue(container.getAttributeContext(request) instanceof BasicAttributeContext);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#prepare(String, Request)}.
+ */
+ @Test
+ public void testPrepare() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+
+ expect(preparerFactory.getPreparer("preparer", request)).andReturn(preparer);
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ preparer.execute(request, attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer);
+ container.prepare("preparer", request);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#prepare(String, Request)}.
+ */
+ @Test(expected = NoSuchPreparerException.class)
+ public void testPrepareException() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(preparerFactory.getPreparer("preparer", request)).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ try {
+ container.prepare("preparer", request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, requestScope, deque, attributeContext);
+ }
+ }
+
+ @Test
+ public void testRenderStringRequest() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+ Renderer renderer = createMock(Renderer.class);
+ Definition definition = createMock(Definition.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
+
+ expect(definitionsFactory.getDefinition("definition", request)).andReturn(definition);
+ expect(request.getContext("request")).andReturn(requestScope).times(3);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque).times(3);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ expect(attributeContext.getPreparer()).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(attributeContext.getLocalAttributeNames()).andReturn(null);
+ expect(attributeContext.getCascadedAttributeNames()).andReturn(null);
+ expect(definition.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(rendererFactory.getRenderer("template")).andReturn(renderer);
+ deque.push(isA(BasicAttributeContext.class));
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/my/template.jsp");
+ renderer.render("/my/template.jsp", request);
+ expect(deque.pop()).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, renderer, definition);
+ container.render("definition", request);
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, renderer, definition);
+ }
+
+ @Test(expected = NoSuchDefinitionException.class)
+ public void testRenderStringRequestException() {
+ Request request = createMock(Request.class);
+
+ expect(definitionsFactory.getDefinition("definition", request)).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ try {
+ container.render("definition", request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory);
+ }
+ }
+
+ @Test
+ public void testRenderAttributeRequest() throws IOException {
+ Request request = createMock(Request.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ Renderer renderer = createMock(Renderer.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ renderer.render("/mytemplate.jsp", request);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute, renderer);
+ container.render(templateAttribute, request);
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute, renderer);
+ }
+
+ @Test(expected = CannotRenderException.class)
+ public void testRenderAttributeRequestException1() throws IOException {
+ Request request = createMock(Request.class);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ try {
+ container.render((Attribute) null, request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request);
+ }
+ }
+
+ @Test(expected = NoSuchRendererException.class)
+ public void testRenderAttributeRequestException2() throws IOException {
+ Request request = createMock(Request.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ expect(rendererFactory.getRenderer("renderer")).andThrow(new NoSuchRendererException("Boom!"));
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute);
+ try {
+ container.render(templateAttribute, request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, templateAttribute);
+ }
+ }
+
+ @Test(expected = CannotRenderException.class)
+ public void testRenderAttributeRequestException3() throws IOException {
+ Request request = createMock(Request.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+ Renderer renderer = createMock(Renderer.class);
+
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn(1);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute);
+ try {
+ container.render(templateAttribute, request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, templateAttribute);
+ }
+ }
+
+ @Test(expected = NoSuchRendererException.class)
+ public void testRenderAttributeRequestException() throws IOException {
+ Request request = createMock(Request.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ expect(rendererFactory.getRenderer("renderer")).andThrow(new NoSuchRendererException("Boom!"));
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute);
+ try {
+ container.render(templateAttribute, request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, templateAttribute);
+ }
+ }
+
+ @Test
+ public void testEvaluate() {
+ Request request = createMock(Request.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn(1);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute, evaluator);
+ assertEquals(1, container.evaluate(templateAttribute, request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ templateAttribute, evaluator);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#isValidDefinition(String, Request)}.
+ */
+ @Test
+ public void testIsValidDefinition() {
+ Request request = createMock(Request.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(definitionsFactory.getDefinition("definition", request)).andReturn(definition);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request, definition);
+ assertTrue(container.isValidDefinition("definition", request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request, definition);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#isValidDefinition(String, Request)}.
+ */
+ @Test
+ public void testIsValidDefinitionNull() {
+ Request request = createMock(Request.class);
+
+ expect(definitionsFactory.getDefinition("definition", request)).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ assertFalse(container.isValidDefinition("definition", request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#isValidDefinition(String, Request)}.
+ */
+ @Test
+ public void testIsValidDefinitionException() {
+ Request request = createMock(Request.class);
+
+ expect(definitionsFactory.getDefinition("definition", request))
+ .andThrow(new NoSuchDefinitionException("Boom!"));
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ assertFalse(container.isValidDefinition("definition", request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getDefinition(String, Request)}.
+ */
+ @Test
+ public void testGetDefinition() {
+ Request request = createMock(Request.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(definitionsFactory.getDefinition("definition", request)).andReturn(definition);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request, definition);
+ assertEquals(definition, container.getDefinition("definition", request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request, definition);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getContextStack(Request)}.
+ */
+ @Test
+ public void testGetContextStack() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque);
+ assertEquals(deque, container.getContextStack(request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getContextStack(Request)}.
+ */
+ @Test
+ public void testGetContextStackNew() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(null);
+ expect(requestScope.put(eq(ATTRIBUTE_CONTEXT_STACK), isA(LinkedList.class))).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope);
+ assertTrue(container.getContextStack(request) instanceof LinkedList);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope);
+ }
+
+ @Test
+ public void testPushContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ deque.push(attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ container.pushContext(attributeContext, request);
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#popContext(Request)}.
+ */
+ @Test
+ public void testPopContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.pop()).andReturn(attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ assertEquals(attributeContext, container.popContext(request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getContext(Request)}.
+ */
+ @Test
+ public void testGetContext() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ assertEquals(attributeContext, container.getContext(request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext);
+ }
+
+ /**
+ * Test method for {@link BasicTilesContainer#getContext(Request)}.
+ */
+ @Test
+ public void testGetContextNull() {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+
+ expect(request.getContext("request")).andReturn(requestScope);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque);
+ expect(deque.isEmpty()).andReturn(true);
+
+ replay(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque);
+ assertNull(container.getContext(request));
+ verify(applicationContext, attributeEvaluatorFactory,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque);
+ }
+
+ @Test
+ public void testRenderRequestDefinition() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+ Renderer renderer = createMock(Renderer.class);
+ Definition definition = createMock(Definition.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
+
+ expect(request.getContext("request")).andReturn(requestScope).times(3);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque).times(3);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ expect(attributeContext.getPreparer()).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(attributeContext.getLocalAttributeNames()).andReturn(null);
+ expect(attributeContext.getCascadedAttributeNames()).andReturn(null);
+ expect(definition.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(rendererFactory.getRenderer("template")).andReturn(renderer);
+ deque.push(isA(BasicAttributeContext.class));
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/my/template.jsp");
+ renderer.render("/my/template.jsp", request);
+ expect(deque.pop()).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, renderer, definition);
+ container.render(definition, request);
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, renderer, definition);
+ }
+
+ @Test(expected = CannotRenderException.class)
+ public void testRenderRequestDefinitionException() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+ Renderer renderer = createMock(Renderer.class);
+ Definition definition = createMock(Definition.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ Attribute templateAttribute = Attribute.createTemplateAttribute("/my/template.jsp");
+
+ expect(request.getContext("request")).andReturn(requestScope).times(3);
+ expect(requestScope.get(ATTRIBUTE_CONTEXT_STACK)).andReturn(deque).times(3);
+ expect(deque.isEmpty()).andReturn(false);
+ expect(deque.peek()).andReturn(attributeContext);
+ expect(attributeContext.getPreparer()).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(attributeContext.getLocalAttributeNames()).andReturn(null);
+ expect(attributeContext.getCascadedAttributeNames()).andReturn(null);
+ expect(definition.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(rendererFactory.getRenderer("template")).andReturn(renderer);
+ deque.push(isA(BasicAttributeContext.class));
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
+ renderer.render("/mytemplate.jsp", request);
+ expectLastCall().andThrow(new IOException());
+ expect(deque.pop()).andReturn(null);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, renderer, definition);
+ try {
+ container.render(definition, request);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, requestScope, deque, attributeContext, preparer,
+ renderer, definition);
+ }
+ }
+
+ @Test
+ public void testRenderRequestAttributeContext() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ ViewPreparer preparer = createMock(ViewPreparer.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ Renderer renderer = createMock(Renderer.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(attributeContext.getPreparer()).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ renderer.render("/mytemplate.jsp", request);
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, templateAttribute, renderer);
+ container.render(request, attributeContext);
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, preparer, templateAttribute, renderer);
+ }
+
+ @Test(expected = CannotRenderException.class)
+ public void testRenderRequestAttributeContextException() throws IOException {
+ Request request = createMock(Request.class);
+ Map<String, Object> requestScope = createMock(Map.class);
+ Deque<AttributeContext> deque = createMock(Deque.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ Attribute templateAttribute = createMock(Attribute.class);
+ Renderer renderer = createMock(Renderer.class);
+ AttributeEvaluator evaluator = createMock(AttributeEvaluator.class);
+
+ expect(attributeContext.getPreparer()).andReturn("preparer").times(2);
+ expect(preparerFactory.getPreparer("preparer", request)).andReturn(null);
+ expect(attributeContext.getTemplateAttribute()).andReturn(templateAttribute);
+ expect(templateAttribute.getRenderer()).andReturn("renderer");
+ expect(rendererFactory.getRenderer("renderer")).andReturn(renderer);
+ expect(attributeEvaluatorFactory.getAttributeEvaluator(templateAttribute)).andReturn(evaluator);
+ expect(evaluator.evaluate(templateAttribute, request)).andReturn("/mytemplate.jsp");
+ expect(templateAttribute.isPermitted(request)).andReturn(true);
+ renderer.render("/mytemplate.jsp", request);
+ expectLastCall().andThrow(new IOException());
+
+ replay(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory, request,
+ requestScope, deque, attributeContext, templateAttribute, renderer);
+ try {
+ container.render(request, attributeContext);
+ } finally {
+ verify(applicationContext, attributeEvaluatorFactory, evaluator,
+ definitionsFactory, preparerFactory, rendererFactory,
+ request, requestScope, deque, attributeContext,
+ templateAttribute, renderer);
+ }
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/CannotRenderExceptionTest.java
similarity index 59%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/impl/CannotRenderExceptionTest.java
index fc26afeb0..77fb1202b 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/CannotRenderExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,44 +17,36 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.impl;
+import org.apache.tiles.request.render.CannotRenderException;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link TilesException}.
+ * Tests {@link CannotRenderException}.
*/
-public class TilesExceptionTest {
-
- @Test
- public void testTilesException() {
- TilesException exception = new TilesException();
- assertNull(exception.getMessage());
- assertNull(exception.getCause());
- }
+public class CannotRenderExceptionTest {
+ /**
+ * Test method for {@link CannotRenderException#CannotRenderException(String)}.
+ */
@Test
- public void testTilesExceptionString() {
- TilesException exception = new TilesException("my message");
+ public void testCannotRenderExceptionString() {
+ CannotRenderException exception = new CannotRenderException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
+ /**
+ * Test method for {@link CannotRenderException#CannotRenderException(String, Throwable)}.
+ */
@Test
- public void testTilesExceptionThrowable() {
- Throwable cause = new Throwable();
- TilesException exception = new TilesException(cause);
- assertEquals(cause.toString(), exception.getMessage());
- assertEquals(cause, exception.getCause());
- }
-
- @Test
- public void testTilesExceptionStringThrowable() {
+ public void testCannotRenderExceptionStringThrowable() {
Throwable cause = new Throwable();
- TilesException exception = new TilesException("my message", cause);
+ CannotRenderException exception = new CannotRenderException("my message", cause);
assertEquals("my message", exception.getMessage());
assertEquals(cause, exception.getCause());
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/impl/DefaultLocaleResolverTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/DefaultLocaleResolverTest.java
new file mode 100644
index 000000000..8b678ddb1
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/DefaultLocaleResolverTest.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.impl;
+
+import org.apache.tiles.core.locale.impl.DefaultLocaleResolver;
+import org.apache.tiles.request.Request;
+import org.junit.Test;
+
+import java.util.Locale;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertSame;
+
+/**
+ * Tests {@link DefaultLocaleResolver}.
+ */
+public class DefaultLocaleResolverTest {
+
+ /**
+ * Test method for {@link DefaultLocaleResolver#resolveLocale(Request)}.
+ */
+ @Test
+ public void testResolveLocale() {
+ Request request = createMock(Request.class);
+ Map<String, Object> sessionScope = createMock(Map.class);
+ Locale locale = Locale.ITALY;
+
+ expect(request.getContext("session")).andReturn(sessionScope);
+ expect(sessionScope.get(DefaultLocaleResolver.LOCALE_KEY)).andReturn(null);
+ expect(request.getRequestLocale()).andReturn(locale);
+
+ replay(request, sessionScope);
+ DefaultLocaleResolver resolver = new DefaultLocaleResolver();
+ assertSame(locale, resolver.resolveLocale(request));
+ verify(request, sessionScope);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/InvalidTemplateExceptionTest.java
similarity index 59%
copy from plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
copy to plugins/tiles/src/test/java/org/apache/tiles/core/impl/InvalidTemplateExceptionTest.java
index fc26afeb0..60e0e0bb4 100644
--- a/plugins/tiles/src/test/java/org/apache/tiles/api/TilesExceptionTest.java
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/InvalidTemplateExceptionTest.java
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -19,7 +17,7 @@
* under the License.
*/
-package org.apache.tiles.api;
+package org.apache.tiles.core.impl;
import org.junit.Test;
@@ -27,38 +25,29 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
- * Tests {@link TilesException}.
+ * Tests {@link InvalidTemplateException}.
*/
-public class TilesExceptionTest {
-
- @Test
- public void testTilesException() {
- TilesException exception = new TilesException();
- assertNull(exception.getMessage());
- assertNull(exception.getCause());
- }
+public class InvalidTemplateExceptionTest {
+ /**
+ * Test method for {@link InvalidTemplateException#InvalidTemplateException(String)}.
+ */
@Test
- public void testTilesExceptionString() {
- TilesException exception = new TilesException("my message");
+ public void testInvalidTemplateExceptionString() {
+ InvalidTemplateException exception = new InvalidTemplateException("my message");
assertEquals("my message", exception.getMessage());
assertNull(exception.getCause());
}
+ /**
+ * Test method for {@link InvalidTemplateException#InvalidTemplateException(Throwable)}.
+ */
@Test
- public void testTilesExceptionThrowable() {
+ public void testInvalidTemplateExceptionThrowable() {
Throwable cause = new Throwable();
- TilesException exception = new TilesException(cause);
+ InvalidTemplateException exception = new InvalidTemplateException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
}
- @Test
- public void testTilesExceptionStringThrowable() {
- Throwable cause = new Throwable();
- TilesException exception = new TilesException("my message", cause);
- assertEquals("my message", exception.getMessage());
- assertEquals(cause, exception.getCause());
- }
-
}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainerTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainerTest.java
new file mode 100644
index 000000000..d32fcfa2d
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/impl/mgmt/CachingTilesContainerTest.java
@@ -0,0 +1,305 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.impl.mgmt;
+
+import org.apache.tiles.api.Definition;
+import org.apache.tiles.api.TilesContainer;
+import org.apache.tiles.core.definition.NoSuchDefinitionException;
+import org.apache.tiles.request.Request;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests {@link CachingTilesContainer}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class CachingTilesContainerTest {
+
+ /**
+ * The default name of the attribute in which storing custom definitions.
+ */
+ private static final String DEFAULT_DEFINITIONS_ATTRIBUTE_NAME =
+ "org.apache.tiles.impl.mgmt.DefinitionManager.DEFINITIONS";
+
+ /**
+ * The wrapped Tiles container.
+ */
+ private TilesContainer wrapped;
+
+ /**
+ * The Tiles container to test.
+ */
+ private CachingTilesContainer container;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ wrapped = createMock(TilesContainer.class);
+ container = new CachingTilesContainer(wrapped);
+ }
+
+ @Test
+ public void testCachingTilesContainer() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+ TilesContainer wrapped = createMock(TilesContainer.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definitions.get("definition")).andReturn(definition);
+
+ replay(wrapped, request, definitions, scope, definition);
+ CachingTilesContainer container = new CachingTilesContainer(wrapped);
+ assertSame(definition, container.getDefinition("definition", request));
+ verify(wrapped, request, definitions, scope, definition);
+ }
+
+ @Test
+ public void testGetDefinition() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(
+ definitions);
+ expect(definitions.get("definition")).andReturn(definition);
+
+ replay(wrapped, request, definitions, scope, definition);
+ assertSame(definition, container.getDefinition("definition", request));
+ verify(wrapped, request, definitions, scope, definition);
+ }
+
+ @Test
+ public void testGetDefinitionContainer() {
+ Request request = createMock(Request.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(
+ null);
+ expect(wrapped.getDefinition("definition", request)).andReturn(
+ definition);
+
+ replay(wrapped, request, scope, definition);
+ assertSame(definition, container.getDefinition("definition", request));
+ verify(wrapped, request, scope, definition);
+ }
+
+ @Test
+ public void testIsValidDefinition() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definitions.get("definition")).andReturn(definition);
+
+ replay(wrapped, request, definitions, scope, definition);
+ assertTrue(container.isValidDefinition("definition", request));
+ verify(wrapped, request, definitions, scope, definition);
+ }
+
+ @Test
+ public void testIsValidDefinitionContainer() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definitions.get("definition")).andReturn(null);
+ expect(wrapped.isValidDefinition("definition", request)).andReturn(true);
+
+ replay(wrapped, request, definitions, scope);
+ assertTrue(container.isValidDefinition("definition", request));
+ verify(wrapped, request, definitions, scope);
+ }
+
+ @Test
+ public void testRegister() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definition.getName()).andReturn(null);
+ expect(definitions.containsKey("$anonymousMutableDefinition1")).andReturn(false);
+ definition.setName("$anonymousMutableDefinition1");
+ expect(definition.isExtending()).andReturn(true);
+ // trick to test resolve definition separately.
+ expect(definition.isExtending()).andReturn(false);
+ expect(definition.getName()).andReturn("$anonymousMutableDefinition1");
+ expect(definitions.put("$anonymousMutableDefinition1", definition)).andReturn(null);
+
+ replay(wrapped, request, definitions, scope, definition);
+ container.register(definition, request);
+ verify(wrapped, request, definitions, scope, definition);
+ }
+
+ @Test
+ public void testRegisterInheritance() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+ Definition parent = createMock(Definition.class);
+ Definition grandparent = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope).anyTimes();
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(
+ definitions).anyTimes();
+ expect(definition.getName()).andReturn(null);
+ expect(definitions.containsKey("$anonymousMutableDefinition1"))
+ .andReturn(false);
+ definition.setName("$anonymousMutableDefinition1");
+ expect(definition.isExtending()).andReturn(true);
+ // trick to test resolve definition separately.
+ expect(definition.isExtending()).andReturn(true);
+ expect(definition.getExtends()).andReturn("parent");
+ expect(definitions.get("parent")).andReturn(parent);
+ expect(parent.isExtending()).andReturn(true);
+ expect(parent.getExtends()).andReturn("grandparent");
+ expect(definition.getName()).andReturn("$anonymousMutableDefinition1");
+ expect(definitions.get("grandparent")).andReturn(null);
+ expect(wrapped.getDefinition("grandparent", request)).andReturn(
+ grandparent);
+ parent.inherit(grandparent);
+ definition.inherit(parent);
+ expect(definitions.put("$anonymousMutableDefinition1", definition))
+ .andReturn(null);
+
+ replay(wrapped, request, definitions, scope, definition, parent,
+ grandparent);
+ container.register(definition, request);
+ verify(wrapped, request, definitions, scope, definition, parent,
+ grandparent);
+ }
+
+ @Test(expected = NoSuchDefinitionException.class)
+ public void testRegisterInheritanceFail() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope).anyTimes();
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(
+ definitions).anyTimes();
+ expect(definition.getName()).andReturn(null);
+ expect(definitions.containsKey("$anonymousMutableDefinition1"))
+ .andReturn(false);
+ definition.setName("$anonymousMutableDefinition1");
+ expect(definition.isExtending()).andReturn(true);
+ // trick to test resolve definition separately.
+ expect(definition.isExtending()).andReturn(true);
+ expect(definition.getExtends()).andReturn("parent");
+ expect(definitions.get("parent")).andReturn(null);
+ expect(wrapped.getDefinition("parent", request)).andReturn(null);
+ expect(definition.getName()).andReturn("$anonymousMutableDefinition1");
+
+ replay(wrapped, request, definitions, scope, definition);
+ try {
+ container.register(definition, request);
+ } finally {
+ verify(wrapped, request, definitions, scope, definition);
+ }
+ }
+
+ @Test
+ public void testRegisterCreateDefinitions() {
+ Request request = createMock(Request.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope).anyTimes();
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(
+ null);
+ expect(scope.put(eq(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME), isA(HashMap.class))).andReturn(null);
+ expect(definition.getName()).andReturn(null);
+ definition.setName("$anonymousMutableDefinition1");
+ expect(definition.isExtending()).andReturn(true);
+ // trick to test resolve definition separately.
+ expect(definition.isExtending()).andReturn(false);
+ expect(definition.getName()).andReturn("$anonymousMutableDefinition1");
+
+ replay(wrapped, request, scope, definition);
+ container.register(definition, request);
+ verify(wrapped, request, scope, definition);
+ }
+
+ @Test
+ public void testRender() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+ Definition definition = createMock(Definition.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definitions.get("definition")).andReturn(definition);
+ container.render(definition, request);
+
+ replay(wrapped, request, definitions, scope, definition);
+ container.render("definition", request);
+ verify(wrapped, request, definitions, scope, definition);
+ }
+
+ @Test(expected = NoSuchDefinitionException.class)
+ public void testRenderFail() {
+ Request request = createMock(Request.class);
+ Map<String, Definition> definitions = createMock(Map.class);
+ Map<String, Object> scope = createMock(Map.class);
+
+ expect(request.getContext("request")).andReturn(scope);
+ expect(scope.get(DEFAULT_DEFINITIONS_ATTRIBUTE_NAME)).andReturn(definitions);
+ expect(definitions.get("definition")).andReturn(null);
+ expect(wrapped.getDefinition("definition", request)).andReturn(null);
+
+ replay(wrapped, request, definitions, scope);
+ try {
+ container.render("definition", request);
+ } finally {
+ verify(wrapped, request, definitions, scope);
+ }
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/renderer/DefinitionRendererTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/renderer/DefinitionRendererTest.java
new file mode 100644
index 000000000..70e6fba58
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/renderer/DefinitionRendererTest.java
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.renderer;
+
+import org.apache.tiles.api.TilesContainer;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.render.CannotRenderException;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.io.IOException;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Tests {@link DefinitionRenderer}.
+ */
+public class DefinitionRendererTest {
+
+ /**
+ * The renderer.
+ */
+ private DefinitionRenderer renderer;
+
+ /**
+ * The container.
+ */
+ private TilesContainer container;
+
+ /**
+ * {@inheritDoc}
+ */
+ @Before
+ public void setUp() {
+ container = createMock(TilesContainer.class);
+ renderer = new DefinitionRenderer(container);
+ }
+
+ /**
+ * Tests
+ * {@link DefinitionRenderer#render(String, Request)}.
+ *
+ * @throws IOException If something goes wrong during rendition.
+ */
+ @Test
+ public void testWrite() throws IOException {
+ Request requestContext = createMock(Request.class);
+ container.render("my.definition", requestContext);
+ replay(requestContext, container);
+ renderer.render("my.definition", requestContext);
+ verify(requestContext, container);
+ }
+
+ /**
+ * Tests
+ * {@link DefinitionRenderer#render(String, Request)}.
+ *
+ * @throws IOException If something goes wrong during rendition.
+ */
+ @Test(expected = CannotRenderException.class)
+ public void testRenderException() throws IOException {
+ Request requestContext = createMock(Request.class);
+ replay(requestContext, container);
+ try {
+ renderer.render(null, requestContext);
+ } finally {
+ verify(requestContext, container);
+ }
+ }
+
+ /**
+ * Tests
+ * {@link DefinitionRenderer#isRenderable(String, Request)}
+ * .
+ */
+ @Test
+ public void testIsRenderable() {
+ Request requestContext = createMock(Request.class);
+ expect(container.isValidDefinition("my.definition", requestContext)).andReturn(Boolean.TRUE);
+ replay(requestContext, container);
+ assertTrue(renderer.isRenderable("my.definition", requestContext));
+ assertFalse(renderer.isRenderable(null, requestContext));
+ verify(requestContext, container);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/startup/AbstractTilesInitializerTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/startup/AbstractTilesInitializerTest.java
new file mode 100644
index 000000000..fa7789132
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/startup/AbstractTilesInitializerTest.java
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tiles.core.startup;
+
+import org.apache.tiles.api.TilesContainer;
+import org.apache.tiles.api.access.TilesAccess;
+import org.apache.tiles.core.factory.AbstractTilesContainerFactory;
+import org.apache.tiles.request.ApplicationAccess;
+import org.apache.tiles.request.ApplicationContext;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.Map;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+/**
+ * Tests {@link AbstractTilesInitializer}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class AbstractTilesInitializerTest {
+
+ /**
+ * A mock Tiles container factory.
+ */
+ private AbstractTilesContainerFactory containerFactory;
+
+ /**
+ * The object to test.
+ */
+ private AbstractTilesInitializer initializer;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ containerFactory = createMock(AbstractTilesContainerFactory.class);
+ initializer = new AbstractTilesInitializer() {
+
+ @Override
+ protected AbstractTilesContainerFactory createContainerFactory(
+ ApplicationContext context) {
+ return containerFactory;
+ }
+ };
+ }
+
+ /**
+ * Test method for {@link AbstractTilesInitializer#initialize(ApplicationContext)}.
+ */
+ @Test
+ public void testInitialize() {
+ ApplicationContext context = createMock(ApplicationContext.class);
+ TilesContainer container = createMock(TilesContainer.class);
+ Map<String, Object> scope = createMock(Map.class);
+
+ expect(containerFactory.createContainer(context)).andReturn(container);
+ expect(context.getApplicationScope()).andReturn(scope).anyTimes();
+ expect(scope.put(ApplicationAccess.APPLICATION_CONTEXT_ATTRIBUTE,
+ context)).andReturn(null);
+ expect(scope.put(TilesAccess.CONTAINER_ATTRIBUTE, container)).andReturn(null);
+ expect(scope.remove(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container);
+
+ replay(containerFactory, context, container, scope);
+ initializer.initialize(context);
+ initializer.destroy();
+ verify(containerFactory, context, container, scope);
+ }
+
+ /**
+ * Test method for {@link AbstractTilesInitializer#createTilesApplicationContext(ApplicationContext)}.
+ */
+ @Test
+ public void testCreateTilesApplicationContext() {
+ ApplicationContext context = createMock(ApplicationContext.class);
+ replay(containerFactory, context);
+ assertEquals(context, initializer.createTilesApplicationContext(context));
+ verify(containerFactory, context);
+ }
+
+ /**
+ * Test method for {@link AbstractTilesInitializer#getContainerKey(ApplicationContext)}.
+ */
+ @Test
+ public void testGetContainerKey() {
+ ApplicationContext context = createMock(ApplicationContext.class);
+ replay(containerFactory, context);
+ assertNull(initializer.getContainerKey(context));
+ verify(containerFactory, context);
+ }
+
+ /**
+ * Test method for {@link AbstractTilesInitializer#createContainer(ApplicationContext)}.
+ */
+ @Test
+ public void testCreateContainer() {
+ ApplicationContext context = createMock(ApplicationContext.class);
+ TilesContainer container = createMock(TilesContainer.class);
+
+ expect(containerFactory.createContainer(context)).andReturn(container);
+
+ replay(containerFactory, context, container);
+ assertEquals(container, initializer.createContainer(context));
+ verify(containerFactory, context, container);
+ }
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/core/util/CombinedBeanInfoTest.java b/plugins/tiles/src/test/java/org/apache/tiles/core/util/CombinedBeanInfoTest.java
new file mode 100644
index 000000000..b1108d3bd
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/core/util/CombinedBeanInfoTest.java
@@ -0,0 +1,93 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.core.util;
+
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.Request;
+import org.apache.tiles.request.reflect.ClassUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.beans.FeatureDescriptor;
+import java.beans.PropertyDescriptor;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests {@link CombinedBeanInfo}.
+ */
+public class CombinedBeanInfoTest {
+
+ /**
+ * The bean info to test.
+ */
+ private CombinedBeanInfo beanInfo;
+
+ /**
+ * The property descriptors.
+ */
+ private List<FeatureDescriptor> descriptors;
+
+ /**
+ * The map of property descriptors for request.
+ */
+ private Map<String, PropertyDescriptor> requestMap;
+
+ /**
+ * The map of property descriptors for application.
+ */
+ private Map<String, PropertyDescriptor> applicationMap;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ beanInfo = new CombinedBeanInfo(Request.class, ApplicationContext.class);
+ requestMap = new LinkedHashMap<>();
+ ClassUtil.collectBeanInfo(Request.class, requestMap);
+ applicationMap = new LinkedHashMap<>();
+ ClassUtil.collectBeanInfo(ApplicationContext.class, applicationMap);
+ descriptors = new ArrayList<>();
+ descriptors.addAll(requestMap.values());
+ descriptors.addAll(applicationMap.values());
+ }
+
+ @Test
+ public void testGetDescriptors() {
+ assertEquals(descriptors, beanInfo.getDescriptors());
+ }
+
+ @Test
+ public void testGetMappedDescriptors() {
+ assertEquals(requestMap, beanInfo.getMappedDescriptors(Request.class));
+ assertEquals(applicationMap, beanInfo.getMappedDescriptors(ApplicationContext.class));
+ }
+
+ @Test
+ public void testGetProperties() {
+ assertEquals(requestMap.keySet(), beanInfo.getProperties(Request.class));
+ assertEquals(applicationMap.keySet(), beanInfo.getProperties(ApplicationContext.class));
+ }
+
+}
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-tiles-513.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-tiles-513.xml
new file mode 100644
index 000000000..3b6c6a377
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-tiles-513.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+ -->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
+ "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+ <!-- Authentication Layout -->
+ <definition name="test.anonymous.base" template="/layout.jsp">
+ <put-attribute name="header">
+ <definition template="/header.jsp" />
+ </put-attribute>
+ <put-attribute name="menu">
+ <definition template="/localnav.jsp" />
+ </put-attribute>
+ <put-attribute name="footer">
+ <definition template="/footer.jsp" />
+ </put-attribute>
+ </definition>
+
+ <!-- index page -->
+ <definition name="test.anonymous" extends="test.anonymous.base">
+ <put-attribute name="title" value="page.title.security.login" />
+ <put-attribute name="body" value="/body.jsp" />
+ </definition>
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-wildcard.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-wildcard.xml
new file mode 100644
index 000000000..9312f9d60
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs-wildcard.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+ <definition name="test.def3" template="/test.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+ <definition name="test.def*.sub*" template="/test{1}.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header{2}.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <definition name="test.def*.noAttribute" template="/test{1}.jsp" />
+
+ <!-- Never used on purpose, if there is the TILES-416 the test will fail -->
+ <definition name="test.def*" template="/test{1}.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header-sub.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <definition name="test.extended.def*.sub*" extends="test.def{1}.sub{2}">
+ <put-attribute name="title" value="Overridden Title" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1.xml
new file mode 100644
index 000000000..621d7cef9
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- This definition will remain the same for all locales -->
+ <definition name="test.common" template="/test.jsp">
+ <put-attribute name="country" value="none"/>
+ <put-attribute name="title" value="Common Definition" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <!-- Doc index page description -->
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <!-- This definition will be extended -->
+ <definition name="test.def.toextend" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Definition to be extended" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <!-- This definition will be overridden -->
+ <definition name="test.def.overridden" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Definition to be overridden" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_en_US.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_en_US.xml
new file mode 100644
index 000000000..1a89b229c
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_en_US.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="US"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr.xml
new file mode 100644
index 000000000..62ed68170
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="France"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <definition name="test.common.french" template="/test.jsp">
+ <put-attribute name="country" value="France"/>
+ <put-attribute name="title" value="Common Definition for French" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+ <definition name="test.def.overridden" extends="test.def.toextend">
+ <put-attribute name="country" value="France"/>
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr_CA.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr_CA.xml
new file mode 100644
index 000000000..b35d0d83e
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs1_fr_CA.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="Canada"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs2.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs2.xml
new file mode 100644
index 000000000..f24f1c5d7
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs2.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def2" template="/test.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs3.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs3.xml
new file mode 100644
index 000000000..77d7bed2d
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs3.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def3" template="/test.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs_regression_TILES-352.xml
similarity index 57%
copy from plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java
copy to plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs_regression_TILES-352.xml
index cd9c1c6c5..a28ec49ca 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/digester/DigesterDefinitionsReaderException.java
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/defs_regression_TILES-352.xml
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+ <!--
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,27 +18,23 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.core.definition.digester;
+ -->
-import org.apache.tiles.api.TilesException;
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
-/**
- * Indicates that something went wrong during the use of
- * {@link DigesterDefinitionsReader}.
- *
- * @version $Rev$ $Date$
- * @since 2.1.0
- */
-public class DigesterDefinitionsReaderException extends TilesException {
+ <!-- Definitions to check regression from TILES-252 -->
- /**
- * Constructor.
- *
- * @param message The detail message.
- * @since 2.1.0
- */
- public DigesterDefinitionsReaderException(String message) {
- super(message);
- }
+<tiles-definitions>
+ <definition name="root">
+ <put-attribute name="body">
+ <definition template="/my/template.jsp">
+ <put-list-attribute name="list">
+ <add-attribute value="This is a value" type="string" />
+ </put-list-attribute>
+ </definition>
+ </put-attribute>
+ </definition>
-}
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/invalid-defs.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/invalid-defs.xml
new file mode 100644
index 000000000..3973a749a
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/invalid-defs.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Dorked up XML tag. -->
+ <definitionasdfad name="doc.mainLayout" template="/layout/classicLayout.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definitionasdfad>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/malformed-defs.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/malformed-defs.xml
new file mode 100644
index 000000000..b82f95de7
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/malformed-defs.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="doc.mainLayout" template="/layout/classicLayout.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/temp-defs.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/temp-defs.xml
new file mode 100644
index 000000000..d5334eab4
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/temp-defs.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1.xml
new file mode 100644
index 000000000..f8b651ce2
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+ <definition name="doc.cascaded.test" template="/layout/classicLayout.jsp">
+ <put-attribute name="title" value="Test title" cascade="false" />
+ <put-attribute name="title2" value="Test title two" cascade="true" />
+ <put-list-attribute name="items1" cascade="false">
+ <add-attribute value="value1" type="string" />
+ </put-list-attribute>
+ <put-list-attribute name="items2" cascade="true">
+ <add-attribute value="value2" type="string" />
+ </put-list-attribute>
+ </definition>
+
+ <definition name="test.nesting.definitions" template="/layout.jsp">
+ <put-attribute name="body">
+ <definition template="/layout.jsp">
+ <put-attribute name="title" value="This is a nested definition."/>
+ </definition>
+ </put-attribute>
+ </definition>
+
+ <definition name="test.nesting.list.definitions" template="/layout.jsp">
+ <put-list-attribute name="list">
+ <add-attribute>
+ <definition template="/layout.jsp">
+ <put-attribute name="title" value="This is a nested definition."/>
+ </definition>
+ </add-attribute>
+ </put-list-attribute>
+ </definition>
+
+ <definition name="test.inherit.list.base" template="/layout.jsp">
+ <put-list-attribute name="list">
+ <add-attribute value="first" />
+ </put-list-attribute>
+ </definition>
+
+ <definition name="test.inherit.list" extends="test.inherit.list.base">
+ <put-list-attribute name="list" inherit="true">
+ <add-attribute value="second" />
+ </put-list-attribute>
+ </definition>
+
+ <definition name="test.noinherit.list" extends="test.inherit.list.base">
+ <put-list-attribute name="list">
+ <add-attribute value="second" />
+ </put-list-attribute>
+ </definition>
+
+ <definition name="test.new.attributes" templateExpression="${my.expression}"
+ templateType="mytype" >
+ <put-attribute name="body" expression="${my.attribute.expression}" />
+ </definition>
+
+ <definition name="test.inherit.othertype.base" template="/layout.ftl" templateType="freemarker">
+ <put-attribute name="body" value="/jsp/body.jsp" />
+ </definition>
+
+ <definition name="test.inherit.othertype" extends="test.inherit.othertype.base">
+ </definition>
+</tiles-definitions>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1_it.xml
similarity index 64%
copy from plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java
copy to plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1_it.xml
index aaab7652c..4c7c0834f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/template/NoSuchAttributeException.java
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs-2.1_it.xml
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,25 +18,16 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.template;
-
-import org.apache.tiles.api.TilesException;
+-->
-/**
- * Indicates that a named attribute has not been found.
- *
- * @since 2.2.0
- */
-public class NoSuchAttributeException extends TilesException {
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
- /**
- * Constructor.
- *
- * @param message The detail message.
- * @since 2.2.0
- */
- public NoSuchAttributeException(String message) {
- super(message);
- }
+<!-- Definitions for Tiles documentation -->
-}
+<tiles-definitions>
+ <definition name="test.dummy" template="/dummy_layout.jsp">
+ <put-attribute name="body" expression="/dummy_body.jsp" />
+ </definition>
+</tiles-definitions>
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs.xml b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs.xml
new file mode 100644
index 000000000..590e0c7cf
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/config/tiles-defs.xml
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+-->
+
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
+
+<!-- Definitions for Tiles documentation -->
+
+<tiles-definitions>
+
+ <!-- ======================================================= -->
+ <!-- Master definition -->
+ <!-- ======================================================= -->
+
+ <!-- Doc index page description -->
+ <definition name="doc.mainLayout" template="/layout/classicLayout.jsp">
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="bean" value="This is an object" type="object" />
+ </definition>
+
+ <!-- ======================================================= -->
+ <!-- Main page body definitions -->
+ <!-- ======================================================= -->
+
+ <definition name="doc.portal.body" template="/layout/columnsLayout.jsp">
+ <put-attribute name="numCols" value="2" />
+ <put-list-attribute name="list0" >
+ <add-attribute value="/doc/portal/welcome.jsp" />
+ <add-attribute value="/doc/portal/features.jsp" />
+ <!--<add-attribute value="/doc/portal/todo.jsp" /> -->
+ <add-attribute value="/doc/portal/documentation.jsp" />
+ </put-list-attribute>
+ <put-list-attribute name="list1" >
+ <add-attribute value="/doc/portal/news.jsp" />
+ <add-attribute value="/doc/portal/download.jsp" />
+ <add-attribute value="/doc/portal/tilesCompsTemplates.jsp" />
+ <add-attribute value="/doc/portal/strutsIntegration.jsp" />
+ <add-attribute value="/doc/portal/comments.jsp" />
+ <add-attribute value="/doc/portal/revisions.jsp" />
+ </put-list-attribute>
+ </definition>
+
+ <!-- ======================================================= -->
+ <!-- Menus definitions -->
+ <!-- ======================================================= -->
+
+ <!-- Menu bar definition -->
+<definition name="doc.menu.main" template="/layout/vboxLayout.jsp" >
+ <put-list-attribute name="componentsList" >
+ <add-attribute value="doc.menu.links" />
+ <add-attribute value="doc.menu.taglib.references" />
+ <add-attribute value="doc.menu.printer.friendly" />
+ <add-attribute value="doc.menu.old.documents" />
+ </put-list-attribute>
+</definition>
+
+ <!-- Documentation menu definition v1.1-->
+<definition name="doc.menu.links" template="/layouts/menu.jsp" >
+ <put-attribute name="title" value="Documentation" />
+ <put-list-attribute name="items" >
+ <item value="Home" link="/index.jsp" />
+ <item value="Live Examples (new)" link="/examples/index.jsp" />
+ <!--
+ <item> <value>Commented Examples</value>
+ <link>/examples/index.jsp</link>
+ <classtype>org.apache.tiles.beans.SimpleMenuItem</classtype>
+ </item>
+ -->
+ <item value="Quick overview" link="/doc/quickOverview.jsp" />
+ <!--
+ <item value="Tutorial" link="/doc/tutorial.jsp" />
+ -->
+ <item value="Tutorial Live Examples" link="/tutorial/index.jsp" />
+ <item value="Download" link="/doc/download.jsp" />
+ <item value="Installation" link="/doc/installation.jsp" />
+ <item value="User Guide" link="/doc/userGuide.jsp" />
+ <item value="Javadoc" link="/api/index.html" />
+ <item value="Struts Home" link="http://www.apache.org" icon="/images/struts-power.gif"
+ classtype="org.apache.tiles.beans.SimpleMenuItem" />
+ </put-list-attribute>
+</definition>
+
+ <!-- Printer friendly menu definition -->
+<definition name="doc.menu.printer.friendly" template="/layouts/menu.jsp" >
+ <put-attribute name="title" value="Printer Versions" />
+ <put-list-attribute name="items" >
+ <item value="Quick Overview" link="/test/testAll.jsp" />
+ <item value="Tutorial" link="/doc/tutorialBody.html" />
+ <item value="User Guide" link="/doc/userGuideBody.html" />
+ <item value="Overview (old)" link="/doc/overviewBody.html" />
+ </put-list-attribute>
+</definition>
+
+ <!-- Taglib menu definition -->
+<definition name="doc.menu.taglib.references" template="/layouts/menu.jsp" >
+ <put-attribute name="title" value="Tag Library Reference" />
+ <put-list-attribute name="items" >
+ <item value="Tiles Tags" link="/doc/tilesTags.jsp" />
+ <!-- <item value="Extension Tags (old)" link="/doc/extensionsTags.jsp" /> -->
+ </put-list-attribute>
+</definition>
+
+ <!-- Oldies menu definition -->
+<definition name="doc.menu.old.documents" template="/layouts/menu.jsp" >
+ <put-attribute name="title" value="Old Documents" />
+ <put-list-attribute name="items" >
+ <item value="Overview (old)" link="/doc/overview.jsp" />
+ </put-list-attribute>
+</definition>
+
+<definition name="doc.role.test" template="/layout/classicLayout.jsp">
+ <put-attribute name="title" value="Test title" role="myrole" />
+</definition>
+
+<definition name="doc.listattribute.test" template="/layout/classicLayout.jsp">
+ <put-list-attribute name="items" />
+</definition>
+
+</tiles-definitions>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-one.xml
similarity index 53%
copy from plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
copy to plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-one.xml
index 858db324d..180fb0a8c 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-one.xml
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,23 +18,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.api;
+-->
-/**
- * Indicates that a keyed container has not been found.
- *
- * @since 2.1.0
- */
-public class NoSuchContainerException extends TilesException {
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
- /**
- * Constructor.
- *
- * @param message The detail message.
- * @since 2.1.0
- */
- public NoSuchContainerException(String message) {
- super(message);
- }
+<tiles-definitions>
+ <definition name="test.def.one" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
-}
+</tiles-definitions>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-two.xml
similarity index 53%
copy from plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
copy to plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-two.xml
index 858db324d..d0639d696 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs-key-two.xml
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,23 +18,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.api;
+-->
-/**
- * Indicates that a keyed container has not been found.
- *
- * @since 2.1.0
- */
-public class NoSuchContainerException extends TilesException {
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
- /**
- * Constructor.
- *
- * @param message The detail message.
- * @since 2.1.0
- */
- public NoSuchContainerException(String message) {
- super(message);
- }
+<tiles-definitions>
+ <definition name="test.def.two" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
-}
+</tiles-definitions>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs.xml
similarity index 53%
copy from plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
copy to plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs.xml
index 858db324d..2d124a2be 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/NoSuchContainerException.java
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/core/factory/test-defs.xml
@@ -1,6 +1,6 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
/*
- * $Id$
- *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -18,23 +18,20 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.api;
+-->
-/**
- * Indicates that a keyed container has not been found.
- *
- * @since 2.1.0
- */
-public class NoSuchContainerException extends TilesException {
+ <!DOCTYPE tiles-definitions PUBLIC
+ "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+ "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
- /**
- * Constructor.
- *
- * @param message The detail message.
- * @since 2.1.0
- */
- public NoSuchContainerException(String message) {
- super(message);
- }
+<tiles-definitions>
+ <definition name="test.def1" template="/test.jsp">
+ <put-attribute name="country" value="default"/>
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
+ </definition>
-}
+</tiles-definitions>
diff --git a/pom.xml b/pom.xml
index d915a38ef..14a01e163 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1028,6 +1028,12 @@
<version>${log4j2.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-jcl</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>