[portal-commits] JBoss Portal SVN: r5879 - in trunk/portlet: . src/main/org/jboss/portal/test/portlet/jsr168/ext src/main/org/jboss/portal/test/portlet/jsr168/ext/common src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache src/resources/test/jsr168/ext src/resources/test/jsr168/ext/expiringcache-war/WEB-INF src/resources/test/jsr168/ext/neverexpiringcache-war src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Fri Dec 15 19:48:47 EST 2006


Author: julien at jboss.com
Date: 2006-12-15 19:48:38 -0500 (Fri, 15 Dec 2006)
New Revision: 5879

Added:
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
   trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/
   trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/
   trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml
   trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
Modified:
   trunk/portlet/build.xml
   trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
   trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml
Log:
JBPORTAL-1163 : preliminary refactoring of cache tests

Modified: trunk/portlet/build.xml
===================================================================
--- trunk/portlet/build.xml	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/build.xml	2006-12-16 00:48:38 UTC (rev 5879)
@@ -238,6 +238,7 @@
       <sequential>
          <mkdir dir="${build.resources}/test/jsr168/ext/@{test}-war/WEB-INF/classes"/>
          <copy todir="${build.resources}/test/jsr168/ext/@{test}-war/WEB-INF/classes">
+            <fileset dir="${build.classes}" includes="org/jboss/portal/test/portlet/jsr168/ext/common/**"/>
             <fileset dir="${build.classes}" includes="org/jboss/portal/test/portlet/jsr168/ext/@{test}/**"/>
             <fileset dir="${build.classes}" includes="org/jboss/portal/test/portlet/framework/**"/>
          </copy>
@@ -378,6 +379,7 @@
       <!-- Ext tests -->
       <package-ext-test test="nocache"/>
       <package-ext-test test="expiringcache"/>
+      <package-ext-test test="neverexpiringcache"/>
       <package-ext-test test="preferences"/>
       <package-ext-test test="session"/>
       <package-ext-test test="portletresponses"/>
@@ -457,6 +459,7 @@
          <x-test>
 
             <!--Spec TCK Assertions tests-->
+<!--
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.DispatcherTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletConfigTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletContextTestCase"/>
@@ -468,8 +471,10 @@
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PortletURLTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.PreferencesTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.tck.WindowStatesTestCase"/>
+-->
 
             <!--API Tests-->
+<!--
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.ActionRequestTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.ActionResponseTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.PortalContextTestCase"/>
@@ -483,8 +488,10 @@
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.RenderRequestTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.RenderResponseTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.api.WindowStateTestCase"/>
+-->
 
             <!--Ext Tests-->
+<!--
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.DispatcherTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletConfigTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletModeTestCase"/>
@@ -492,11 +499,13 @@
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PortletResponsesTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.PreferencesTestCase"/>
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.SessionTestCase"/>
+-->
             <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.ExpiringCacheTestCase"/>
-            <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.NoCacheTestCase"/>
+            <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.NeverExpiringCacheTestCase"/>
+            <!--<test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.ext.NoCacheTestCase"/>-->
 
             <!--Misc Tests-->
-            <test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.misc.Log4jTestCase"/>
+            <!--<test todir="${test.reports}" name="org.jboss.portal.test.portlet.jsr168.misc.Log4jTestCase"/>-->
 
          </x-test>
          <x-classpath>

Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/NeverExpiringCacheTestCase.java	2006-12-16 00:48:38 UTC (rev 5879)
@@ -0,0 +1,37 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext;
+
+import org.jboss.portal.test.framework.server.runner.ServerTestRunner;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NeverExpiringCacheTestCase extends ServerTestRunner
+{
+   public NeverExpiringCacheTestCase()
+   {
+      super("test-jsr168-ext-neverexpiringcache.war");
+   }
+}

Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java	2006-12-16 00:48:38 UTC (rev 5879)
@@ -0,0 +1,536 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext.common;
+
+import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
+import org.jboss.portal.test.framework.portlet.SequenceRegistry;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.framework.portlet.Sequence;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
+import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
+import org.jboss.portal.common.test.driver.DriverResponse;
+import org.jboss.portal.common.test.driver.response.EndTestResponse;
+import org.jboss.portal.common.util.CollectionBuilder;
+
+import javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionResponse;
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.PortletException;
+import javax.portlet.ActionRequest;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractCacheSequenceBuilder extends SequenceRegistryBuilder
+{
+
+   protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator renderParameterConfigurator = new AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
+   {
+      public PortletURL createPortletURL(RenderResponse resp)
+      {
+         PortletURL url = resp.createRenderURL();
+         url.setParameter("abc", "def");
+         return url;
+      }
+      public void configureNavigationalState(ActionResponse resp)
+      {
+         resp.setRenderParameter("abc", "fed");
+      }
+   };
+
+   /**
+    * Overriding the expiration cache to 0 disable the cache on a render or an action/render.
+    */
+   protected void createDisableDuringRender(String testName, SequenceRegistry registry, Joinpoint renderjp, Joinpoint actionjp)
+   {
+      final Set calls = new HashSet();
+      Sequence seq = new Sequence();
+      registry.addSequence(testName, seq);
+
+      //
+      seq.addAction(0, renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            //
+            calls.add("0");
+            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+            // Refresh
+            String url = response.createRenderURL().toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(1, renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            //
+            calls.add("1");
+            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+            // Refresh
+            String url = response.createActionURL().toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(2, actionjp, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
+         {
+            //
+            calls.add("2_action");
+         }
+      });
+      seq.addAction(2, renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Content is not cached
+            calls.add("2_render");
+
+            //
+            Set expected = new CollectionBuilder().add("0").add("1").add("2_action").add("2_render").toHashSet();
+            assertEquals(expected, calls);
+
+            // End test
+            return new EndTestResponse();
+         }
+      });
+   }
+
+   /**
+    * Caching happens after a render with the same render parameters for at most 5 seconds
+    * Calling render on the portlet with different render parameters invalidates the cache
+    */
+//   public void createExpiringCache(SequenceRegistry registry)
+//   {
+//      final Set calls = new HashSet();
+//      final String[] url = new String[1];
+//      Sequence seq = new Sequence();
+//      registry.addSequence("ExpiringCache", seq);
+//
+//      //
+//      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Content is not cached
+//            calls.add("0");
+//
+//            // Refresh
+//            url[0] = response.createRenderURL().toString();
+//            return new InvokeGetResponse(url[0]);
+//         }
+//      });
+//
+//      //
+//      seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Should not be called
+//            calls.add("1");
+//            return null;
+//         }
+//      });
+//      seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Refresh
+//            return new InvokeGetResponse(url[0]);
+//         }
+//      });
+//
+//      //
+//      seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Could be called depending on whether the portal
+//            // decides to invoke UTP2 or UTP3 first
+//            // so if it's called we need to disable cache otherwise the next
+//            // render will probably not be called
+//            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+//            return null;
+//         }
+//      });
+//      seq.addAction(2, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            try
+//            {
+//               assertFalse(calls.contains("1"));
+//
+//               // Wait 5 seconds for the cache entry to be invalid
+//               Thread.sleep(5 * 1000);
+//
+//               // Refresh
+//               return new InvokeGetResponse(url[0]);
+//            }
+//            catch (InterruptedException e)
+//            {
+//               return new ErrorResponse(e);
+//            }
+//         }
+//      });
+//
+//      //
+//      seq.addAction(3, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Should be called
+//            calls.add("3");
+//
+//            // Invoke the same but with different render parameter
+//            PortletURL tmp = response.createRenderURL();
+//            tmp.setParameter("abc", "def");
+//            url[0] = tmp.toString();
+//            return new InvokeGetResponse(url[0]);
+//         }
+//      });
+//
+//      //
+//      seq.addAction(4, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Should be called
+//            calls.add("4");
+//
+//            // Refresh
+//            return new InvokeGetResponse(url[0]);
+//         }
+//      });
+//
+//      //
+//      seq.addAction(5, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Should not be called
+//            calls.add("5");
+//            return null;
+//         }
+//      });
+//      seq.addAction(5, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Refresh
+//            return new InvokeGetResponse(url[0]);
+//         }
+//      });
+//
+//      //
+//      seq.addAction(6, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Could be called depending on whether the portal
+//            // decides to invoke UTP2 or UTP3 first
+//            // so if it's called we need to disable cache otherwise the next
+//            // render will probably not be called
+//            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+//            return null;
+//         }
+//      });
+//      seq.addAction(6, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            try
+//            {
+//               assertFalse(calls.contains("5"));
+//
+//               // Wait 5 seconds for the cache entry to be invalid
+//               Thread.sleep(5 * 1000);
+//
+//               // Refresh
+//               return new InvokeGetResponse(url[0]);
+//            }
+//            catch (InterruptedException e)
+//            {
+//               return new ErrorResponse(e);
+//            }
+//         }
+//      });
+//
+//      //
+//      seq.addAction(7, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+//      {
+//         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+//         {
+//            // Should be called
+//            calls.add("7");
+//
+//            //
+//            Set expected = new CollectionBuilder().add("0").add("3").add("4").add("7").toHashSet();
+//            assertEquals(expected, calls);
+//
+//            // Refresh
+//            return new EndTestResponse();
+//         }
+//      });
+//   }
+
+   protected interface NavigationalStateConfigurator
+   {
+      PortletURL createPortletURL(RenderResponse resp);
+      void configureNavigationalState(ActionResponse resp);
+   }
+
+   /**
+    * Calling render on the portlet with different render parameters invalidates the cache
+    */
+   protected void createCacheMarkup(
+      String testName,
+      SequenceRegistry registry,
+      Joinpoint p1renderjp,
+      Joinpoint p1actionjp,
+      Joinpoint p2renderjp,
+      final AbstractCacheSequenceBuilder.NavigationalStateConfigurator configurator)
+   {
+      final Set calls = new HashSet();
+      final String[] url = new String[1];
+      Sequence seq = new Sequence();
+      registry.addSequence(testName, seq);
+
+      //
+      seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Content is not cached
+            calls.add("0");
+
+            // Create invalidating action url for later use
+            url[0] = response.createActionURL().toString();
+
+            // Refresh
+            return new InvokeGetResponse(response.createRenderURL().toString());
+         }
+      });
+
+      //
+      seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should not be called
+            calls.add("1");
+            return null;
+         }
+      });
+      seq.addAction(1, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Invalidate with action
+            return new InvokeGetResponse(url[0]);
+         }
+      });
+
+      //
+      seq.addAction(2, p1actionjp, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
+         {
+            calls.add("2_action");
+         }
+      });
+      seq.addAction(2, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("2_render");
+
+            // Refresh with different URL
+            PortletURL url = configurator.createPortletURL(response);
+            return new InvokeGetResponse(url.toString());
+         }
+      });
+
+      //
+      seq.addAction(3, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("3");
+
+            // Invoke with same different URL
+            PortletURL url = configurator.createPortletURL(response);
+            return new InvokeGetResponse(url.toString());
+         }
+      });
+
+      //
+      seq.addAction(4, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should not be called
+            calls.add("4");
+            return null;
+         }
+      });
+      seq.addAction(4, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Invalidate with action
+            return new InvokeGetResponse(url[0]);
+         }
+      });
+
+      //
+      seq.addAction(5, p1actionjp, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
+         {
+            calls.add("5_action");
+
+            // Configure the navitional state
+            configurator.configureNavigationalState(response);
+         }
+      });
+      seq.addAction(5, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("5_render");
+
+            // Refresh with different navigational state to check it will be called in the next render phase
+            PortletURL url = response.createRenderURL();
+            return new InvokeGetResponse(url.toString());
+         }
+      });
+
+      //
+      seq.addAction(6, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            Set expected = new CollectionBuilder().add("0").add("2_action").add("2_render").add("3").add("5_action").add("5_render").toHashSet();
+            assertEquals(expected, calls);
+
+            // Refresh
+            return new EndTestResponse();
+         }
+      });
+   }
+
+   /**
+    * Calling action on the portlet invalidates the cache.
+    */
+   protected void createActionInvalidates(
+      String testName,
+      SequenceRegistry registry,
+      Joinpoint p1renderjp,
+      Joinpoint p1actionjp,
+      Joinpoint p2renderjp)
+   {
+      final Set calls = new HashSet();
+      final String[] url = new String[1];
+      Sequence seq = new Sequence();
+      registry.addSequence(testName, seq);
+
+      //
+      seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Content is not cached
+            calls.add("0");
+
+            // Refresh
+            url[0] = response.createActionURL().toString();
+            return new InvokeGetResponse(response.createRenderURL().toString());
+         }
+      });
+
+      //
+      seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should no be called
+            calls.add("1");
+            return null;
+         }
+      });
+      seq.addAction(1, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Invalidate
+            return new InvokeGetResponse(url[0]);
+         }
+      });
+
+      //
+      seq.addAction(2, p1actionjp, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
+         {
+            //
+            calls.add("2_action");
+         }
+      });
+      seq.addAction(2, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Content is not cached
+            calls.add("2_render");
+
+            //
+            Set expected = new CollectionBuilder().add("0").add("2_action").add("2_render").toHashSet();
+            assertEquals(expected, calls);
+
+            // End test
+            return new EndTestResponse();
+         }
+      });
+   }
+
+
+}

Modified: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java	2006-12-16 00:48:38 UTC (rev 5879)
@@ -22,45 +22,19 @@
  ******************************************************************************/
 package org.jboss.portal.test.portlet.jsr168.ext.expiringcache;
 
-import org.jboss.portal.test.framework.portlet.SequenceRegistryBuilder;
 import org.jboss.portal.test.framework.portlet.SequenceRegistry;
-import org.jboss.portal.test.framework.portlet.Sequence;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.Joinpoint;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.driver.http.response.InvokeGetResponse;
 import org.jboss.portal.test.portlet.framework.UTP1;
 import org.jboss.portal.test.portlet.framework.UTP2;
 import org.jboss.portal.test.portlet.framework.UTP3;
 import org.jboss.portal.test.portlet.framework.UTP4;
 import org.jboss.portal.test.portlet.framework.UTP5;
-import org.jboss.portal.test.portlet.framework.UTP6;
-import org.jboss.portal.test.portlet.framework.UTP7;
-import org.jboss.portal.test.portlet.framework.UTP8;
-import org.jboss.portal.test.portlet.framework.UTP9;
-import org.jboss.portal.test.portlet.framework.UTP10;
-import org.jboss.portal.common.test.driver.DriverResponse;
-import org.jboss.portal.common.test.driver.response.EndTestResponse;
-import org.jboss.portal.common.test.driver.response.ErrorResponse;
-import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheSequenceBuilder;
 
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletURL;
-import java.io.IOException;
-import java.util.Set;
-import java.util.HashSet;
-
 /**
  * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  * @version $Revision: 1.1 $
  */
-public class ExpiringCacheSequenceBuilder extends SequenceRegistryBuilder
+public class ExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
 {
 
    public void createDisableDuringRenderExpiringCache(SequenceRegistry registry)
@@ -68,475 +42,13 @@
       createDisableDuringRender("DisableDuringRenderExpiringCache", registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
    }
 
-   public void createDisableDuringRenderNeverExpiringCache(SequenceRegistry registry)
-   {
-      createDisableDuringRender("DisableDuringRenderNeverExpiringCache", registry, UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT);
-   }
-
-   /**
-    * Overriding the expiration cache to 0 disable the cache on a render or an action/render.
-    */
-   private void createDisableDuringRender(String testName, SequenceRegistry registry, Joinpoint renderjp, Joinpoint actionjp)
-   {
-      final Set calls = new HashSet();
-      Sequence seq = new Sequence();
-      registry.addSequence(testName, seq);
-
-      //
-      seq.addAction(0, renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            //
-            calls.add("0");
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
-
-            // Refresh
-            String url = response.createRenderURL().toString();
-            return new InvokeGetResponse(url);
-         }
-      });
-
-      //
-      seq.addAction(1, renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            //
-            calls.add("1");
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
-
-            // Refresh 
-            String url = response.createActionURL().toString();
-            return new InvokeGetResponse(url);
-         }
-      });
-
-      //
-      seq.addAction(2, actionjp, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
-         {
-            //
-            calls.add("2_action");
-         }
-      });
-      seq.addAction(2, renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Content is not cached
-            calls.add("2_render");
-
-            //
-            Set expected = new CollectionBuilder().add("0").add("1").add("2_action").add("2_render").toHashSet();
-            assertEquals(expected, calls);
-
-            // End test
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * Caching happens after a render with the same render parameters for at most 5 seconds
-    * Calling render on the portlet with different render parameters invalidates the cache
-    */
    public void createExpiringCache(SequenceRegistry registry)
    {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      Sequence seq = new Sequence();
-      registry.addSequence("ExpiringCache", seq);
-
-      //
-      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Content is not cached
-            calls.add("0");
-
-            // Refresh
-            url[0] = response.createRenderURL().toString();
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should not be called
-            calls.add("1");
-            return null;
-         }
-      });
-      seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(2, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Could be called depending on whether the portal
-            // decides to invoke UTP2 or UTP3 first
-            // so if it's called we need to disable cache otherwise the next
-            // render will probably not be called
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
-            return null;
-         }
-      });
-      seq.addAction(2, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            try
-            {
-               assertFalse(calls.contains("1"));
-
-               // Wait 5 seconds for the cache entry to be invalid
-               Thread.sleep(5 * 1000);
-
-               // Refresh
-               return new InvokeGetResponse(url[0]);
-            }
-            catch (InterruptedException e)
-            {
-               return new ErrorResponse(e);
-            }
-         }
-      });
-
-      //
-      seq.addAction(3, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("3");
-
-            // Invoke the same but with different render parameter
-            PortletURL tmp = response.createRenderURL();
-            tmp.setParameter("abc", "def");
-            url[0] = tmp.toString();
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(4, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("4");
-
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(5, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should not be called
-            calls.add("5");
-            return null;
-         }
-      });
-      seq.addAction(5, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(6, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Could be called depending on whether the portal
-            // decides to invoke UTP2 or UTP3 first
-            // so if it's called we need to disable cache otherwise the next
-            // render will probably not be called
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
-            return null;
-         }
-      });
-      seq.addAction(6, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            try
-            {
-               assertFalse(calls.contains("5"));
-
-               // Wait 5 seconds for the cache entry to be invalid
-               Thread.sleep(5 * 1000);
-
-               // Refresh
-               return new InvokeGetResponse(url[0]);
-            }
-            catch (InterruptedException e)
-            {
-               return new ErrorResponse(e);
-            }
-         }
-      });
-
-      //
-      seq.addAction(7, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("7");
-
-            //
-            Set expected = new CollectionBuilder().add("0").add("3").add("4").add("7").toHashSet();
-            assertEquals(expected, calls);
-
-            // Refresh
-            return new EndTestResponse();
-         }
-      });
+      createCacheMarkup("ExpiringCache", registry, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT, renderParameterConfigurator);
    }
 
-   /**
-    * Caching happens after a render with the same render parameters for at most 5 seconds
-    * Calling render on the portlet with different render parameters invalidates the cache
-    */
-   public void createNeverExpiringCache(SequenceRegistry registry)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      Sequence seq = new Sequence();
-      registry.addSequence("NeverExpiringCache", seq);
-
-      //
-      seq.addAction(0, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Content is not cached
-            calls.add("0");
-
-            // Create invalidating action url for later use
-            url[0] = response.createActionURL().toString();
-
-            // Refresh
-            return new InvokeGetResponse(response.createRenderURL().toString());
-         }
-      });
-
-      //
-      seq.addAction(1, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should not be called
-            calls.add("1");
-            return null;
-         }
-      });
-      seq.addAction(1, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Invalidate with action
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(2, UTP9.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
-         {
-            calls.add("2_action");
-         }
-      });
-      seq.addAction(2, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("2_render");
-
-            // Refresh with different render parameters
-            PortletURL url = response.createRenderURL();
-            url.setParameter("abc", "def");
-            return new InvokeGetResponse(url.toString());
-         }
-      });
-
-      //
-      seq.addAction(3, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("3");
-
-            // Invoke the with same render parameters
-            PortletURL url = response.createRenderURL();
-            url.setParameter("abc", "def");
-            return new InvokeGetResponse(url.toString());
-         }
-      });
-
-      //
-      seq.addAction(4, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should not be called
-            calls.add("4");
-            return null;
-         }
-      });
-      seq.addAction(4, UTP10.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Invalidate with action
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(5, UTP9.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
-         {
-            calls.add("5_action");
-            response.setRenderParameter("abc", "fed");
-         }
-      });
-      seq.addAction(5, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("5_render");
-
-            // Refresh with different render parameters
-            PortletURL url = response.createRenderURL();
-            return new InvokeGetResponse(url.toString());
-         }
-      });
-
-      //
-      seq.addAction(6, UTP9.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            Set expected = new CollectionBuilder().add("0").add("2_action").add("2_render").add("3").add("5_action").add("5_render").toHashSet();
-            assertEquals(expected, calls);
-
-            // Refresh
-            return new EndTestResponse();
-         }
-      });
-   }
-
    public void createActionInvalidatesExpiringCache(SequenceRegistry registry)
    {
       createActionInvalidates("ActionInvalidatesExpiringCache", registry, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT);
    }
-
-   public void createActionInvalidatesNeverExpiringCache(SequenceRegistry registry)
-   {
-      createActionInvalidates("ActionInvalidatesNeverExpiringCache", registry, UTP7.RENDER_JOINPOINT, UTP7.ACTION_JOINPOINT, UTP8.RENDER_JOINPOINT);
-   }
-
-   /**
-    * Calling action on the portlet invalidates the cache.
-    */
-   public void createActionInvalidates(
-      String testName,
-      SequenceRegistry registry,
-      Joinpoint p1renderjp,
-      Joinpoint p1actionjp,
-      Joinpoint p2renderjp)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      Sequence seq = new Sequence();
-      registry.addSequence(testName, seq);
-
-      //
-      seq.addAction(0, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Content is not cached
-            calls.add("0");
-
-            // Refresh
-            url[0] = response.createActionURL().toString();
-            return new InvokeGetResponse(response.createRenderURL().toString());
-         }
-      });
-
-      //
-      seq.addAction(1, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should no be called
-            calls.add("1");
-            return null;
-         }
-      });
-      seq.addAction(1, p2renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Invalidate
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(2, p1actionjp, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
-         {
-            //
-            calls.add("2_action");
-         }
-      });
-      seq.addAction(2, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Content is not cached
-            calls.add("2_render");
-
-            //
-            Set expected = new CollectionBuilder().add("0").add("2_action").add("2_render").toHashSet();
-            assertEquals(expected, calls);
-
-            // End test
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   
 }

Added: trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java	2006-12-16 00:48:38 UTC (rev 5879)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat                                               *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual                    *
+ * contributors as indicated by the @authors tag. See the                     *
+ * copyright.txt in the distribution for a full listing of                    *
+ * individual contributors.                                                   *
+ *                                                                            *
+ * This is free software; you can redistribute it and/or modify it            *
+ * under the terms of the GNU Lesser General Public License as                *
+ * published by the Free Software Foundation; either version 2.1 of           *
+ * the License, or (at your option) any later version.                        *
+ *                                                                            *
+ * This software is distributed in the hope that it will be useful,           *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           *
+ * Lesser General Public License for more details.                            *
+ *                                                                            *
+ * You should have received a copy of the GNU Lesser General Public           *
+ * License along with this software; if not, write to the Free                *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA         *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.                   *
+ ******************************************************************************/
+package org.jboss.portal.test.portlet.jsr168.ext.neverexpiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheSequenceBuilder;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.framework.portlet.SequenceRegistry;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class NeverExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
+{
+
+   public void createDisableDuringRenderNeverExpiringCache(SequenceRegistry registry)
+   {
+      createDisableDuringRender("DisableDuringRenderNeverExpiringCache", registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
+   }
+
+   public void createNeverExpiringCache(SequenceRegistry registry)
+   {
+      createCacheMarkup("NeverExpiringCache", registry, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT, renderParameterConfigurator);
+   }
+
+   public void createActionInvalidatesNeverExpiringCache(SequenceRegistry registry)
+   {
+      createActionInvalidates("ActionInvalidatesNeverExpiringCache", registry, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT);
+   }
+}

Modified: trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml
===================================================================
--- trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/portlet.xml	2006-12-16 00:48:38 UTC (rev 5879)
@@ -85,61 +85,4 @@
       </portlet-info>
    </portlet>
 
-   <portlet>
-      <portlet-name>TestUniversalPortletF</portlet-name>
-      <portlet-class>org.jboss.portal.test.portlet.framework.UTP6</portlet-class>
-      <expiration-cache>-1</expiration-cache>
-      <supports>
-        <mime-type>text/html</mime-type>
-      </supports>
-      <portlet-info>
-         <title></title>
-      </portlet-info>
-   </portlet>
-
-   <portlet>
-      <portlet-name>TestUniversalPortletG</portlet-name>
-      <portlet-class>org.jboss.portal.test.portlet.framework.UTP7</portlet-class>
-      <expiration-cache>-1</expiration-cache>
-      <supports>
-        <mime-type>text/html</mime-type>
-      </supports>
-      <portlet-info>
-         <title></title>
-      </portlet-info>
-   </portlet>
-
-   <portlet>
-      <portlet-name>TestUniversalPortletH</portlet-name>
-      <portlet-class>org.jboss.portal.test.portlet.framework.UTP8</portlet-class>
-      <supports>
-        <mime-type>text/html</mime-type>
-      </supports>
-      <portlet-info>
-         <title></title>
-      </portlet-info>
-   </portlet>
-
-   <portlet>
-      <portlet-name>TestUniversalPortletI</portlet-name>
-      <portlet-class>org.jboss.portal.test.portlet.framework.UTP9</portlet-class>
-      <expiration-cache>-1</expiration-cache>
-      <supports>
-        <mime-type>text/html</mime-type>
-      </supports>
-      <portlet-info>
-         <title></title>
-      </portlet-info>
-   </portlet>
-
-   <portlet>
-      <portlet-name>TestUniversalPortletJ</portlet-name>
-      <portlet-class>org.jboss.portal.test.portlet.framework.UTP10</portlet-class>
-      <supports>
-        <mime-type>text/html</mime-type>
-      </supports>
-      <portlet-info>
-         <title></title>
-      </portlet-info>
-   </portlet>
 </portlet-app>

Added: trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml
===================================================================
--- trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/portlet.xml	2006-12-16 00:48:38 UTC (rev 5879)
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ JBoss, a division of Red Hat                                              ~
+  ~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+  ~ contributors as indicated by the @authors tag. See the                    ~
+  ~ copyright.txt in the distribution for a full listing of                   ~
+  ~ individual contributors.                                                  ~
+  ~                                                                           ~
+  ~ This is free software; you can redistribute it and/or modify it           ~
+  ~ under the terms of the GNU Lesser General Public License as               ~
+  ~ published by the Free Software Foundation; either version 2.1 of          ~
+  ~ the License, or (at your option) any later version.                       ~
+  ~                                                                           ~
+  ~ This software is distributed in the hope that it will be useful,          ~
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+  ~ Lesser General Public License for more details.                           ~
+  ~                                                                           ~
+  ~ You should have received a copy of the GNU Lesser General Public          ~
+  ~ License along with this software; if not, write to the Free               ~
+  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+             xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+             version="1.0">
+
+   <portlet>
+      <portlet-name>TestUniversalPortletA</portlet-name>
+      <portlet-class>org.jboss.portal.test.portlet.framework.UTP1</portlet-class>
+      <expiration-cache>-1</expiration-cache>
+      <supports>
+        <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title></title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
+      <portlet-name>TestUniversalPortletB</portlet-name>
+      <portlet-class>org.jboss.portal.test.portlet.framework.UTP2</portlet-class>
+      <expiration-cache>-1</expiration-cache>
+      <supports>
+        <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title></title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
+      <portlet-name>TestUniversalPortletC</portlet-name>
+      <portlet-class>org.jboss.portal.test.portlet.framework.UTP3</portlet-class>
+      <supports>
+        <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title></title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
+      <portlet-name>TestUniversalPortletD</portlet-name>
+      <portlet-class>org.jboss.portal.test.portlet.framework.UTP4</portlet-class>
+      <expiration-cache>-1</expiration-cache>
+      <supports>
+        <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title></title>
+      </portlet-info>
+   </portlet>
+
+   <portlet>
+      <portlet-name>TestUniversalPortletE</portlet-name>
+      <portlet-class>org.jboss.portal.test.portlet.framework.UTP5</portlet-class>
+      <supports>
+        <mime-type>text/html</mime-type>
+      </supports>
+      <portlet-info>
+         <title></title>
+      </portlet-info>
+   </portlet>
+
+</portlet-app>

Added: trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
===================================================================
--- trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml	2006-12-15 23:25:01 UTC (rev 5878)
+++ trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml	2006-12-16 00:48:38 UTC (rev 5879)
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ JBoss, a division of Red Hat                                              ~
+  ~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
+  ~ contributors as indicated by the @authors tag. See the                    ~
+  ~ copyright.txt in the distribution for a full listing of                   ~
+  ~ individual contributors.                                                  ~
+  ~                                                                           ~
+  ~ This is free software; you can redistribute it and/or modify it           ~
+  ~ under the terms of the GNU Lesser General Public License as               ~
+  ~ published by the Free Software Foundation; either version 2.1 of          ~
+  ~ the License, or (at your option) any later version.                       ~
+  ~                                                                           ~
+  ~ This software is distributed in the hope that it will be useful,          ~
+  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of            ~
+  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU          ~
+  ~ Lesser General Public License for more details.                           ~
+  ~                                                                           ~
+  ~ You should have received a copy of the GNU Lesser General Public          ~
+  ~ License along with this software; if not, write to the Free               ~
+  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
+  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE web-app PUBLIC
+   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+   "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+
+   <listener>
+         <listener-class>org.jboss.portal.test.portlet.jsr168.ext.neverexpiringcache.NeverExpiringCacheSequenceBuilder</listener-class>
+   </listener>
+
+</web-app>




More information about the portal-commits mailing list