Added:
tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java
(added)
+++
tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,222 @@
+/*
+ * $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
+ * 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.evaluator.ognl;
+
+import static org.junit.Assert.*;
+import static org.easymock.EasyMock.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import ognl.PropertyAccessor;
+
+import org.apache.tiles.TilesApplicationContext;
+import org.apache.tiles.context.TilesRequestContext;
+import org.junit.Test;
+
+/**
+ * @author antonio
+ *
+ * @version $Rev$ $Date$
+ */
+public class TilesContextPropertyAccessorDelegateFactoryTest {
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorRequest() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(objectPropertyAccessor,
factory.getPropertyAccessor("writer", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ }
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorApplication() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(applicationContextPropertyAccessor,
factory.getPropertyAccessor("initParams", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ }
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorRequestScope() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("attribute", 1);
+ expect(request.getRequestScope()).andReturn(map);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(requestScopePropertyAccessor,
factory.getPropertyAccessor("attribute", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ }
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorSessionScope() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("attribute", 1);
+ Map<String, Object> emptyMap = new HashMap<String, Object>();
+ expect(request.getRequestScope()).andReturn(emptyMap);
+ expect(request.getSessionScope()).andReturn(map);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(sessionScopePropertyAccessor,
factory.getPropertyAccessor("attribute", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request);
+ }
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorApplicationScope() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+ TilesApplicationContext applicationContext =
createMock(TilesApplicationContext.class);
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("attribute", 1);
+ Map<String, Object> emptyMap = new HashMap<String, Object>();
+ expect(request.getRequestScope()).andReturn(emptyMap);
+ expect(request.getSessionScope()).andReturn(emptyMap);
+ expect(request.getApplicationContext()).andReturn(applicationContext);
+ expect(applicationContext.getApplicationScope()).andReturn(map);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request, applicationContext);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(applicationScopePropertyAccessor,
factory.getPropertyAccessor("attribute", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request, applicationContext);
+ }
+
+ /**
+ * Test method for
+ * {...@link
TilesContextPropertyAccessorDelegateFactory#getPropertyAccessor(String,
TilesRequestContext)}
+ * .
+ */
+ @Test
+ public void testGetPropertyAccessorRequestScopeDefault() {
+ PropertyAccessor objectPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationContextPropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor requestScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor sessionScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ PropertyAccessor applicationScopePropertyAccessor =
createMock(PropertyAccessor.class);
+ TilesRequestContext request = createMock(TilesRequestContext.class);
+ TilesApplicationContext applicationContext =
createMock(TilesApplicationContext.class);
+ Map<String, Object> map = new HashMap<String, Object>();
+ map.put("anotherAttribute", 1);
+ Map<String, Object> emptyMap = new HashMap<String, Object>();
+ expect(request.getRequestScope()).andReturn(map);
+ expect(request.getSessionScope()).andReturn(emptyMap);
+ expect(request.getApplicationContext()).andReturn(applicationContext);
+ expect(applicationContext.getApplicationScope()).andReturn(emptyMap);
+
+ replay(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request, applicationContext);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory = new
TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ assertEquals(requestScopePropertyAccessor,
factory.getPropertyAccessor("attribute", request));
+
+ verify(objectPropertyAccessor, applicationContextPropertyAccessor,
requestScopePropertyAccessor,
+ sessionScopePropertyAccessor,
applicationScopePropertyAccessor, request, applicationContext);
+ }
+}
Propchange:
tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/ognl/TilesContextPropertyAccessorDelegateFactoryTest.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/framework/trunk/tiles-test/pom.xml
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/pom.xml?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/pom.xml (original)
+++ tiles/framework/trunk/tiles-test/pom.xml Sun Jul 12 11:40:59 2009
@@ -136,6 +136,11 @@
<artifactId>mvel2</artifactId>
<version>2.0.10</version>
</dependency>
+ <dependency>
+ <groupId>ognl</groupId>
+ <artifactId>ognl</artifactId>
+ <version>2.7.3</version>
+ </dependency>
</dependencies>
<build>
Modified:
tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java
(original)
+++
tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/factory/TestTilesContainerFactory.java
Sun Jul 12 11:40:59 2009
@@ -24,6 +24,7 @@
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import javax.el.ArrayELResolver;
@@ -34,10 +35,15 @@
import javax.el.MapELResolver;
import javax.el.ResourceBundleELResolver;
+import ognl.OgnlException;
+import ognl.OgnlRuntime;
+import ognl.PropertyAccessor;
+
import org.apache.tiles.TilesApplicationContext;
import org.apache.tiles.TilesContainer;
import
org.apache.tiles.compat.definition.digester.CompatibilityDigesterDefinitionsReader;
import org.apache.tiles.context.ChainedTilesRequestContextFactory;
+import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.context.TilesRequestContextFactory;
import org.apache.tiles.context.TilesRequestContextHolder;
import org.apache.tiles.definition.DefinitionsFactoryException;
@@ -50,6 +56,15 @@
import org.apache.tiles.evaluator.mvel.MVELAttributeEvaluator;
import org.apache.tiles.evaluator.mvel.TilesContextBeanVariableResolverFactory;
import org.apache.tiles.evaluator.mvel.TilesContextVariableResolverFactory;
+import org.apache.tiles.evaluator.ognl.ApplicationScopeNestedObjectExtractor;
+import org.apache.tiles.evaluator.ognl.DelegatePropertyAccessor;
+import org.apache.tiles.evaluator.ognl.NestedObjectDelegatePropertyAccessor;
+import org.apache.tiles.evaluator.ognl.OGNLAttributeEvaluator;
+import org.apache.tiles.evaluator.ognl.PropertyAccessorDelegateFactory;
+import org.apache.tiles.evaluator.ognl.RequestScopeNestedObjectExtractor;
+import org.apache.tiles.evaluator.ognl.SessionScopeNestedObjectExtractor;
+import
org.apache.tiles.evaluator.ognl.TilesApplicationContextNestedObjectExtractor;
+import
org.apache.tiles.evaluator.ognl.TilesContextPropertyAccessorDelegateFactory;
import org.apache.tiles.factory.BasicTilesContainerFactory;
import
org.apache.tiles.freemarker.context.FreeMarkerTilesRequestContextFactory;
import org.apache.tiles.freemarker.renderer.FreeMarkerAttributeRenderer;
@@ -58,6 +73,7 @@
import org.apache.tiles.locale.LocaleResolver;
import org.apache.tiles.renderer.impl.BasicRendererFactory;
import org.apache.tiles.test.evaluator.el.MultiversionExpressionFactoryFactory;
+import org.apache.tiles.test.exception.TilesTestRuntimeException;
import org.apache.tiles.test.renderer.ReverseStringAttributeRenderer;
import org.apache.tiles.velocity.context.VelocityTilesRequestContextFactory;
import org.apache.tiles.velocity.renderer.VelocityAttributeRenderer;
@@ -161,6 +177,8 @@
createELEvaluator(applicationContext));
attributeEvaluatorFactory.registerAttributeEvaluator("MVEL",
createMVELEvaluator());
+ attributeEvaluatorFactory.registerAttributeEvaluator("OGNL",
+ createOGNLEvaluator());
return attributeEvaluatorFactory;
}
@@ -210,6 +228,41 @@
return mvelEvaluator;
}
+ /**
+ * Creates the MVEL evaluator.
+ *
+ * @return The MVEL evaluator.
+ */
+ private OGNLAttributeEvaluator createOGNLEvaluator() {
+ try {
+ PropertyAccessor objectPropertyAccessor =
OgnlRuntime.getPropertyAccessor(Object.class);
+ PropertyAccessor mapPropertyAccessor =
OgnlRuntime.getPropertyAccessor(Map.class);
+ PropertyAccessor applicationContextPropertyAccessor =
+ new NestedObjectDelegatePropertyAccessor<TilesRequestContext>(
+ new TilesApplicationContextNestedObjectExtractor(),
+ objectPropertyAccessor);
+ PropertyAccessor requestScopePropertyAccessor =
+ new NestedObjectDelegatePropertyAccessor<TilesRequestContext>(
+ new RequestScopeNestedObjectExtractor(),
mapPropertyAccessor);
+ PropertyAccessor sessionScopePropertyAccessor =
+ new NestedObjectDelegatePropertyAccessor<TilesRequestContext>(
+ new SessionScopeNestedObjectExtractor(),
mapPropertyAccessor);
+ PropertyAccessor applicationScopePropertyAccessor =
+ new NestedObjectDelegatePropertyAccessor<TilesRequestContext>(
+ new ApplicationScopeNestedObjectExtractor(),
mapPropertyAccessor);
+ PropertyAccessorDelegateFactory<TilesRequestContext> factory =
+ new TilesContextPropertyAccessorDelegateFactory(
+ objectPropertyAccessor, applicationContextPropertyAccessor,
+ requestScopePropertyAccessor, sessionScopePropertyAccessor,
+ applicationScopePropertyAccessor);
+ PropertyAccessor tilesRequestAccessor = new
DelegatePropertyAccessor<TilesRequestContext>(factory);
+ OgnlRuntime.setPropertyAccessor(TilesRequestContext.class,
tilesRequestAccessor);
+ return new OGNLAttributeEvaluator();
+ } catch (OgnlException e) {
+ throw new TilesTestRuntimeException("Cannot initialize OGNL
evaluator", e);
+ }
+ }
+
/** {...@inheritdoc} */
@Override
protected List<URL> getSourceURLs(TilesApplicationContext
applicationContext,
Modified:
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/freemarker/tiles-defs.xml
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/freemarker/tiles-defs.xml?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/freemarker/tiles-defs.xml
(original)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/freemarker/tiles-defs.xml
Sun Jul 12 11:40:59 2009
@@ -228,6 +228,13 @@
<put-attribute name="body" expression="MVEL:requestScope.body"/>
</definition>
+ <definition name="freemarker.test.composite.ognl.definition"
templateExpression="OGNL:layout"
+ preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
+ <put-attribute name="title" value="This is a configured composite
definition."/>
+ <put-attribute name="header" value="/freemarker/header.ftl"
type="freemarker" />
+ <put-attribute name="body" expression="OGNL:requestScope.body"/>
+ </definition>
+
<definition name="freemarker.test.composite.el.doNotShow.definition"
templateExpression="${layout}"
preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
<put-attribute name="title" value="This is a configured definition."/>
Modified:
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml
(original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml Sun
Jul 12 11:40:59 2009
@@ -240,6 +240,13 @@
<put-attribute name="body" expression="MVEL:requestScope.body"/>
</definition>
+ <definition name="test.composite.ognl.definition"
templateExpression="OGNL:layout"
+ preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
+ <put-attribute name="title" value="This is a configured composite
definition."/>
+ <put-attribute name="header" value="/header.jsp"/>
+ <put-attribute name="body" expression="OGNL:requestScope.body"/>
+ </definition>
+
<definition name="test.composite.el.doNotShow.definition"
templateExpression="${layout}"
preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
<put-attribute name="title" value="This is a configured definition."/>
Modified:
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/velocity/tiles-defs.xml
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/velocity/tiles-defs.xml?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/velocity/tiles-defs.xml
(original)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/velocity/tiles-defs.xml
Sun Jul 12 11:40:59 2009
@@ -228,6 +228,13 @@
<put-attribute name="body" expression="MVEL:requestScope.body"/>
</definition>
+ <definition name="velocity.test.composite.ognl.definition"
templateExpression="OGNL:layout"
+ preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
+ <put-attribute name="title" value="This is a configured composite
definition."/>
+ <put-attribute name="header" value="/velocity/header.vm" type="velocity"
/>
+ <put-attribute name="body" expression="OGNL:requestScope.body"/>
+ </definition>
+
<definition name="velocity.test.composite.el.doNotShow.definition"
templateExpression="${layout}"
preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
<put-attribute name="title" value="This is a configured definition."/>
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl
(added)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,24 @@
+<#--
+/*
+ * $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
+ * 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.
+ *
+ */
+-->
+<@tiles.insertDefinition name="freemarker.test.composite.ognl.definition" />
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/freemarker/testinsertdefinition_ognl.ftl
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Sun Jul 12
11:40:59 2009
@@ -92,6 +92,7 @@
<a href="testinsertnestedlistdefinition_tags.jsp">Test Insert Nested List
Definition only using JSP tags</a><br/>
<a href="testinsertdefinition_el.jsp">Test Insert Configured Definition
with EL</a><br/>
<a href="testinsertdefinition_mvel.jsp">Test Insert Configured Definition
with MVEL</a><br/>
+ <a href="testinsertdefinition_ognl.jsp">Test Insert Configured Definition
with OGNL</a><br/>
<a href="testinsertdefinition_el_singleeval.jsp">Test Insert Configured
Definition with EL to test Single Evaluation</a><br/>
<a href="testinsertdefinition_wildcard.jsp">Test Insert Configured
Definition with Wildcards</a><br/>
<a href="testinsertdefinition_defaultvalues.jsp">Test Insert Configured
Definition with Default Values</a><br/>
@@ -175,6 +176,7 @@
<a href="freemarker/testinsertnestedlistdefinition_tags.ftl">FreeMarker:
Test Insert Nested List Definition only using JSP tags</a><br/>
<a href="freemarker/testinsertdefinition_el.ftl">FreeMarker: Test Insert
Configured Definition with EL</a><br/>
<a href="freemarker/testinsertdefinition_mvel.ftl">FreeMarker: Test Insert
Configured Definition with MVEL</a><br/>
+ <a href="freemarker/testinsertdefinition_ognl.ftl">FreeMarker: Test Insert
Configured Definition with OGNL</a><br/>
<a href="freemarker/testinsertdefinition_el_singleeval.ftl">FreeMarker:
Test Insert Configured Definition with EL to test Single Evaluation</a><br/>
<a href="freemarker/testinsertdefinition_wildcard.ftl">FreeMarker: Test
Insert Configured Definition with Wildcards</a><br/>
<a href="freemarker/testinsertdefinition_defaultvalues.ftl">FreeMarker:
Test Insert Configured Definition with Default Values</a><br/>
@@ -258,6 +260,7 @@
<a href="velocity/testinsertnestedlistdefinition_tags.vm">Velocity: Test
Insert Nested List Definition only using JSP tags</a><br/>
<a href="velocity/testinsertdefinition_el.vm">Velocity: Test Insert
Configured Definition with EL</a><br/>
<a href="velocity/testinsertdefinition_mvel.vm">Velocity: Test Insert
Configured Definition with MVEL</a><br/>
+ <a href="velocity/testinsertdefinition_ognl.vm">Velocity: Test Insert
Configured Definition with OGNL</a><br/>
<a href="velocity/testinsertdefinition_el_singleeval.vm">Velocity: Test
Insert Configured Definition with EL to test Single Evaluation</a><br/>
<a href="velocity/testinsertdefinition_wildcard.vm">Velocity: Test Insert
Configured Definition with Wildcards</a><br/>
<a href="velocity/testinsertdefinition_defaultvalues.vm">Velocity: Test
Insert Configured Definition with Default Values</a><br/>
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp
(added)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,27 @@
+<%@ page session="false" %>
+<%--
+/*
+ * $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
+ * 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.
+ *
+ */
+--%>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<tiles:insertDefinition name="test.composite.ognl.definition" />
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_ognl.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/velocity/testinsertdefinition_ognl.vm
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/velocity/testinsertdefinition_ognl.vm?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/velocity/testinsertdefinition_ognl.vm
(added)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/velocity/testinsertdefinition_ognl.vm
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,22 @@
+#*
+ * $Id: testinsertdefinition_el.vm 782137 2009-06-05 21:18:52Z apetrelli $
+ *
+ * Licensed 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.
+ *
+ *#
+$tiles.insertDefinition({"name":"velocity.test.composite.ognl.definition"})
Added:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html
(added)
+++
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,71 @@
+<!--
+/*
+ * $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
+ * 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.
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Configured Definition OGNL Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition OGNL Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/tiles-test/index.jsp</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Test Insert Configured Definition with OGNL</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured composite definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured inner definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Modified: tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html?rev=793334&r1=793333&r2=793334&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Sun Jul
12 11:40:59 2009
@@ -106,6 +106,9 @@
<td><a href="ConfiguredDefinitionMVELTest.html">Configured Definition
MVEL Test</a></td>
</tr>
<tr>
+ <td><a href="ConfiguredDefinitionOGNLTest.html">Configured Definition
OGNL Test</a></td>
+ </tr>
+ <tr>
<td><a href="ConfiguredDefinitionELSingleEvalTest.html">Configured
Definition EL with Single Evaluation Test</a></td>
</tr>
<tr>
@@ -304,6 +307,9 @@
<td><a href="freemarker/ConfiguredDefinitionMVELTest.html">FreeMarker:
Configured Definition MVEL Test</a></td>
</tr>
<tr>
+ <td><a href="freemarker/ConfiguredDefinitionOGNLTest.html">FreeMarker:
Configured Definition OGNL Test</a></td>
+ </tr>
+ <tr>
<td><a
href="freemarker/ConfiguredDefinitionELSingleEvalTest.html">FreeMarker:
Configured Definition EL with Single Evaluation Test</a></td>
</tr>
<tr>
@@ -499,6 +505,9 @@
<td><a href="velocity/ConfiguredDefinitionMVELTest.html">Velocity:
Configured Definition MVEL Test</a></td>
</tr>
<tr>
+ <td><a href="velocity/ConfiguredDefinitionOGNLTest.html">Velocity:
Configured Definition OGNL Test</a></td>
+ </tr>
+ <tr>
<td><a
href="velocity/ConfiguredDefinitionELSingleEvalTest.html">Velocity: Configured
Definition EL with Single Evaluation Test</a></td>
</tr>
<tr>
Added:
tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html
(added)
+++
tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,71 @@
+<!--
+/*
+ * $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
+ * 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.
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Configured Definition OGNL Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition OGNL Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/tiles-test/index.jsp</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=FreeMarker: Test Insert Configured Definition with OGNL</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured composite definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured inner definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/freemarker/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html?rev=793334&view=auto
==============================================================================
---
tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html
(added)
+++
tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html
Sun Jul 12 11:40:59 2009
@@ -0,0 +1,71 @@
+<!--
+/*
+ * $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
+ * 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.
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Configured Definition OGNL Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition OGNL Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/tiles-test/index.jsp</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>link=Velocity: Test Insert Configured Definition with OGNL</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured composite definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a configured inner definition.</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is the header</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>This is a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/velocity/ConfiguredDefinitionOGNLTest.html
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL