From sschneider@example.com Wed Apr 01 20:21:11 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 59008 invoked from network); 1 Apr 2009 20:21:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 20:21:11 -0000 Received: (qmail 1837 invoked by uid 500); 1 Apr 2009 20:21:11 -0000 Delivered-To: sschneider@example.com Received: (qmail 1811 invoked by uid 500); 1 Apr 2009 20:21:11 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 1802 invoked by uid 99); 1 Apr 2009 20:21:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:21:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:21:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7D8F0238889B; Wed, 1 Apr 2009 20:20:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761041 - in /tiles/framework/trunk/tiles-template/src: main/java/org/apache/tiles/template/AddListAttributeModel.java test/java/org/apache/tiles/template/AddListAttributeModelTest.java Date: Wed, 01 Apr 2009 20:20:50 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 20:20:50 2009 New Revision: 761041 URL: http://svn.apache.org/viewvc?rev=761041&view=rev Log: TILES-389 Now the child ListAttribute is put in the parent. Modified: tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java Modified: tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java?rev=761041&r1=761040&r2=761041&view=diff ============================================================================== --- tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java (original) +++ tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java Wed Apr 1 20:20:50 2009 @@ -58,10 +58,11 @@ * Ends the operation. * * @param composeStack The composing stack. - * @return The composed list attributes. * @since 2.2.0 */ - public ListAttribute end(Stack<Object> composeStack) { - return (ListAttribute) composeStack.pop(); + public void end(Stack<Object> composeStack) { + ListAttribute listAttribute = (ListAttribute) composeStack.pop(); + ListAttribute parent = (ListAttribute) composeStack.peek(); + parent.add(listAttribute); } } Modified: tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java?rev=761041&r1=761040&r2=761041&view=diff ============================================================================== --- tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java (original) +++ tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java Wed Apr 1 20:20:50 2009 @@ -5,8 +5,10 @@ import static org.junit.Assert.*; +import java.util.List; import java.util.Stack; +import org.apache.tiles.Attribute; import org.apache.tiles.ListAttribute; import org.junit.Before; import org.junit.Test; @@ -45,13 +47,20 @@ /** * Test method for {@link org.apache.tiles.template.AddListAttributeModel#end(java.util.Stack)}. */ + @SuppressWarnings("unchecked") @Test public void testEnd() { Stack<Object> composeStack = new Stack<Object>(); ListAttribute listAttribute = new ListAttribute(); + ListAttribute parent = new ListAttribute(); + composeStack.push(parent); composeStack.push(listAttribute); model.end(composeStack); - assertEquals(0, composeStack.size()); + assertEquals(1, composeStack.size()); + assertEquals(parent, composeStack.peek()); + List<Attribute> attributes = (List<Attribute>) parent.getValue(); + assertEquals(1, attributes.size()); + assertEquals(listAttribute, attributes.get(0)); } } From sschneider@example.com Wed Apr 01 20:43:21 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 68125 invoked from network); 1 Apr 2009 20:43:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 20:43:21 -0000 Received: (qmail 37109 invoked by uid 500); 1 Apr 2009 20:43:21 -0000 Delivered-To: sschneider@example.com Received: (qmail 37087 invoked by uid 500); 1 Apr 2009 20:43:21 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 37075 invoked by uid 99); 1 Apr 2009 20:43:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:43:21 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:43:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7527B238896D; Wed, 1 Apr 2009 20:43:00 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761052 - in /tiles/framework/trunk/tiles-core/src: main/java/org/apache/tiles/definition/dao/ test/java/org/apache/tiles/config/ test/java/org/apache/tiles/definition/dao/ Date: Wed, 01 Apr 2009 20:43:00 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 20:42:59 2009 New Revision: 761052 URL: http://svn.apache.org/viewvc?rev=761052&view=rev Log: TILES-388 Added checking for local attribute names set being null. Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java?rev=761052&r1=761051&r2=761052&view=diff ============================================================================== --- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java (original) +++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java Wed Apr 1 20:42:59 2009 @@ -28,6 +28,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import org.apache.tiles.Attribute; import org.apache.tiles.Definition; @@ -350,11 +351,14 @@ nudef.setTemplateAttribute(replaceVarsInAttribute(d .getTemplateAttribute(), vars)); - for (String attributeName : d.getLocalAttributeNames()) { - Attribute attr = d.getLocalAttribute(attributeName); - Attribute nuattr = replaceVarsInAttribute(attr, vars); - - nudef.putAttribute(replace(attributeName, vars), nuattr); + Set<String> localAttributeNames = d.getLocalAttributeNames(); + if (localAttributeNames != null && !localAttributeNames.isEmpty()) { + for (String attributeName : localAttributeNames) { + Attribute attr = d.getLocalAttribute(attributeName); + Attribute nuattr = replaceVarsInAttribute(attr, vars); + + nudef.putAttribute(replace(attributeName, vars), nuattr); + } } return nudef; Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml?rev=761052&r1=761051&r2=761052&view=diff ============================================================================== --- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml (original) +++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml Wed Apr 1 20:42:59 2009 @@ -44,5 +44,6 @@ <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" /> </tiles-definitions> Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java?rev=761052&r1=761051&r2=761052&view=diff ============================================================================== --- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java (original) +++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java Wed Apr 1 20:42:59 2009 @@ -652,6 +652,9 @@ 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()); + assertEquals(null, definition.getLocalAttributeNames()); definition = definitionDao.getDefinition("test.def3", null); assertNotNull("The simple definition is null", definition); } From sschneider@example.com Wed Apr 01 20:52:23 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 70737 invoked from network); 1 Apr 2009 20:52:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 20:52:23 -0000 Received: (qmail 53313 invoked by uid 500); 1 Apr 2009 20:52:22 -0000 Delivered-To: sschneider@example.com Received: (qmail 53293 invoked by uid 500); 1 Apr 2009 20:52:22 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 53280 invoked by uid 99); 1 Apr 2009 20:52:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:52:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 20:52:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6A518238896D; Wed, 1 Apr 2009 20:52:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761054 - in /tiles/framework/branches/TILES_2_1_X/tiles-core/src: main/java/org/apache/tiles/definition/dao/ test/java/org/apache/tiles/config/ test/java/org/apache/tiles/definition/dao/ Date: Wed, 01 Apr 2009 20:52:01 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 20:52:00 2009 New Revision: 761054 URL: http://svn.apache.org/viewvc?rev=761054&view=rev Log: TILES-388 Merge from trunk to TILES_2_1_X branch. Added checking for local attribute names set being null. Modified: tiles/framework/branches/TILES_2_1_X/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java Modified: tiles/framework/branches/TILES_2_1_X/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java?rev=761054&r1=761053&r2=761054&view=diff ============================================================================== --- tiles/framework/branches/TILES_2_1_X/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java (original) +++ tiles/framework/branches/TILES_2_1_X/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java Wed Apr 1 20:52:00 2009 @@ -28,6 +28,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; import org.apache.tiles.Attribute; import org.apache.tiles.Definition; @@ -350,11 +351,14 @@ nudef.setTemplateAttribute(replaceVarsInAttribute(d .getTemplateAttribute(), vars)); - for (String attributeName : d.getLocalAttributeNames()) { - Attribute attr = d.getLocalAttribute(attributeName); - Attribute nuattr = replaceVarsInAttribute(attr, vars); - - nudef.putAttribute(replace(attributeName, vars), nuattr); + Set<String> localAttributeNames = d.getLocalAttributeNames(); + if (localAttributeNames != null && !localAttributeNames.isEmpty()) { + for (String attributeName : localAttributeNames) { + Attribute attr = d.getLocalAttribute(attributeName); + Attribute nuattr = replaceVarsInAttribute(attr, vars); + + nudef.putAttribute(replace(attributeName, vars), nuattr); + } } return nudef; Modified: tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml?rev=761054&r1=761053&r2=761054&view=diff ============================================================================== --- tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml (original) +++ tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/config/defs-wildcard.xml Wed Apr 1 20:52:00 2009 @@ -44,5 +44,6 @@ <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" /> </tiles-definitions> Modified: tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java?rev=761054&r1=761053&r2=761054&view=diff ============================================================================== --- tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java (original) +++ tiles/framework/branches/TILES_2_1_X/tiles-core/src/test/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAOTest.java Wed Apr 1 20:52:00 2009 @@ -652,6 +652,9 @@ 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()); + assertEquals(null, definition.getLocalAttributeNames()); definition = definitionDao.getDefinition("test.def3", null); assertNotNull("The simple definition is null", definition); } From sschneider@example.com Wed Apr 01 21:06:48 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 76354 invoked from network); 1 Apr 2009 21:06:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 21:06:48 -0000 Received: (qmail 76318 invoked by uid 500); 1 Apr 2009 21:06:48 -0000 Delivered-To: sschneider@example.com Received: (qmail 76298 invoked by uid 500); 1 Apr 2009 21:06:48 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 76289 invoked by uid 99); 1 Apr 2009 21:06:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:06:48 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:06:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 819592388A36; Wed, 1 Apr 2009 21:06:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761061 - /tiles/framework/trunk/src/site/apt/config-reference.apt Date: Wed, 01 Apr 2009 21:06:27 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 21:06:27 2009 New Revision: 761061 URL: http://svn.apache.org/viewvc?rev=761061&view=rev Log: TILES-390 Added docs for CHECK_REFRESH. Modified: tiles/framework/trunk/src/site/apt/config-reference.apt Modified: tiles/framework/trunk/src/site/apt/config-reference.apt URL: http://svn.apache.org/viewvc/tiles/framework/trunk/src/site/apt/config-reference.apt?rev=761061&r1=761060&r2=761061&view=diff ============================================================================== --- tiles/framework/trunk/src/site/apt/config-reference.apt (original) +++ tiles/framework/trunk/src/site/apt/config-reference.apt Wed Apr 1 21:06:27 2009 @@ -57,25 +57,31 @@ | {{{config-reference.html#org.apache.tiles.renderer.impl.BasicRendererFactory.DEFAULT_RENDERER}<<<org.apache.tiles.renderer.impl.BasicRendererFactory.DEFAULT_RENDERER>>>}} | Default attribute renderer class name | *---------------------------------------------+--------------------------------------+ - [[2]] {{{config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>> configuration}}. + [[2]] {{{config-reference.html#CachingLocaleUrlDefinitionDAO_configuration}<<<CachingLocaleUrlDefinitionDAO>>> configuration}}. + +*---------------------------------------------+--------------------------------------+ +| {{{config-reference.html#org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH}<<<org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH>>>}} | Flag to enable automatic refresh check | +*---------------------------------------------+--------------------------------------+ + + [[3]] {{{config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES>>>}} | List of elementary application factory class names | *---------------------------------------------+--------------------------------------+ - [[3]] {{{config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>> configuration}}. + [[4]] {{{config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES>>>}} | List of elementary request factory class names | *---------------------------------------------+--------------------------------------+ - [[4]] {{{config-reference.html#DigesterDefinitionsReader_configuration}<<<DigesterDefinitionsReader>>> configuration}}. + [[5]] {{{config-reference.html#DigesterDefinitionsReader_configuration}<<<DigesterDefinitionsReader>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE}<<<org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE>>>}} | Flag to deactivate XML parser validation | *---------------------------------------------+--------------------------------------+ - [[5]] {{{config-reference.html#UrlDefinitionsFactory_configuration}<<<UrlDefinitionsFactory>>> configuration}}. + [[6]] {{{config-reference.html#UrlDefinitionsFactory_configuration}<<<UrlDefinitionsFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.definition.DefinitionsReader}<<<org.apache.tiles.definition.DefinitionsReader>>>}} | Definitions reader class name | @@ -83,7 +89,7 @@ | {{{config-reference.html#org.apache.tiles.locale.LocaleResolver}<<<org.apache.tiles.locale.LocaleResolver>>>}} | Locale resolver class name | *---------------------------------------------+--------------------------------------+ - [[6]] {{{config-reference.html#Initialization_configuration}<<<Initialization>>> configuration}}. + [[7]] {{{config-reference.html#Initialization_configuration}<<<Initialization>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.startup.BasicTilesInitializer.CONTAINER_KEY}<<<org.apache.tiles.startup.BasicTilesInitializer.CONTAINER_KEY>>>}} | Container key | @@ -265,6 +271,19 @@ * <<Usage>>: when specified, it must contain a comma-separated list of paths of files that contain Tiles definitions. +* {<<<CachingLocaleUrlDefinitionDAO>>> configuration} + +** {<<<org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH>>>} + + Flag that indicates whether to auto-refresh definitions when definition files are modified. + + * <<Specified in>>: + {{{apidocs/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.html#CHECK_REFRESH_INIT_PARAMETER}<<<org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO>>>}}. + + * <<Default>>: <<<false>>> (no caching) + + * <<Usage>>: Set to <<<true>>> if you want to enable auto refresh of definitions files. + * {<<<ChainedTilesApplicationContextFactory>>> configuration} ** {<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES>>>} From sschneider@example.com Wed Apr 01 21:09:29 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 76754 invoked from network); 1 Apr 2009 21:09:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 21:09:29 -0000 Received: (qmail 80550 invoked by uid 500); 1 Apr 2009 21:09:29 -0000 Delivered-To: sschneider@example.com Received: (qmail 80529 invoked by uid 500); 1 Apr 2009 21:09:29 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 80520 invoked by uid 99); 1 Apr 2009 21:09:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:09:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:09:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A75C5238896D; Wed, 1 Apr 2009 21:09:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761063 - /tiles/framework/branches/TILES_2_1_X/ Date: Wed, 01 Apr 2009 21:09:07 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 21:09:07 2009 New Revision: 761063 URL: http://svn.apache.org/viewvc?rev=761063&view=rev Log: TILES-388 Merge from trunk to TILES_2_1_X branch. Fixed merge info. Modified: tiles/framework/branches/TILES_2_1_X/ (props changed) Propchange: tiles/framework/branches/TILES_2_1_X/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Apr 1 21:09:07 2009 @@ -1 +1 @@ -/tiles/framework/trunk:749981 +/tiles/framework/trunk:749981,761052 From sschneider@example.com Wed Apr 01 21:11:14 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 77236 invoked from network); 1 Apr 2009 21:11:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Apr 2009 21:11:14 -0000 Received: (qmail 82944 invoked by uid 500); 1 Apr 2009 21:11:14 -0000 Delivered-To: sschneider@example.com Received: (qmail 82923 invoked by uid 500); 1 Apr 2009 21:11:14 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 82912 invoked by uid 99); 1 Apr 2009 21:11:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:11:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 21:11:12 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 48F59238896D; Wed, 1 Apr 2009 21:10:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761064 - in /tiles/framework/branches/TILES_2_1_X: ./ src/site/apt/config-reference.apt Date: Wed, 01 Apr 2009 21:10:50 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Wed Apr 1 21:10:49 2009 New Revision: 761064 URL: http://svn.apache.org/viewvc?rev=761064&view=rev Log: TILES-390 Merge from trunk to TILES_2_1_X branch. Added docs for CHECK_REFRESH. Modified: tiles/framework/branches/TILES_2_1_X/ (props changed) tiles/framework/branches/TILES_2_1_X/src/site/apt/config-reference.apt Propchange: tiles/framework/branches/TILES_2_1_X/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Apr 1 21:10:49 2009 @@ -1 +1 @@ -/tiles/framework/trunk:749981,761052 +/tiles/framework/trunk:749981,761052,761061 Modified: tiles/framework/branches/TILES_2_1_X/src/site/apt/config-reference.apt URL: http://svn.apache.org/viewvc/tiles/framework/branches/TILES_2_1_X/src/site/apt/config-reference.apt?rev=761064&r1=761063&r2=761064&view=diff ============================================================================== --- tiles/framework/branches/TILES_2_1_X/src/site/apt/config-reference.apt (original) +++ tiles/framework/branches/TILES_2_1_X/src/site/apt/config-reference.apt Wed Apr 1 21:10:49 2009 @@ -57,25 +57,31 @@ | {{{config-reference.html#org.apache.tiles.renderer.impl.BasicRendererFactory.DEFAULT_RENDERER}<<<org.apache.tiles.renderer.impl.BasicRendererFactory.DEFAULT_RENDERER>>>}} | Default attribute renderer class name | *---------------------------------------------+--------------------------------------+ - [[2]] {{{config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>> configuration}}. + [[2]] {{{config-reference.html#CachingLocaleUrlDefinitionDAO_configuration}<<<CachingLocaleUrlDefinitionDAO>>> configuration}}. + +*---------------------------------------------+--------------------------------------+ +| {{{config-reference.html#org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH}<<<org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH>>>}} | Flag to enable automatic refresh check | +*---------------------------------------------+--------------------------------------+ + + [[3]] {{{config-reference.html#ChainedTilesApplicationContextFactory_configuration}<<<ChainedTilesApplicationContextFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES>>>}} | List of elementary application factory class names | *---------------------------------------------+--------------------------------------+ - [[3]] {{{config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>> configuration}}. + [[4]] {{{config-reference.html#ChainedTilesRequestContextFactory_configuration}<<<ChainedTilesRequestContextFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES}<<<org.apache.tiles.context.ChainedTilesRequestContextFactory.FACTORY_CLASS_NAMES>>>}} | List of elementary request factory class names | *---------------------------------------------+--------------------------------------+ - [[4]] {{{config-reference.html#DigesterDefinitionsReader_configuration}<<<DigesterDefinitionsReader>>> configuration}}. + [[5]] {{{config-reference.html#DigesterDefinitionsReader_configuration}<<<DigesterDefinitionsReader>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE}<<<org.apache.tiles.definition.digester.DigesterDefinitionsReader.PARSER_VALIDATE>>>}} | Flag to deactivate XML parser validation | *---------------------------------------------+--------------------------------------+ - [[5]] {{{config-reference.html#UrlDefinitionsFactory_configuration}<<<UrlDefinitionsFactory>>> configuration}}. + [[6]] {{{config-reference.html#UrlDefinitionsFactory_configuration}<<<UrlDefinitionsFactory>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.definition.DefinitionsReader}<<<org.apache.tiles.definition.DefinitionsReader>>>}} | Definitions reader class name | @@ -83,7 +89,7 @@ | {{{config-reference.html#org.apache.tiles.locale.LocaleResolver}<<<org.apache.tiles.locale.LocaleResolver>>>}} | Locale resolver class name | *---------------------------------------------+--------------------------------------+ - [[6]] {{{config-reference.html#Initialization_configuration}<<<Initialization>>> configuration}}. + [[7]] {{{config-reference.html#Initialization_configuration}<<<Initialization>>> configuration}}. *---------------------------------------------+--------------------------------------+ | {{{config-reference.html#org.apache.tiles.startup.BasicTilesInitializer.CONTAINER_KEY}<<<org.apache.tiles.startup.BasicTilesInitializer.CONTAINER_KEY>>>}} | Container key | @@ -265,6 +271,19 @@ * <<Usage>>: when specified, it must contain a comma-separated list of paths of files that contain Tiles definitions. +* {<<<CachingLocaleUrlDefinitionDAO>>> configuration} + +** {<<<org.apache.tiles.definition.dao.LocaleUrlDefinitionDAO.CHECK_REFRESH>>>} + + Flag that indicates whether to auto-refresh definitions when definition files are modified. + + * <<Specified in>>: + {{{apidocs/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.html#CHECK_REFRESH_INIT_PARAMETER}<<<org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO>>>}}. + + * <<Default>>: <<<false>>> (no caching) + + * <<Usage>>: Set to <<<true>>> if you want to enable auto refresh of definitions files. + * {<<<ChainedTilesApplicationContextFactory>>> configuration} ** {<<<org.apache.tiles.context.ChainedTilesApplicationContextFactory.FACTORY_CLASS_NAMES>>>} From sschneider@example.com Thu Apr 02 02:33:15 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 4773 invoked from network); 2 Apr 2009 02:33:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2009 02:33:15 -0000 Received: (qmail 13489 invoked by uid 500); 2 Apr 2009 02:33:14 -0000 Delivered-To: sschneider@example.com Received: (qmail 13468 invoked by uid 500); 2 Apr 2009 02:33:14 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 13459 invoked by uid 99); 2 Apr 2009 02:33:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 02:33:14 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=10.0 tests=ALL_TRUSTED,INVALID_DATE X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmbuild.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 02:33:12 +0000 Received: from vmbuild.apache.org (localhost [83.161.120.155]) by vmbuild.apache.org (Postfix) with ESMTP id 7E310458156 for <sschneider@example.com>; Wed, 1 Apr 2009 19:32:51 -0700 (PDT) Date: Wed, 01 Apr 09 19:32:50 -0700 From: "sschneider@example.com" <sschneider@example.com> Reply-To: "sschneider@example.com" <sschneider@example.com> To: sschneider@example.com Message-ID: <sschneider@example.com> Subject: [continuum] BUILD SUCCESSFUL: Tiles - Tiles - Template Technologies Support - MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=179885&projectId=2179 Build statistics: State: Ok Previous State: Failed Started at: Wed 1 Apr 2009 19:32:27 -0700 Finished at: Wed 1 Apr 2009 19:32:45 -0700 Total time: 17s Build Trigger: Schedule Build Number: 8 Exit code: 0 Building machine hostname: vmbuild.apache.org Operating system : Linux(unknown) Java Home version : java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing) Builder version : Maven version: 2.0.9 Java version: 1.6.0_05 OS name: "linux" version: "2.6.20-16-server" arch: "i386" Family: "unix" **************************************************************************** SCM Changes: **************************************************************************** Changed: apetrelli @ Wed 1 Apr 2009 13:20:50 -0700 Comment: TILES-389 Now the child ListAttribute is put in the parent. Files changed: /tiles/framework/trunk/tiles-template/src/main/java/org/apache/tiles/template/AddListAttributeModel.java ( 761041 ) /tiles/framework/trunk/tiles-template/src/test/java/org/apache/tiles/template/AddListAttributeModelTest.java ( 761041 ) **************************************************************************** Dependencies Changes: **************************************************************************** No dependencies changed **************************************************************************** Build Definition: **************************************************************************** POM filename: pom.xml Goals: clean install Arguments: --batch-mode --non-recursive -Pj4 Build Fresh: false Always Build: false Default Build Definition: true Schedule: FOUR_TIMES_A_DAY_1 Description: **************************************************************************** Test Summary: **************************************************************************** Tests: 36 Failures: 0 Total time: 0.61700004 From sschneider@example.com Thu Apr 02 08:27:11 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 34357 invoked from network); 2 Apr 2009 08:27:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2009 08:27:11 -0000 Received: (qmail 69046 invoked by uid 500); 2 Apr 2009 08:27:10 -0000 Delivered-To: sschneider@example.com Received: (qmail 69022 invoked by uid 500); 2 Apr 2009 08:27:10 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 69013 invoked by uid 99); 2 Apr 2009 08:27:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:27:10 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=10.0 tests=ALL_TRUSTED,INVALID_DATE X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmbuild.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:27:09 +0000 Received: from vmbuild.apache.org (localhost [83.161.120.155]) by vmbuild.apache.org (Postfix) with ESMTP id DC57F458156 for <sschneider@example.com>; Thu, 2 Apr 2009 01:26:47 -0700 (PDT) Date: Thu, 02 Apr 09 01:26:47 -0700 From: "sschneider@example.com" <sschneider@example.com> Reply-To: "sschneider@example.com" <sschneider@example.com> To: sschneider@example.com Message-ID: <sschneider@example.com> Subject: [continuum] BUILD SUCCESSFUL: Tiles - Tiles - Compatibility - MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=180153&projectId=213 Build statistics: State: Ok Previous State: Failed Started at: Thu 2 Apr 2009 01:26:15 -0700 Finished at: Thu 2 Apr 2009 01:26:38 -0700 Total time: 23s Build Trigger: Schedule Build Number: 99 Exit code: 0 Building machine hostname: vmbuild.apache.org Operating system : Linux(unknown) Java Home version : java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing) Builder version : Maven version: 2.0.9 Java version: 1.6.0_05 OS name: "linux" version: "2.6.20-16-server" arch: "i386" Family: "unix" **************************************************************************** SCM Changes: **************************************************************************** No files changed **************************************************************************** Dependencies Changes: **************************************************************************** org.apache.tiles:tiles-core:2.2.0-SNAPSHOT org.apache.tiles:tiles-parent:2.2.0-SNAPSHOT **************************************************************************** Build Definition: **************************************************************************** POM filename: pom.xml Goals: clean install Arguments: --batch-mode --non-recursive -Pj4 Build Fresh: false Always Build: false Default Build Definition: true Schedule: FOUR_TIMES_A_DAY_1 Description: **************************************************************************** Test Summary: **************************************************************************** Tests: 6 Failures: 0 Total time: 0.584 From sschneider@example.com Thu Apr 02 08:33:11 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 36501 invoked from network); 2 Apr 2009 08:33:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2009 08:33:11 -0000 Received: (qmail 75665 invoked by uid 500); 2 Apr 2009 08:33:10 -0000 Delivered-To: sschneider@example.com Received: (qmail 75645 invoked by uid 500); 2 Apr 2009 08:33:10 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 75636 invoked by uid 99); 2 Apr 2009 08:33:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:33:10 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=10.0 tests=ALL_TRUSTED,INVALID_DATE X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmbuild.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:33:09 +0000 Received: from vmbuild.apache.org (localhost [83.161.120.155]) by vmbuild.apache.org (Postfix) with ESMTP id 0EFBD458156 for <sschneider@example.com>; Thu, 2 Apr 2009 01:32:48 -0700 (PDT) Date: Thu, 02 Apr 09 01:32:47 -0700 From: "sschneider@example.com" <sschneider@example.com> Reply-To: "sschneider@example.com" <sschneider@example.com> To: sschneider@example.com Message-ID: <sschneider@example.com> Subject: [continuum] BUILD SUCCESSFUL: Tiles - Tiles - FreeMarker Support - MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=180156&projectId=1799 Build statistics: State: Ok Previous State: Failed Started at: Thu 2 Apr 2009 01:32:23 -0700 Finished at: Thu 2 Apr 2009 01:32:42 -0700 Total time: 19s Build Trigger: Schedule Build Number: 8 Exit code: 0 Building machine hostname: vmbuild.apache.org Operating system : Linux(unknown) Java Home version : java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing) Builder version : Maven version: 2.0.9 Java version: 1.6.0_05 OS name: "linux" version: "2.6.20-16-server" arch: "i386" Family: "unix" **************************************************************************** SCM Changes: **************************************************************************** No files changed **************************************************************************** Dependencies Changes: **************************************************************************** org.apache.tiles:tiles-servlet:2.2.0-SNAPSHOT org.apache.tiles:tiles-template:2.2.0-SNAPSHOT org.apache.tiles:tiles-parent:2.2.0-SNAPSHOT **************************************************************************** Build Definition: **************************************************************************** POM filename: pom.xml Goals: clean install Arguments: --batch-mode --non-recursive -Pj4 Build Fresh: false Always Build: false Default Build Definition: true Schedule: FOUR_TIMES_A_DAY_1 Description: **************************************************************************** Test Summary: **************************************************************************** Tests: 28 Failures: 0 Total time: 0.875 From sschneider@example.com Thu Apr 02 08:34:17 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 37142 invoked from network); 2 Apr 2009 08:34:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2009 08:34:17 -0000 Received: (qmail 77469 invoked by uid 500); 2 Apr 2009 08:34:17 -0000 Delivered-To: sschneider@example.com Received: (qmail 77449 invoked by uid 500); 2 Apr 2009 08:34:17 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 77440 invoked by uid 99); 2 Apr 2009 08:34:17 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:34:17 +0000 X-ASF-Spam-Status: No, hits=-1998.3 required=10.0 tests=ALL_TRUSTED,INVALID_DATE X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO vmbuild.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 08:34:17 +0000 Received: from vmbuild.apache.org (localhost [83.161.120.155]) by vmbuild.apache.org (Postfix) with ESMTP id BB769458156 for <sschneider@example.com>; Thu, 2 Apr 2009 01:33:56 -0700 (PDT) Date: Thu, 02 Apr 09 01:33:56 -0700 From: "sschneider@example.com" <sschneider@example.com> Reply-To: "sschneider@example.com" <sschneider@example.com> To: sschneider@example.com Message-ID: <sschneider@example.com> Subject: [continuum] BUILD SUCCESSFUL: Tiles - Tiles - JSP support - MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=180158&projectId=212 Build statistics: State: Ok Previous State: Failed Started at: Thu 2 Apr 2009 01:33:32 -0700 Finished at: Thu 2 Apr 2009 01:33:50 -0700 Total time: 18s Build Trigger: Schedule Build Number: 99 Exit code: 0 Building machine hostname: vmbuild.apache.org Operating system : Linux(unknown) Java Home version : java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing) Builder version : Maven version: 2.0.9 Java version: 1.6.0_05 OS name: "linux" version: "2.6.20-16-server" arch: "i386" Family: "unix" **************************************************************************** SCM Changes: **************************************************************************** No files changed **************************************************************************** Dependencies Changes: **************************************************************************** org.apache.tiles:tiles-servlet:2.2.0-SNAPSHOT org.apache.tiles:tiles-template:2.2.0-SNAPSHOT org.apache.tiles:tiles-parent:2.2.0-SNAPSHOT **************************************************************************** Build Definition: **************************************************************************** POM filename: pom.xml Goals: clean install Arguments: --batch-mode --non-recursive -Pj4 Build Fresh: false Always Build: false Default Build Definition: true Schedule: FOUR_TIMES_A_DAY_1 Description: **************************************************************************** Test Summary: **************************************************************************** Tests: 42 Failures: 0 Total time: 0.602 From sschneider@example.com Thu Apr 02 22:02:49 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 83949 invoked from network); 2 Apr 2009 22:02:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2009 22:02:49 -0000 Received: (qmail 22561 invoked by uid 500); 2 Apr 2009 22:02:49 -0000 Delivered-To: sschneider@example.com Received: (qmail 22542 invoked by uid 500); 2 Apr 2009 22:02:49 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 22533 invoked by uid 99); 2 Apr 2009 22:02:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 22:02:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Apr 2009 22:02:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BD0212388A13; Thu, 2 Apr 2009 22:02:27 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761441 - /tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ Date: Thu, 02 Apr 2009 22:02:26 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Thu Apr 2 22:02:23 2009 New Revision: 761441 URL: http://svn.apache.org/viewvc?rev=761441&view=rev Log: TILES-382 Second bunch of new FreeMarker support tests. Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java (with props) Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java?rev=761441&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java Thu Apr 2 22:02:23 2009 @@ -0,0 +1,120 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.freemarker.context.FreeMarkerUtil; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.template.AddListAttributeModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class AddListAttributeFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.AddListAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + AddListAttributeModel tModel = createMock(AddListAttributeModel.class); + AddListAttributeFMModel fmModel = new AddListAttributeFMModel(tModel); + HttpServletRequest request = createMock(HttpServletRequest.class); + + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Stack<Object> composeStack = new Stack<Object>(); + Map<String, Object> params = new HashMap<String, Object>(); + params.put("role", objectWrapper.wrap("myRole")); + + expect(request.getAttribute(FreeMarkerUtil.COMPOSE_STACK_ATTRIBUTE_NAME)).andReturn(composeStack); + tModel.start(composeStack, "myRole"); + tModel.end(composeStack); + body.render(isA(NullWriter.class)); + + replay(request, tModel, body); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/AddListAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java?rev=761441&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java Thu Apr 2 22:02:23 2009 @@ -0,0 +1,142 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.context.FreeMarkerUtil; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.mgmt.MutableTilesContainer; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.DefinitionModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class DefinitionFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.DefinitionFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + DefinitionModel tModel = createMock(DefinitionModel.class); + DefinitionFMModel fmModel = new DefinitionFMModel(tModel); + MutableTilesContainer container = createMock(MutableTilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + Stack<Object> composeStack = new Stack<Object>(); + expect(request.getAttribute(FreeMarkerUtil.COMPOSE_STACK_ATTRIBUTE_NAME)).andReturn(composeStack).times(2); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + params.put("name", objectWrapper.wrap("myName")); + params.put("template", objectWrapper.wrap("myTemplate")); + params.put("role", objectWrapper.wrap("myRole")); + params.put("extends", objectWrapper.wrap("myExtends")); + params.put("preparer", objectWrapper.wrap("myPreparer")); + + tModel.start(composeStack, "myName", "myTemplate", "myRole", "myExtends", "myPreparer"); + tModel.end(container, composeStack, env); + body.render(isA(NullWriter.class)); + + replay(tModel, body, container); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/DefinitionFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java?rev=761441&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java Thu Apr 2 22:02:23 2009 @@ -0,0 +1,147 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.Attribute; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.context.FreeMarkerUtil; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.GetAsStringModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class GetAsStringFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.GetAsStringFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + GetAsStringModel tModel = createMock(GetAsStringModel.class); + GetAsStringFMModel fmModel = new GetAsStringFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + Stack<Object> composeStack = new Stack<Object>(); + expect(request.getAttribute(FreeMarkerUtil.COMPOSE_STACK_ATTRIBUTE_NAME)).andReturn(composeStack).times(2); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("preparer", objectWrapper.wrap("myPreparer")); + params.put("role", objectWrapper.wrap("myRole")); + params.put("defaultValue", objectWrapper.wrap("myDefaultValue")); + params.put("defaultValueRole", objectWrapper.wrap("myDefaultValueRole")); + params.put("defaultValueType", objectWrapper.wrap("myDefaultValueType")); + params.put("name", objectWrapper.wrap("myName")); + params.put("value", objectWrapper.wrap(attribute)); + + tModel.start(composeStack, container, false, "myPreparer", "myRole", "myDefaultValue", "myDefaultValueRole", + "myDefaultValueType", "myName", attribute, env); + tModel.end(composeStack, container, writer, false, env); + body.render(isA(NullWriter.class)); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java?rev=761441&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java Thu Apr 2 22:02:23 2009 @@ -0,0 +1,291 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; +import static org.junit.Assert.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +import org.apache.tiles.Attribute; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.ImportAttributeModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; +import freemarker.template.utility.DeepUnwrap; + +/** + * @author antonio + * + */ +public class ImportAttributeFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.ImportAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + ImportAttributeModel tModel = createMock(ImportAttributeModel.class); + ImportAttributeFMModel fmModel = new ImportAttributeFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + expect(template.getObjectWrapper()).andReturn(objectWrapper).times(2); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("name", objectWrapper.wrap("myName")); + params.put("toName", objectWrapper.wrap("myToName")); + params.put("ignore", objectWrapper.wrap(false)); + + Map<String, Object> attributes = new HashMap<String, Object>(); + attributes.put("one", "value1"); + attributes.put("two", "value2"); + expect(tModel.getImportedAttributes(container, "myName", "myToName", + false, env)).andReturn(attributes); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + assertEquals("value1", DeepUnwrap.unwrap(env.getCurrentNamespace().get("one"))); + assertEquals("value2", DeepUnwrap.unwrap(env.getCurrentNamespace().get("two"))); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.ImportAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecuteRequest() throws TemplateException, IOException { + ImportAttributeModel tModel = createMock(ImportAttributeModel.class); + ImportAttributeFMModel fmModel = new ImportAttributeFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + request.setAttribute("one", "value1"); + request.setAttribute("two", "value2"); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("name", objectWrapper.wrap("myName")); + params.put("toName", objectWrapper.wrap("myToName")); + params.put("ignore", objectWrapper.wrap(false)); + params.put("scope", objectWrapper.wrap("request")); + + Map<String, Object> attributes = new HashMap<String, Object>(); + attributes.put("one", "value1"); + attributes.put("two", "value2"); + expect(tModel.getImportedAttributes(container, "myName", "myToName", + false, env)).andReturn(attributes); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.ImportAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecuteSession() throws TemplateException, IOException { + ImportAttributeModel tModel = createMock(ImportAttributeModel.class); + ImportAttributeFMModel fmModel = new ImportAttributeFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + HttpSession session = createMock(HttpSession.class); + expect(request.getSession()).andReturn(session).times(2); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + session.setAttribute("one", "value1"); + session.setAttribute("two", "value2"); + replay(request, session); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("name", objectWrapper.wrap("myName")); + params.put("toName", objectWrapper.wrap("myToName")); + params.put("ignore", objectWrapper.wrap(false)); + params.put("scope", objectWrapper.wrap("session")); + + Map<String, Object> attributes = new HashMap<String, Object>(); + attributes.put("one", "value1"); + attributes.put("two", "value2"); + expect(tModel.getImportedAttributes(container, "myName", "myToName", + false, env)).andReturn(attributes); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, session, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.ImportAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecuteApplication() throws TemplateException, IOException { + ImportAttributeModel tModel = createMock(ImportAttributeModel.class); + ImportAttributeFMModel fmModel = new ImportAttributeFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(4); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + servletContext.setAttribute("one", "value1"); + servletContext.setAttribute("two", "value2"); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel).times(3); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("name", objectWrapper.wrap("myName")); + params.put("toName", objectWrapper.wrap("myToName")); + params.put("ignore", objectWrapper.wrap(false)); + params.put("scope", objectWrapper.wrap("application")); + + Map<String, Object> attributes = new HashMap<String, Object>(); + attributes.put("one", "value1"); + attributes.put("two", "value2"); + expect(tModel.getImportedAttributes(container, "myName", "myToName", + false, env)).andReturn(attributes); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java?rev=761441&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java Thu Apr 2 22:02:23 2009 @@ -0,0 +1,147 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.Attribute; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.context.FreeMarkerUtil; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.InsertAttributeModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class InsertAttributeFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.InsertAttributeFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + InsertAttributeModel tModel = createMock(InsertAttributeModel.class); + InsertAttributeFMModel fmModel = new InsertAttributeFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + Stack<Object> composeStack = new Stack<Object>(); + expect(request.getAttribute(FreeMarkerUtil.COMPOSE_STACK_ATTRIBUTE_NAME)).andReturn(composeStack).times(2); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(2); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("preparer", objectWrapper.wrap("myPreparer")); + params.put("role", objectWrapper.wrap("myRole")); + params.put("defaultValue", objectWrapper.wrap("myDefaultValue")); + params.put("defaultValueRole", objectWrapper.wrap("myDefaultValueRole")); + params.put("defaultValueType", objectWrapper.wrap("myDefaultValueType")); + params.put("name", objectWrapper.wrap("myName")); + params.put("value", objectWrapper.wrap(attribute)); + + tModel.start(composeStack, container, false, "myPreparer", "myRole", "myDefaultValue", "myDefaultValueRole", + "myDefaultValueType", "myName", attribute, env); + tModel.end(composeStack, container, false, env); + body.render(isA(NullWriter.class)); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL From sschneider@example.com Fri Apr 03 21:39:42 2009 Return-Path: <sschneider@example.com> Delivered-To: sschneider@example.com Received: (qmail 12723 invoked from network); 3 Apr 2009 21:39:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2009 21:39:41 -0000 Received: (qmail 25389 invoked by uid 500); 3 Apr 2009 21:39:41 -0000 Delivered-To: sschneider@example.com Received: (qmail 25363 invoked by uid 500); 3 Apr 2009 21:39:41 -0000 Mailing-List: contact sschneider@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:sschneider@example.com> List-Unsubscribe: <mailto:sschneider@example.com> List-Post: <mailto:sschneider@example.com> List-Id: <commits.tiles.apache.org> Reply-To: sschneider@example.com Delivered-To: mailing list sschneider@example.com Received: (qmail 25354 invoked by uid 99); 3 Apr 2009 21:39:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 21:39:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Apr 2009 21:39:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0A1FB2388A46; Fri, 3 Apr 2009 21:39:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r761809 - /tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ Date: Fri, 03 Apr 2009 21:39:19 -0000 To: sschneider@example.com From: sschneider@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <sschneider@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: apetrelli Date: Fri Apr 3 21:39:19 2009 New Revision: 761809 URL: http://svn.apache.org/viewvc?rev=761809&view=rev Log: TILES-382 Finished tests for tiles-freemarker. Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutListAttributeFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/SetCurrentContainerFMModelTest.java (with props) tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/TilesFMModelRepositoryTest.java (with props) Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java?rev=761809&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java Fri Apr 3 21:39:19 2009 @@ -0,0 +1,140 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.Attribute; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.InsertDefinitionModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class InsertDefinitionFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.InsertDefinitionFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + InsertDefinitionModel tModel = createMock(InsertDefinitionModel.class); + InsertDefinitionFMModel fmModel = new InsertDefinitionFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null).times(2); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + expectLastCall().times(2); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(3); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container).times(2); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(2); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel).times(2); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("name", objectWrapper.wrap("myName")); + params.put("template", objectWrapper.wrap("myTemplate")); + params.put("role", objectWrapper.wrap("myRole")); + params.put("preparer", objectWrapper.wrap("myPreparer")); + + tModel.start(container, env); + tModel.end(container, "myName", "myTemplate", "myRole", "myPreparer", env); + body.render(isA(NullWriter.class)); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java?rev=761809&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java Fri Apr 3 21:39:19 2009 @@ -0,0 +1,140 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.Attribute; +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.io.NullWriter; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.InsertTemplateModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class InsertTemplateFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper = DefaultObjectWrapper.getDefaultInstance(); + } + + /** + * Test method for {@link org.apache.tiles.freemarker.template.InsertTemplateFMModel#execute(freemarker.core.Environment, java.util.Map, freemarker.template.TemplateModel[], freemarker.template.TemplateDirectiveBody)}. + * @throws IOException If something goes wrong. + * @throws TemplateException If something goes wrong. + */ + @Test + public void testExecute() throws TemplateException, IOException { + InsertTemplateModel tModel = createMock(InsertTemplateModel.class); + InsertTemplateFMModel fmModel = new InsertTemplateFMModel(tModel); + TilesContainer container = createMock(TilesContainer.class); + + HttpServletRequest request = createMock(HttpServletRequest.class); + expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null).times(2); + request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container); + expectLastCall().times(2); + request.setAttribute(ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME, true); + replay(request); + HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper); + + GenericServlet servlet = createMock(GenericServlet.class); + ServletContext servletContext = createMock(ServletContext.class); + expect(servlet.getServletContext()).andReturn(servletContext).times(3); + expect(servletContext.getAttribute(TilesAccess.CONTAINER_ATTRIBUTE)).andReturn(container).times(2); + replay(servlet, servletContext); + ServletContextHashModel servletContextModel = new ServletContextHashModel(servlet, objectWrapper); + expect(model.get(FreemarkerServlet.KEY_REQUEST)).andReturn(requestModel).times(3); + expect(model.get(FreemarkerServlet.KEY_APPLICATION)).andReturn(servletContextModel).times(2); + initEnvironment(); + + TemplateDirectiveBody body = createMock(TemplateDirectiveBody.class); + Map<String, Object> params = new HashMap<String, Object>(); + Attribute attribute = createMock(Attribute.class); + params.put("template", objectWrapper.wrap("myTemplate")); + params.put("role", objectWrapper.wrap("myRole")); + params.put("preparer", objectWrapper.wrap("myPreparer")); + + tModel.start(container, env); + tModel.end(container, "myTemplate", "myRole", "myPreparer", env); + body.render(isA(NullWriter.class)); + + replay(tModel, body, container, attribute); + fmModel.execute(env, params, null, body); + verify(template, model, request, tModel, body, container, servlet, servletContext, attribute); + } + + /** + * Initializes the FreeMarker environment. + */ + private void initEnvironment() { + replay(template, model); + env = new Environment(template, model, writer); + locale = Locale.ITALY; + env.setLocale(locale); + } +} Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java?rev=761809&view=auto ============================================================================== --- tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java (added) +++ tiles/framework/trunk/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java Fri Apr 3 21:39:19 2009 @@ -0,0 +1,145 @@ +/** + * + */ +package org.apache.tiles.freemarker.template; + +import static org.easymock.EasyMock.expect; +import static org.easymock.classextension.EasyMock.*; + +import java.io.IOException; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import javax.servlet.GenericServlet; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; + +import org.apache.tiles.TilesContainer; +import org.apache.tiles.access.TilesAccess; +import org.apache.tiles.freemarker.context.FreeMarkerUtil; +import org.apache.tiles.servlet.context.ServletUtil; +import org.apache.tiles.template.PutAttributeModel; +import org.junit.Before; +import org.junit.Test; + +import freemarker.core.Environment; +import freemarker.ext.servlet.FreemarkerServlet; +import freemarker.ext.servlet.HttpRequestHashModel; +import freemarker.ext.servlet.ServletContextHashModel; +import freemarker.template.DefaultObjectWrapper; +import freemarker.template.ObjectWrapper; +import freemarker.template.Template; +import freemarker.template.TemplateDirectiveBody; +import freemarker.template.TemplateException; +import freemarker.template.TemplateHashModel; + +/** + * @author antonio + * + */ +public class PutAttributeFMModelTest { + + /** + * The FreeMarker environment. + */ + private Environment env; + + /** + * The locale object. + */ + private Locale locale; + + /** + * The template. + */ + private Template template; + + /** + * The template model. + */ + private TemplateHashModel model; + + /** + * The writer. + */ + private StringWriter writer; + + /** + * The object wrapper. + */ + private ObjectWrapper objectWrapper; + + /** + * @throws java.lang.Exception If something goes wrong. + */ + @Before + public void setUp() throws Exception { + template = createMock(Template.class); + model = createMock(TemplateHashModel.class); + expect(template.getMacros()).andReturn(new HashMap<Object, Object>()); + writer = new StringWriter(); + objectWrapper
{'source': 'Apache Software Foundation Public Mail Archives'}