You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2007/10/26 20:51:17 UTC

svn commit: r588745 - in /tiles/framework/trunk: tiles-core/src/main/java/org/apache/tiles/definition/digester/ tiles-test/ tiles-test/src/main/webapp/ tiles-test/src/main/webapp/WEB-INF/ tiles-test/src/test/selenium/

Author: apetrelli
Date: Fri Oct 26 11:51:16 2007
New Revision: 588745

URL: http://svn.apache.org/viewvc?rev=588745&view=rev
Log:
TILES-156
Fixed a problem in extendibility of DigesterDefinitionsReader.
Added test inside tiles-test.

Added:
    tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml   (with props)
    tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp   (with props)
    tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.html   (with props)
Modified:
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
    tiles/framework/trunk/tiles-test/pom.xml
    tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/web.xml
    tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
    tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java?rev=588745&r1=588744&r2=588745&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java Fri Oct 26 11:51:16 2007
@@ -260,6 +260,8 @@
         } catch (IOException e) {
             throw new DefinitionsFactoryException(
                 "I/O Error reading definitions.", e);
+        } finally {
+            digester.clear();
         }
 
         return definitions;

Modified: tiles/framework/trunk/tiles-test/pom.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/pom.xml?rev=588745&r1=588744&r2=588745&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/pom.xml (original)
+++ tiles/framework/trunk/tiles-test/pom.xml Fri Oct 26 11:51:16 2007
@@ -43,6 +43,11 @@
          <version>${pom.version}</version>
       </dependency>
       <dependency>
+         <groupId>${pom.groupId}</groupId>
+         <artifactId>tiles-compat</artifactId>
+         <version>${pom.version}</version>
+      </dependency>
+      <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
          <version>2.4</version>

Added: tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml?rev=588745&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml Fri Oct 26 11:51:16 2007
@@ -0,0 +1,39 @@
+<?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
+ * 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 1.1//EN"
+       "http://struts.apache.org/dtds/tiles-config_1_1.dtd">
+
+<!-- Definitions for Tiles documentation   -->
+
+<tiles-definitions>
+
+  <definition name="test.definition.old_format" template="/layout.jsp">
+      <put name="title"  value="This is a definition configured in 1.1 format."/>
+      <put name="header" value="/header.jsp"/>
+      <put name="body"   value="/body.jsp"/>
+  </definition>
+
+</tiles-definitions>

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs-1.1.xml
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/web.xml?rev=588745&r1=588744&r2=588745&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/web.xml (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/web.xml Fri Oct 26 11:51:16 2007
@@ -76,7 +76,11 @@
         <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
         <init-param>
             <param-name>definitions-config</param-name>
-            <param-value>/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml</param-value>
+            <param-value>/WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml,/WEB-INF/tiles-defs-1.1.xml</param-value>
+        </init-param>
+        <init-param>
+            <param-name>org.apache.tiles.definition.DefinitionsReader</param-name>
+            <param-value>org.apache.tiles.compat.definition.digester.CompatibilityDigesterDefinitionsReader</param-value>
         </init-param>
         <load-on-startup>2</load-on-startup>
     </servlet>

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=588745&r1=588744&r2=588745&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Fri Oct 26 11:51:16 2007
@@ -44,6 +44,7 @@
     <a href="testinsertdefinition_composite.jsp">Test Insert Configured Definition that contains another definition inside</a><br/>
     <a href="testinsertdefinition_exception.jsp">Test Insert Configured Definition with an exception in an attribute page</a><br/>
     <a href="testinsertdefinition_freemarker.jsp">Test Insert Configured Definition with FreeMarker</a><br/>
+    <a href="testinsertdefinition_old.jsp">Test Insert Configured Definition in Old Format</a><br/>
     <a href="testput.jsp">Test Put Tag</a><br/>
     <a href="testput_flush.jsp">Test Put Tag with Flush</a><br/>
     <a href="testput_el.jsp">Test Put Tag using EL</a><br/>

Added: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp?rev=588745&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp Fri Oct 26 11:51:16 2007
@@ -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.definition.old_format" />

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_old.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.html?rev=588745&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.html (added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.html Fri Oct 26 11:51:16 2007
@@ -0,0 +1,61 @@
+<!--
+/*
+ * $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 Old Format Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition Old Format 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 in Old Format</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is a definition configured in 1.1 format.</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/ConfiguredDefinitionOldFormatTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionOldFormatTest.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=588745&r1=588744&r2=588745&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Fri Oct 26 11:51:16 2007
@@ -64,6 +64,9 @@
         <td><a href="ConfiguredDefinitionExceptionTest.html">Configured Definition with Exception Test</a></td>
     </tr>
     <tr>
+        <td><a href="ConfiguredDefinitionOldFormatTest.html">Configured Definition Old Format Test</a></td>
+    </tr>
+    <tr>
         <td><a href="PutTagTest.html">Put Tag Test</a></td>
     </tr>
     <tr>