[portal-commits] JBoss Portal SVN: r8843 - in modules/portlet/trunk/portlet: src/main/org/jboss/portal/test/framework/portlet and 27 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Wed Nov 7 15:12:32 EST 2007


Author: julien at jboss.com
Date: 2007-11-07 15:12:31 -0500 (Wed, 07 Nov 2007)
New Revision: 8843

Added:
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateImmutableValueTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateMutableValueTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractActionInvalidatesTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheMarkupTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractDisableDuringRenderTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/NavigationalStateConfigurator.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilterTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/FiltersTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/GetRequestURITestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/RequestHeaderAccessTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ActionInvalidatesExpiringCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/DisableDuringRenderExpiringCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithPortletModeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithRenderParametersTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithWindowStateTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/ActionInvalidatesNeverExpiringCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/DisableDuringRenderNeverExpiringCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithPortletModeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithRenderParametersTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithWindowStateTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ExplicitNoCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ImplicitNoCacheTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/GetResourceBundleDuringInitTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleCascadeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestActionWithPortletModeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringActionTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringRenderTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseFormTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseInputStreamTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseReaderTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeScopingTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestHeaderAccessTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestParameterTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/ContentTypeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/IsReadOnlyTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/MapTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/StoreMustPersistAllChangesTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/CrossContextSessionAttributeTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionDoesNotExistBeforeItIsRequestedTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/TestLog4jTestCase.java
Removed:
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/framework/portlet/basictests/
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
Modified:
   modules/portlet/trunk/portlet/build.xml
   modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
   modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml
Log:
- migrated the rest of the test cases

Modified: modules/portlet/trunk/portlet/build.xml
===================================================================
--- modules/portlet/trunk/portlet/build.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/build.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -257,7 +257,6 @@
       <!-- JSR 168 test case packaging -->
       <package-tck-test test="portletinterface"/>
       <package-tck-test test="dispatcher"/>
-      <package-tck-test test="basic"/>
       <package-tck-test test="portletrequests"/>
       <package-tck-test test="portletmode"/>
       <package-tck-test test="portletconfig"/>

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,162 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.ha.session;
-
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.framework.server.NodeId;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletSession;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.io.IOException;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 7954 $
- */
-public class SessionSequenceBuilder extends PortletTestSuite
-{
-   public void createTestReplicateImmutableValue(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestReplicateImmutableValue", seq);
-      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, PortletSecurityException, IOException
-         {
-            assertNull(request.getPortletSession(false));
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            session.setAttribute("immutable", "abcdef");
-            PortletURL portletURL = response.createRenderURL();
-            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
-            return new InvokeGetResponse(url);
-         }
-      });
-      seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            assertEquals("abcdef", session.getAttribute("immutable"));
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createTestReplicateMutableValue(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestReplicateMutableValue", seq);
-      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
-         {
-            assertNull(request.getPortletSession(false));
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            MutableValue value = new MutableValue("abcdef");
-            session.setAttribute("mutable", value);
-            value.setString("fedcba");
-            PortletURL portletURL = response.createRenderURL();
-            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
-            return new InvokeGetResponse(url);
-         }
-      });
-      seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            assertEquals(new MutableValue("fedcba"), session.getAttribute("mutable"));
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createTestModifyExistingAttributeWithoutExplicitSetDoesNotReplicate(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicate", seq);
-      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
-         {
-            assertNull(request.getPortletSession(false));
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            assertEquals(Collections.EMPTY_LIST, Tools.toList(session.getAttributeNames()));
-            MutableValue value = new MutableValue("abcdef");
-            session.setAttribute("mutable", value);
-            PortletURL portletURL = response.createRenderURL();
-            String url = portletURL.toString();
-            return new InvokeGetResponse(url);
-         }
-      });
-      seq.addAction(1, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
-         {
-            PortletSession session = request.getPortletSession();
-            assertEquals(Collections.singletonList("mutable"), Tools.toList(session.getAttributeNames()));
-            Object o = session.getAttribute("mutable");
-            assertNotNull(o);
-            assertEquals(MutableValue.class, o.getClass());
-            MutableValue value = (MutableValue)o;
-            value.setString("fedcba");
-            PortletURL portletURL = response.createRenderURL();
-            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
-            return new InvokeGetResponse(url);
-         }
-      });
-      seq.addAction(2, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            assertEquals(Collections.singletonList("mutable"), Tools.toList(session.getAttributeNames()));
-            assertEquals(new MutableValue("abcdef"), session.getAttribute("mutable"));
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/SessionTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,38 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.ha.session;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class SessionTestCase // extends HTTPTestRunner
-{
-   public SessionTestCase()
-   {
-//      super(new NodeId[]{NodeId.PORTS_01,NodeId.PORTS_02});
-
-      //
-//      init("test-ha-session.war");
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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.ha.session;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase
+{
+   public TestModifyExistingAttributeWithoutExplicitSetDoesNotReplicateTestCase(PortletTest seq)
+   {
+      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
+         {
+            assertNull(request.getPortletSession(false));
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            assertEquals(Collections.EMPTY_LIST, Tools.toList(session.getAttributeNames()));
+            MutableValue value = new MutableValue("abcdef");
+            session.setAttribute("mutable", value);
+            PortletURL portletURL = response.createRenderURL();
+            String url = portletURL.toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+      seq.addAction(1, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
+         {
+            PortletSession session = request.getPortletSession();
+            assertEquals(Collections.singletonList("mutable"), Tools.toList(session.getAttributeNames()));
+            Object o = session.getAttribute("mutable");
+            assertNotNull(o);
+            assertEquals(MutableValue.class, o.getClass());
+            MutableValue value = (MutableValue)o;
+            value.setString("fedcba");
+            PortletURL portletURL = response.createRenderURL();
+            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+            return new InvokeGetResponse(url);
+         }
+      });
+      seq.addAction(2, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            assertEquals(Collections.singletonList("mutable"), Tools.toList(session.getAttributeNames()));
+            assertEquals(new MutableValue("abcdef"), session.getAttribute("mutable"));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateImmutableValueTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateImmutableValueTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateImmutableValueTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.ha.session;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestReplicateImmutableValueTestCase
+{
+   public TestReplicateImmutableValueTestCase(PortletTest seq)
+   {
+      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletException, PortletSecurityException, IOException
+         {
+            assertNull(request.getPortletSession(false));
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            session.setAttribute("immutable", "abcdef");
+            PortletURL portletURL = response.createRenderURL();
+            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+            return new InvokeGetResponse(url);
+         }
+      });
+      seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            assertEquals("abcdef", session.getAttribute("immutable"));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateMutableValueTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateMutableValueTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/ha/session/TestReplicateMutableValueTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.ha.session;
+
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.server.NodeId;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestReplicateMutableValueTestCase
+{
+   public TestReplicateMutableValueTestCase(PortletTest seq)
+   {
+      seq.addAction(0, NodeId.PORTS_01, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException
+         {
+            assertNull(request.getPortletSession(false));
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            MutableValue value = new MutableValue("abcdef");
+            session.setAttribute("mutable", value);
+            value.setString("fedcba");
+            PortletURL portletURL = response.createRenderURL();
+            String url = context.rewriteURLForNode(portletURL.toString(), NodeId.PORTS_02);
+            return new InvokeGetResponse(url);
+         }
+      });
+      seq.addAction(1, NodeId.PORTS_02, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            assertEquals(new MutableValue("fedcba"), session.getAttribute("mutable"));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Modified: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/api/actionresponse/EncodeURLTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -43,7 +43,7 @@
  * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
  * @version $Revision: 1.1 $
  */
- at TestCase({})
+ at TestCase
 public class EncodeURLTestCase
 {
    public EncodeURLTestCase(PortletTest seq)

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractActionInvalidatesTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractActionInvalidatesTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractActionInvalidatesTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,121 @@
+/******************************************************************************
+ * 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.Joinpoint;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.common.util.CollectionBuilder;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+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 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 AbstractActionInvalidatesTestCase
+{
+
+   final Set calls = new HashSet();
+   String url;
+
+
+   public AbstractActionInvalidatesTestCase(
+      PortletTest seq,
+      Joinpoint p1renderjp,
+      Joinpoint p1actionjp,
+      Joinpoint p2renderjp)
+   {
+      //
+      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 = 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);
+         }
+      });
+
+      //
+      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: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheMarkupTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheMarkupTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheMarkupTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,196 @@
+/******************************************************************************
+ * 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.PortletTest;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+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.common.util.CollectionBuilder;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+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 javax.portlet.PortletMode;
+import javax.portlet.WindowState;
+import java.util.Set;
+import java.util.HashSet;
+import java.io.IOException;
+
+/**
+ * Calling render on the portlet with different render parameters invalidates the cache.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractCacheMarkupTestCase
+{
+
+   final Set calls = new HashSet();
+   String url;
+
+   public AbstractCacheMarkupTestCase(
+      PortletTest seq,
+      Joinpoint p1renderjp,
+      Joinpoint p1actionjp,
+      Joinpoint p2renderjp,
+      final NavigationalStateConfigurator configurator)
+   {
+      //
+      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 = 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);
+         }
+      });
+
+      //
+      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);
+         }
+      });
+
+      //
+      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();
+            url.setPortletMode(PortletMode.VIEW);
+            url.setWindowState(WindowState.NORMAL);
+            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();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractCacheSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,394 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.common;
-
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.Joinpoint;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-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.common.util.CollectionBuilder;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-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 javax.portlet.WindowState;
-import javax.portlet.WindowStateException;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-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 PortletTestSuite
-{
-
-   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");
-      }
-   };
-
-   protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator windowStateConfigurator = new AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
-   {
-      public PortletURL createPortletURL(RenderResponse resp) throws WindowStateException
-      {
-         PortletURL url = resp.createRenderURL();
-         url.setWindowState(WindowState.MAXIMIZED);
-         return url;
-      }
-      public void configureNavigationalState(ActionResponse resp) throws WindowStateException
-      {
-         resp.setWindowState(WindowState.MAXIMIZED);
-      }
-   };
-
-   protected final AbstractCacheSequenceBuilder.NavigationalStateConfigurator portletModeConfigurator = new AbstractCacheSequenceBuilder.NavigationalStateConfigurator()
-   {
-      public PortletURL createPortletURL(RenderResponse resp) throws PortletModeException
-      {
-         PortletURL url = resp.createRenderURL();
-         url.setPortletMode(PortletMode.EDIT);
-         return url;
-      }
-      public void configureNavigationalState(ActionResponse resp) throws PortletModeException
-      {
-         resp.setPortletMode(PortletMode.EDIT);
-      }
-   };
-
-   /**
-    * Overriding the expiration cache to 0 disable the cache on a render or an action/render.
-    */
-   protected void createDisableDuringRender(String testName, PortletTestDriver registry, Joinpoint renderjp, Joinpoint actionjp)
-   {
-      final Set calls = new HashSet();
-      PortletTest seq = new PortletTest();
-      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();
-         }
-      });
-   }
-
-   protected interface NavigationalStateConfigurator
-   {
-      PortletURL createPortletURL(RenderResponse resp) throws PortletException;
-      void configureNavigationalState(ActionResponse resp) throws PortletException;
-   }
-
-   /**
-    * Calling render on the portlet with different render parameters invalidates the cache
-    */
-   protected void createCacheMarkup(
-      String testName,
-      PortletTestDriver registry,
-      Joinpoint p1renderjp,
-      Joinpoint p1actionjp,
-      Joinpoint p2renderjp,
-      final AbstractCacheSequenceBuilder.NavigationalStateConfigurator configurator)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      PortletTest seq = new PortletTest();
-      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();
-            url.setPortletMode(PortletMode.VIEW);
-            url.setWindowState(WindowState.NORMAL);
-            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,
-      PortletTestDriver registry,
-      Joinpoint p1renderjp,
-      Joinpoint p1actionjp,
-      Joinpoint p2renderjp)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      PortletTest seq = new PortletTest();
-      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: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractDisableDuringRenderTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractDisableDuringRenderTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/AbstractDisableDuringRenderTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,113 @@
+/******************************************************************************
+ * 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.PortletTest;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+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.common.util.CollectionBuilder;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+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 java.io.IOException;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * Overriding the expiration cache to 0 disable the cache on a render or an action/render.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AbstractDisableDuringRenderTestCase
+{
+
+   final Set calls = new HashSet();
+
+   public AbstractDisableDuringRenderTestCase(PortletTest seq, Joinpoint renderjp, Joinpoint actionjp)
+   {
+      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();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/NavigationalStateConfigurator.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/NavigationalStateConfigurator.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/common/NavigationalStateConfigurator.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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 javax.portlet.PortletURL;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletMode;
+import javax.portlet.WindowStateException;
+import javax.portlet.WindowState;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public interface NavigationalStateConfigurator
+{
+
+   PortletURL createPortletURL(RenderResponse resp) throws PortletException;
+
+   void configureNavigationalState(ActionResponse resp) throws PortletException;
+
+   public static final NavigationalStateConfigurator PORTLET_MODE_CONFIGURATOR = new NavigationalStateConfigurator()
+   {
+      public PortletURL createPortletURL(RenderResponse resp) throws PortletModeException
+      {
+         PortletURL url = resp.createRenderURL();
+         url.setPortletMode(PortletMode.EDIT);
+         return url;
+      }
+      public void configureNavigationalState(ActionResponse resp) throws PortletModeException
+      {
+         resp.setPortletMode(PortletMode.EDIT);
+      }
+   };
+
+   public static final NavigationalStateConfigurator RENDER_PARAMETER_CONFIGURATOR = new 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");
+      }
+   };
+
+   public static final NavigationalStateConfigurator WINDOW_STATE_CONFIGURATOR = new NavigationalStateConfigurator()
+   {
+      public PortletURL createPortletURL(RenderResponse resp) throws WindowStateException
+      {
+         PortletURL url = resp.createRenderURL();
+         url.setWindowState(WindowState.MAXIMIZED);
+         return url;
+      }
+      public void configureNavigationalState(ActionResponse resp) throws WindowStateException
+      {
+         resp.setWindowState(WindowState.MAXIMIZED);
+      }
+   };
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatcherSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,200 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.dispatcher;
-
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.util.CollectionBuilder;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-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.ServletServiceTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.portal.test.portlet.framework.UTP2;
-import org.jboss.portal.test.portlet.framework.UTP3;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Set;
-import java.util.Collections;
-
-/**
- * Tests for request dispatching from a portlet to a servlet.
- *
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class DispatcherSequenceBuilder extends PortletTestSuite
-{
-
-   public static final String SERVLET_A_URI = "/test-jsr168-ext-dispatcher/universalServletA";
-   public static final String SERVLET_B_URI = "/test-jsr168-ext-dispatcher/universalServletB";
-
-   public void createGetRequestURICase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("GetRequestURI", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
-            response.setContentType("text/html");
-            dispatcher.include(request, response);
-            return null;
-         }
-      });
-
-
-      seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
-      {
-         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
-         {
-            assertEquals(org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherSequenceBuilder.SERVLET_A_URI, request.getRequestURI());
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /** Show that we can access request headers from the portlet request properties. */
-   public void createRequestHeaderAccess(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("RequestHeaderAccess", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            // Test the value is not there yet
-            Set propertyNames = Tools.toSet(request.getPropertyNames());
-            assertFalse(propertyNames.contains("myheader"));
-            assertNull(request.getProperty("myheader"));
-            assertFalse(request.getProperties("myheader").hasMoreElements());
-
-            // Invoke render with header
-            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
-            render.addHeader("myheader").addElement("render-value");
-            return render;
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
-            response.setContentType("text/html");
-            dispatcher.include(request, response);
-            return null;
-         }
-      });
-
-      seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
-      {
-         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context)
-         {
-            // Test the header is here
-            Set headerNames = Tools.toSet(request.getHeaderNames());
-            assertTrue(headerNames.contains("myheader"));
-            assertEquals("render-value", request.getHeader("myheader"));
-            Enumeration values = request.getHeaders("myheader");
-            assertTrue(values.hasMoreElements());
-            assertEquals("render-value", values.nextElement());
-            assertFalse(values.hasMoreElements());
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createFilters(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("Filters", seq);
-      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            PortletRequestDispatcher prd = request.getPortletSession().getPortletContext().getRequestDispatcher("/noop");
-            assertNotNull(prd);
-            ServletFilter.ids.clear();
-            prd.include(request, response);
-            assertEquals(new CollectionBuilder().add("INCLUDE_URL_PATTERN_FILTER").add("INCLUDE_NAMED_FILTER").toHashSet(), ServletFilter.ids);
-
-            //
-            prd = request.getPortletSession().getPortletContext().getNamedDispatcher("NoopServlet");
-            assertNotNull(prd);
-            ServletFilter.ids.clear();
-            prd.include(request, response);
-            assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"), ServletFilter.ids);
-
-            //
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createDispatchingFilter(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("DispatchingFilter", seq);
-      seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-
-            // Need to set content type as we will include a JSP that will produce output
-            response.setContentType("text/html");
-
-            //
-            PortletRequestDispatcher prd = request.getPortletSession().getPortletContext().getNamedDispatcher("TargetForIncludeNamedDispatchingFilter");
-            assertNotNull(prd);
-            prd.include(request, response);
-
-            //
-            prd = request.getPortletSession().getPortletContext().getRequestDispatcher("/TargetForIncludeURLPatternDispatchingFilter");
-            assertNotNull(prd);
-            prd.include(request, response);
-
-            //
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilterTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilterTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/DispatchingFilterTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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.dispatcher;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class DispatchingFilterTestCase
+{
+   public DispatchingFilterTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+
+            // Need to set content type as we will include a JSP that will produce output
+            response.setContentType("text/html");
+
+            //
+            PortletRequestDispatcher prd = request.getPortletSession().getPortletContext().getNamedDispatcher("TargetForIncludeNamedDispatchingFilter");
+            assertNotNull(prd);
+            prd.include(request, response);
+
+            //
+            prd = request.getPortletSession().getPortletContext().getRequestDispatcher("/TargetForIncludeURLPatternDispatchingFilter");
+            assertNotNull(prd);
+            prd.include(request, response);
+
+            //
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/FiltersTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/FiltersTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/FiltersTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.dispatcher;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import java.io.IOException;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class FiltersTestCase
+{
+   public FiltersTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            PortletRequestDispatcher prd = request.getPortletSession().getPortletContext().getRequestDispatcher("/noop");
+            assertNotNull(prd);
+            ServletFilter.ids.clear();
+            prd.include(request, response);
+            assertEquals(new CollectionBuilder().add("INCLUDE_URL_PATTERN_FILTER").add("INCLUDE_NAMED_FILTER").toHashSet(), ServletFilter.ids);
+
+            //
+            prd = request.getPortletSession().getPortletContext().getNamedDispatcher("NoopServlet");
+            assertNotNull(prd);
+            ServletFilter.ids.clear();
+            prd.include(request, response);
+            assertEquals(Collections.singleton("INCLUDE_NAMED_FILTER"), ServletFilter.ids);
+
+            //
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/GetRequestURITestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/GetRequestURITestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/GetRequestURITestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.dispatcher;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class GetRequestURITestCase
+{
+
+   public static final String SERVLET_A_URI = "/test-jsr168-ext-dispatcher/universalServletA";
+
+   public GetRequestURITestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+            response.setContentType("text/html");
+            dispatcher.include(request, response);
+            return null;
+         }
+      });
+
+
+      seq.addAction(0, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+      {
+         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
+         {
+            assertEquals(SERVLET_A_URI, request.getRequestURI());
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/RequestHeaderAccessTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/RequestHeaderAccessTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/dispatcher/RequestHeaderAccessTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.dispatcher;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertFalse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertTrue;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequestDispatcher;
+import javax.servlet.Servlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Set;
+import java.util.Enumeration;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class RequestHeaderAccessTestCase
+{
+   public RequestHeaderAccessTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            // Test the value is not there yet
+            Set propertyNames = Tools.toSet(request.getPropertyNames());
+            assertFalse(propertyNames.contains("myheader"));
+            assertNull(request.getProperty("myheader"));
+            assertFalse(request.getProperties("myheader").hasMoreElements());
+
+            // Invoke render with header
+            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
+            render.addHeader("myheader").addElement("render-value");
+            return render;
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            PortletRequestDispatcher dispatcher = ((AbstractUniversalTestPortlet)portlet).getPortletContext().getRequestDispatcher("/universalServletA");
+            response.setContentType("text/html");
+            dispatcher.include(request, response);
+            return null;
+         }
+      });
+
+      seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+      {
+         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context)
+         {
+            // Test the header is here
+            Set headerNames = Tools.toSet(request.getHeaderNames());
+            assertTrue(headerNames.contains("myheader"));
+            assertEquals("render-value", request.getHeader("myheader"));
+            Enumeration values = request.getHeaders("myheader");
+            assertTrue(values.hasMoreElements());
+            assertEquals("render-value", values.nextElement());
+            assertFalse(values.hasMoreElements());
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ActionInvalidatesExpiringCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ActionInvalidatesExpiringCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ActionInvalidatesExpiringCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractActionInvalidatesTestCase;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ActionInvalidatesExpiringCacheTestCase extends AbstractActionInvalidatesTestCase
+{
+   public ActionInvalidatesExpiringCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/DisableDuringRenderExpiringCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/DisableDuringRenderExpiringCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/DisableDuringRenderExpiringCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractDisableDuringRenderTestCase;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class DisableDuringRenderExpiringCacheTestCase extends AbstractDisableDuringRenderTestCase
+{
+   public DisableDuringRenderExpiringCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,269 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.expiringcache;
-
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-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.test.portlet.framework.UTP11;
-import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheSequenceBuilder;
-import org.jboss.portal.common.util.CollectionBuilder;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.FailureResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-import org.jboss.unit.Failure;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletException;
-import javax.portlet.PortletURL;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
-{
-
-   public void createDisableDuringRenderExpiringCache(PortletTestDriver registry)
-   {
-      createDisableDuringRender("DisableDuringRenderExpiringCache", registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
-   }
-
-   public void createActionInvalidatesExpiringCache(PortletTestDriver registry)
-   {
-      createActionInvalidates("ActionInvalidatesExpiringCache", registry, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
-   }
-
-   public void createExpiringCacheWithRenderParameters(PortletTestDriver registry)
-   {
-      createCacheMarkup("ExpiringCacheWithRenderParameters", registry, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT, renderParameterConfigurator);
-   }
-
-   public void createExpiringCacheWithWindowState(PortletTestDriver registry)
-   {
-      createCacheMarkup("ExpiringCacheWithWindowState", registry, UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT, windowStateConfigurator);
-   }
-
-   public void createExpiringCacheWithPortletMode(PortletTestDriver registry)
-   {
-      createCacheMarkup("ExpiringCacheWithPortletMode", registry, UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT, portletModeConfigurator);
-   }
-
-   /**
-    * Check that content is cached for at most 5 seconds in various situations. 
-    */
-   public void createExpiringCache(PortletTestDriver registry)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ExpiringCache", seq);
-
-      //
-      seq.addAction(0, UTP10.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, UTP10.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, UTP11.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, UTP10.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, UTP11.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 FailureResponse(Failure.createFailure(e));
-            }
-         }
-      });
-
-      //
-      seq.addAction(3, UTP10.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, UTP10.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, UTP10.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, UTP11.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, UTP10.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, UTP11.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 FailureResponse(Failure.createFailure(e));
-            }
-         }
-      });
-
-      //
-      seq.addAction(7, UTP10.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();
-         }
-      });
-   }
-
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,227 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP10;
+import org.jboss.portal.test.portlet.framework.UTP11;
+import org.jboss.portal.common.util.CollectionBuilder;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.*;
+import org.jboss.unit.Failure;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletURL;
+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 $
+ */
+ at TestCase
+public class ExpiringCacheTestCase
+{
+
+   final Set calls = new HashSet();
+   String url;
+
+   public ExpiringCacheTestCase(PortletTest seq)
+   {
+      //
+      seq.addAction(0, UTP10.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 = response.createRenderURL().toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(1, UTP10.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, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Refresh
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(2, UTP10.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, UTP11.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);
+            }
+            catch (InterruptedException e)
+            {
+               return new FailureResponse(Failure.createFailure(e));
+            }
+         }
+      });
+
+      //
+      seq.addAction(3, UTP10.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 = tmp.toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(4, UTP10.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);
+         }
+      });
+
+      //
+      seq.addAction(5, UTP10.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, UTP11.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Refresh
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(6, UTP10.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, UTP11.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);
+            }
+            catch (InterruptedException e)
+            {
+               return new FailureResponse(Failure.createFailure(e));
+            }
+         }
+      });
+
+      //
+      seq.addAction(7, UTP10.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();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithPortletModeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithPortletModeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithPortletModeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import org.jboss.portal.test.portlet.framework.UTP9;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ExpiringCacheWithPortletModeTestCase extends AbstractCacheMarkupTestCase
+{
+   public ExpiringCacheWithPortletModeTestCase(PortletTest seq)
+   {
+      super(seq, UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT, NavigationalStateConfigurator.PORTLET_MODE_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithRenderParametersTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithRenderParametersTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithRenderParametersTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ExpiringCacheWithRenderParametersTestCase extends AbstractCacheMarkupTestCase
+{
+   public ExpiringCacheWithRenderParametersTestCase(PortletTest seq)
+   {
+      super(seq, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT, NavigationalStateConfigurator.RENDER_PARAMETER_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithWindowStateTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithWindowStateTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/expiringcache/ExpiringCacheWithWindowStateTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.expiringcache;
+
+import org.jboss.portal.test.portlet.jsr168.ext.common.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP6;
+import org.jboss.portal.test.portlet.framework.UTP7;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ExpiringCacheWithWindowStateTestCase extends AbstractCacheMarkupTestCase
+{
+   public ExpiringCacheWithWindowStateTestCase(PortletTest seq)
+   {
+      super(seq, UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT, NavigationalStateConfigurator.WINDOW_STATE_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/ActionInvalidatesNeverExpiringCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/ActionInvalidatesNeverExpiringCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/ActionInvalidatesNeverExpiringCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.AbstractActionInvalidatesTestCase;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ActionInvalidatesNeverExpiringCacheTestCase extends AbstractActionInvalidatesTestCase
+{
+   public ActionInvalidatesNeverExpiringCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/DisableDuringRenderNeverExpiringCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/DisableDuringRenderNeverExpiringCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/DisableDuringRenderNeverExpiringCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.AbstractDisableDuringRenderTestCase;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class DisableDuringRenderNeverExpiringCacheTestCase extends AbstractDisableDuringRenderTestCase
+{
+   public DisableDuringRenderNeverExpiringCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,68 +0,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.                   *
- ******************************************************************************/
-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.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.framework.portlet.PortletTestDriver;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class NeverExpiringCacheSequenceBuilder extends AbstractCacheSequenceBuilder
-{
-
-   public void createDisableDuringRenderNeverExpiringCache(PortletTestDriver registry)
-   {
-      createDisableDuringRender("DisableDuringRenderNeverExpiringCache", registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT);
-   }
-
-   public void createActionInvalidatesNeverExpiringCache(PortletTestDriver registry)
-   {
-      createActionInvalidates("ActionInvalidatesNeverExpiringCache", registry, UTP2.RENDER_JOINPOINT, UTP2.ACTION_JOINPOINT, UTP3.RENDER_JOINPOINT);
-   }
-
-   public void createNeverExpiringCacheWithRenderParameters(PortletTestDriver registry)
-   {
-      createCacheMarkup("NeverExpiringCacheWithRenderParameters", registry, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT, renderParameterConfigurator);
-   }
-
-   public void createNeverExpiringCacheWithWindowState(PortletTestDriver registry)
-   {
-      createCacheMarkup("NeverExpiringCacheWithWindowState", registry, UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT, windowStateConfigurator);
-   }
-
-   public void createNeverExpiringCacheWithPortletMode(PortletTestDriver registry)
-   {
-      createCacheMarkup("NeverExpiringCacheWithPortletMode", registry, UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT, portletModeConfigurator);
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithPortletModeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithPortletModeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithPortletModeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP8;
+import org.jboss.portal.test.portlet.framework.UTP9;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class NeverExpiringCacheWithPortletModeTestCase extends AbstractCacheMarkupTestCase
+{
+   public NeverExpiringCacheWithPortletModeTestCase(PortletTest seq)
+   {
+      super(seq, UTP8.RENDER_JOINPOINT, UTP8.ACTION_JOINPOINT, UTP9.RENDER_JOINPOINT, NavigationalStateConfigurator.PORTLET_MODE_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithRenderParametersTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithRenderParametersTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithRenderParametersTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.test.portlet.framework.UTP5;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class NeverExpiringCacheWithRenderParametersTestCase extends AbstractCacheMarkupTestCase
+{
+   public NeverExpiringCacheWithRenderParametersTestCase(PortletTest seq)
+   {
+      super(seq, UTP4.RENDER_JOINPOINT, UTP4.ACTION_JOINPOINT, UTP5.RENDER_JOINPOINT, NavigationalStateConfigurator.RENDER_PARAMETER_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithWindowStateTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithWindowStateTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/neverexpiringcache/NeverExpiringCacheWithWindowStateTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * 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.AbstractCacheMarkupTestCase;
+import org.jboss.portal.test.portlet.jsr168.ext.common.NavigationalStateConfigurator;
+import org.jboss.portal.test.portlet.framework.UTP6;
+import org.jboss.portal.test.portlet.framework.UTP7;
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class NeverExpiringCacheWithWindowStateTestCase extends AbstractCacheMarkupTestCase
+{
+   public NeverExpiringCacheWithWindowStateTestCase(PortletTest seq)
+   {
+      super(seq, UTP6.RENDER_JOINPOINT, UTP6.ACTION_JOINPOINT, UTP7.RENDER_JOINPOINT, NavigationalStateConfigurator.WINDOW_STATE_CONFIGURATOR);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/AbstractNoCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,209 @@
+/******************************************************************************
+ * 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.nocache;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+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.common.util.CollectionBuilder;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.FailureResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import org.jboss.unit.Failure;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+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 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 $
+ */
+ at TestCase
+public class AbstractNoCacheTestCase
+{
+
+   final Set calls = new HashSet();
+   String url;
+
+   public AbstractNoCacheTestCase(
+      PortletTest seq,
+      Joinpoint p1renderjp,
+      Joinpoint p1actionjp,
+      Joinpoint p2renderjp)
+   {
+      //
+      seq.addAction(0, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("0");
+
+            // Refresh
+            url = response.createRenderURL().toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(1, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("1");
+            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
+
+            // Refresh
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      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");
+            response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
+
+            // Refresh
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(3, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should not be called
+            calls.add("3");
+            return null;
+         }
+      });
+      seq.addAction(3, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Refresh
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(4, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Could be called or not depending on the page rendering ordre
+            return null;
+         }
+      });
+      seq.addAction(4, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            try
+            {
+               // Wait 5 seconds for the cache entry to be invalid
+               Thread.sleep(5 * 1000);
+
+               // Refresh
+               return new InvokeGetResponse(url);
+            }
+            catch (InterruptedException e)
+            {
+               return new FailureResponse(Failure.createFailure(e));
+            }
+         }
+      });
+
+      //
+      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");
+            response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
+            url = response.createActionURL().toString();
+            return new InvokeGetResponse(url);
+         }
+      });
+
+      //
+      seq.addAction(6, p1actionjp, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
+         {
+            // Should be called
+            calls.add("6_action");
+         }
+      });
+      seq.addAction(6, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            // Should be called
+            calls.add("6_render");
+            return new InvokeGetResponse(response.createRenderURL().toString());
+         }
+      });
+
+      //
+      seq.addAction(7, p1renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            //
+            return null;
+         }
+      });
+      seq.addAction(7, p2renderjp, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
+         {
+            //
+            Set expected = new CollectionBuilder().add("0").add("1").add("2").add("5").add("6_render").add("6_action").toHashSet();
+            assertEquals(expected, calls);
+
+            // Refresh
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ExplicitNoCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ExplicitNoCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ExplicitNoCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * 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.nocache;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.Joinpoint;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTP2;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ExplicitNoCacheTestCase extends AbstractNoCacheTestCase
+{
+   public ExplicitNoCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT, UTP2.RENDER_JOINPOINT);
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ImplicitNoCacheTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ImplicitNoCacheTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/ImplicitNoCacheTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,41 @@
+/******************************************************************************
+ * 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.nocache;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.portlet.framework.UTP3;
+import org.jboss.portal.test.portlet.framework.UTP4;
+import org.jboss.portal.unit.annotations.TestCase;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ImplicitNoCacheTestCase extends AbstractNoCacheTestCase
+{
+   public ImplicitNoCacheTestCase(PortletTest seq)
+   {
+      super(seq, UTP3.RENDER_JOINPOINT, UTP3.ACTION_JOINPOINT, UTP4.RENDER_JOINPOINT);
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/nocache/NoCacheSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,231 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.nocache;
-
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-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.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.common.util.CollectionBuilder;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.FailureResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.Failure;
-
-import static org.jboss.unit.api.Assert.*;
-
-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 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 NoCacheSequenceBuilder extends PortletTestSuite
-{
-
-   public void createExplicitNoCache(PortletTestDriver registry)
-   {
-      create("ExplicitNoCache", registry, UTP1.RENDER_JOINPOINT, UTP1.ACTION_JOINPOINT, UTP2.RENDER_JOINPOINT);
-   }
-
-   public void createImplicitNoCache(PortletTestDriver registry)
-   {
-      create("ImplicitNoCache", registry, UTP3.RENDER_JOINPOINT, UTP3.ACTION_JOINPOINT, UTP4.RENDER_JOINPOINT);
-   }
-
-   /**
-    * Setting expiration cache value force caching for a certain amount of time and
-    * can be invalidated by an action or by time.
-    */
-   private void create(
-      String testName,
-      PortletTestDriver registry,
-      Joinpoint p1renderjp,
-      Joinpoint p1actionjp,
-      Joinpoint p2renderjp)
-   {
-      final Set calls = new HashSet();
-      final String[] url = new String[1];
-      PortletTest seq = new PortletTest();
-      registry.addSequence(testName, seq);
-
-      //
-      seq.addAction(0, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("0");
-
-            // Refresh
-            url[0] = response.createRenderURL().toString();
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(1, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("1");
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "0");
-
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      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");
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
-
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(3, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should not be called
-            calls.add("3");
-            return null;
-         }
-      });
-      seq.addAction(3, p2renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Refresh
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(4, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Could be called or not depending on the page rendering ordre
-            return null;
-         }
-      });
-      seq.addAction(4, p2renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            try
-            {
-               // 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 FailureResponse(Failure.createFailure(e));
-            }
-         }
-      });
-
-      //
-      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");
-            response.setProperty(RenderResponse.EXPIRATION_CACHE, "5");
-            url[0] = response.createActionURL().toString();
-            return new InvokeGetResponse(url[0]);
-         }
-      });
-
-      //
-      seq.addAction(6, p1actionjp, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, IOException
-         {
-            // Should be called
-            calls.add("6_action");
-         }
-      });
-      seq.addAction(6, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            // Should be called
-            calls.add("6_render");
-            return new InvokeGetResponse(response.createRenderURL().toString());
-         }
-      });
-
-      //
-      seq.addAction(7, p1renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            //
-            return null;
-         }
-      });
-      seq.addAction(7, p2renderjp, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws IOException, PortletException
-         {
-            //
-            Set expected = new CollectionBuilder().add("0").add("1").add("2").add("5").add("6_render").add("6_action").toHashSet();
-            assertEquals(expected, calls);
-
-            // Refresh
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/GetResourceBundleDuringInitTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/GetResourceBundleDuringInitTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/GetResourceBundleDuringInitTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.GetResourceBundleDuringInitPortlet;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.ResourceBundle;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class GetResourceBundleDuringInitTestCase
+{
+   public GetResourceBundleDuringInitTestCase(PortletTest seq)
+   {
+      seq.addAction(0, GetResourceBundleDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            ResourceBundle bundle = GetResourceBundleDuringInitPortlet.bundle;
+            assertNotNull(bundle);
+            assertEquals("bar", bundle.getObject("foo"));
+            assertEquals(Locale.ENGLISH, bundle.getLocale());
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/PortletConfigSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,169 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.portletconfig;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.GetResourceBundleDuringInitPortlet;
-import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundleCascadePortlet;
-import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundlePortlet;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletConfigSequenceBuilder extends PortletTestSuite
-{
-   public void createGetResourceBundleDuringInit(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("GetResourceBundleDuringInit", seq);
-
-      seq.addAction(0, GetResourceBundleDuringInitPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            ResourceBundle bundle = GetResourceBundleDuringInitPortlet.bundle;
-            assertNotNull(bundle);
-            assertEquals("bar", bundle.getObject("foo"));
-            assertEquals(Locale.ENGLISH, bundle.getLocale());
-            return new EndTestResponse();
-         }
-      });
-   }
-
-
-   public void createResourceBundleCascade(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ResourceBundleCascade", seq);
-
-      seq.addAction(0, ResourceBundleCascadePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
-
-            ResourceBundle bundle_en = cfg.getResourceBundle(Locale.ENGLISH);
-            ResourceBundle bundle_it = cfg.getResourceBundle(Locale.ITALIAN);
-            ResourceBundle bundle_zz = cfg.getResourceBundle(new Locale("zz"));
-            ResourceBundle bundle_en_GB = cfg.getResourceBundle(Locale.UK);
-            ResourceBundle bundle_de = cfg.getResourceBundle(Locale.GERMAN);
-            ResourceBundle bundle_de_DE = cfg.getResourceBundle(Locale.GERMANY);
-            ResourceBundle bundle_fr = cfg.getResourceBundle(Locale.FRENCH);
-            ResourceBundle bundle_fr_FR = cfg.getResourceBundle(Locale.FRANCE);
-            ResourceBundle bundle_fr_FR_aa = cfg.getResourceBundle(new Locale(Locale.FRANCE.getLanguage(), Locale.FRANCE.getCountry(), "aa"));
-
-            assertEquals(Locale.ENGLISH, bundle_en.getLocale());
-            assertEquals(Locale.ENGLISH, bundle_it.getLocale());
-            assertEquals(Locale.ENGLISH, bundle_zz.getLocale());
-            assertEquals(Locale.UK, bundle_en_GB.getLocale());
-            assertEquals(Locale.GERMAN, bundle_de.getLocale());
-            assertEquals(Locale.GERMANY, bundle_de_DE.getLocale());
-            assertEquals(Locale.FRENCH, bundle_fr.getLocale());
-            assertEquals(Locale.FRANCE, bundle_fr_FR.getLocale());
-            assertEquals(Locale.FRANCE, bundle_fr_FR_aa.getLocale());
-
-            assertEquals("title", bundle_en.getString("javax.portlet.title"));
-            assertEquals("title", bundle_it.getString("javax.portlet.title"));
-            assertEquals("title", bundle_zz.getString("javax.portlet.title"));
-            assertEquals("title", bundle_en_GB.getString("javax.portlet.title"));
-            assertEquals("title", bundle_de.getString("javax.portlet.title"));
-            assertEquals("title", bundle_de_DE.getString("javax.portlet.title"));
-            assertEquals("title", bundle_fr.getString("javax.portlet.title"));
-            assertEquals("title", bundle_fr_FR.getString("javax.portlet.title"));
-            assertEquals("title", bundle_fr_FR_aa.getString("javax.portlet.title"));
-
-            assertEquals("short-title", bundle_en.getString("javax.portlet.short-title"));
-            assertEquals("short-title", bundle_it.getString("javax.portlet.short-title"));
-            assertEquals("short-title", bundle_zz.getString("javax.portlet.short-title"));
-            assertEquals("short-title", bundle_de.getString("javax.portlet.short-title"));
-            assertEquals("short-title_de_DE", bundle_de_DE.getString("javax.portlet.short-title"));
-            assertEquals("short-title_fr", bundle_fr.getString("javax.portlet.short-title"));
-            assertEquals("short-title_fr_FR", bundle_fr_FR.getString("javax.portlet.short-title"));
-            assertEquals("short-title_fr_FR", bundle_fr_FR_aa.getString("javax.portlet.short-title"));
-
-            assertThrowsMissingResourceException(bundle_en);
-            assertThrowsMissingResourceException(bundle_it);
-            assertThrowsMissingResourceException(bundle_zz);
-            assertThrowsMissingResourceException(bundle_de);
-            assertThrowsMissingResourceException(bundle_de_DE);
-            assertThrowsMissingResourceException(bundle_fr);
-            assertThrowsMissingResourceException(bundle_fr_FR);
-            assertThrowsMissingResourceException(bundle_fr_FR_aa);
-            return new EndTestResponse();
-         }
-
-         private void assertThrowsMissingResourceException(ResourceBundle bundle)
-         {
-            try
-            {
-               bundle.getString("javax.portlet.keywords");
-               fail();
-            }
-            catch (MissingResourceException expected)
-            {
-            }
-         }
-      });
-   }
-
-   public void createResourceBundle(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ResourceBundle", seq);
-
-      seq.addAction(0, ResourceBundlePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
-            ResourceBundle bundle = cfg.getResourceBundle(Locale.ENGLISH);
-
-            String example = bundle.getString("example-key");
-            assertEquals("example-value", example);
-
-            //
-            String title = bundle.getString("javax.portlet.title");
-            assertEquals("the title", title);
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleCascadeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleCascadeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleCascadeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,122 @@
+/******************************************************************************
+ * 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.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundleCascadePortlet;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import java.util.ResourceBundle;
+import java.util.Locale;
+import java.util.MissingResourceException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ResourceBundleCascadeTestCase
+{
+   public ResourceBundleCascadeTestCase(PortletTest seq)
+   {
+      seq.addAction(0, ResourceBundleCascadePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+
+            ResourceBundle bundle_en = cfg.getResourceBundle(Locale.ENGLISH);
+            ResourceBundle bundle_it = cfg.getResourceBundle(Locale.ITALIAN);
+            ResourceBundle bundle_zz = cfg.getResourceBundle(new Locale("zz"));
+            ResourceBundle bundle_en_GB = cfg.getResourceBundle(Locale.UK);
+            ResourceBundle bundle_de = cfg.getResourceBundle(Locale.GERMAN);
+            ResourceBundle bundle_de_DE = cfg.getResourceBundle(Locale.GERMANY);
+            ResourceBundle bundle_fr = cfg.getResourceBundle(Locale.FRENCH);
+            ResourceBundle bundle_fr_FR = cfg.getResourceBundle(Locale.FRANCE);
+            ResourceBundle bundle_fr_FR_aa = cfg.getResourceBundle(new Locale(Locale.FRANCE.getLanguage(), Locale.FRANCE.getCountry(), "aa"));
+
+            assertEquals(Locale.ENGLISH, bundle_en.getLocale());
+            assertEquals(Locale.ENGLISH, bundle_it.getLocale());
+            assertEquals(Locale.ENGLISH, bundle_zz.getLocale());
+            assertEquals(Locale.UK, bundle_en_GB.getLocale());
+            assertEquals(Locale.GERMAN, bundle_de.getLocale());
+            assertEquals(Locale.GERMANY, bundle_de_DE.getLocale());
+            assertEquals(Locale.FRENCH, bundle_fr.getLocale());
+            assertEquals(Locale.FRANCE, bundle_fr_FR.getLocale());
+            assertEquals(Locale.FRANCE, bundle_fr_FR_aa.getLocale());
+
+            assertEquals("title", bundle_en.getString("javax.portlet.title"));
+            assertEquals("title", bundle_it.getString("javax.portlet.title"));
+            assertEquals("title", bundle_zz.getString("javax.portlet.title"));
+            assertEquals("title", bundle_en_GB.getString("javax.portlet.title"));
+            assertEquals("title", bundle_de.getString("javax.portlet.title"));
+            assertEquals("title", bundle_de_DE.getString("javax.portlet.title"));
+            assertEquals("title", bundle_fr.getString("javax.portlet.title"));
+            assertEquals("title", bundle_fr_FR.getString("javax.portlet.title"));
+            assertEquals("title", bundle_fr_FR_aa.getString("javax.portlet.title"));
+
+            assertEquals("short-title", bundle_en.getString("javax.portlet.short-title"));
+            assertEquals("short-title", bundle_it.getString("javax.portlet.short-title"));
+            assertEquals("short-title", bundle_zz.getString("javax.portlet.short-title"));
+            assertEquals("short-title", bundle_de.getString("javax.portlet.short-title"));
+            assertEquals("short-title_de_DE", bundle_de_DE.getString("javax.portlet.short-title"));
+            assertEquals("short-title_fr", bundle_fr.getString("javax.portlet.short-title"));
+            assertEquals("short-title_fr_FR", bundle_fr_FR.getString("javax.portlet.short-title"));
+            assertEquals("short-title_fr_FR", bundle_fr_FR_aa.getString("javax.portlet.short-title"));
+
+            assertThrowsMissingResourceException(bundle_en);
+            assertThrowsMissingResourceException(bundle_it);
+            assertThrowsMissingResourceException(bundle_zz);
+            assertThrowsMissingResourceException(bundle_de);
+            assertThrowsMissingResourceException(bundle_de_DE);
+            assertThrowsMissingResourceException(bundle_fr);
+            assertThrowsMissingResourceException(bundle_fr_FR);
+            assertThrowsMissingResourceException(bundle_fr_FR_aa);
+            return new EndTestResponse();
+         }
+
+         private void assertThrowsMissingResourceException(ResourceBundle bundle)
+         {
+            try
+            {
+               bundle.getString("javax.portlet.keywords");
+               fail();
+            }
+            catch (MissingResourceException expected)
+            {
+            }
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletconfig/ResourceBundleTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.portletconfig;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.jsr168.ext.portletconfig.extended.ResourceBundlePortlet;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletConfig;
+import java.util.ResourceBundle;
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ResourceBundleTestCase
+{
+   public ResourceBundleTestCase(PortletTest seq)
+   {
+      seq.addAction(0, ResourceBundlePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletConfig cfg = ((AbstractUniversalTestPortlet)portlet).getPortletConfig();
+            ResourceBundle bundle = cfg.getResourceBundle(Locale.ENGLISH);
+
+            String example = bundle.getString("example-key");
+            assertEquals("example-value", example);
+
+            //
+            String title = bundle.getString("javax.portlet.title");
+            assertEquals("the title", title);
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/PortletModeSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,150 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.portletmode;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletModeException;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletModeSequenceBuilder extends PortletTestSuite
-{
-   public void createTestActionWithPortletModeCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestActionWithPortletMode", seq);
-      seq.addAction(0, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletModeException
-         {
-            PortletURL url = response.createActionURL();
-            url.setPortletMode(PortletMode.EDIT);
-            InvokeGetResponse result = new InvokeGetResponse(url.toString());
-            return result;
-         }
-      });
-
-      seq.addAction(1, TestActionWithPortletModePortlet.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
-         {
-            assertEquals(PortletMode.EDIT, request.getPortletMode());
-         }
-      });
-
-      seq.addAction(1, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createTestDuringActionCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestDuringAction", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            InvokeGetResponse result = new InvokeGetResponse(url.toString());
-            return result;
-         }
-      });
-
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletModeException
-         {
-            // Test we can set null portlet mode
-            response.setPortletMode(null);
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-
-   }
-
-   public void createTestDuringRenderCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestDuringRender", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletModeException
-         {
-            // Test null returns false
-            assertFalse(request.isPortletModeAllowed(null));
-
-            // Test that we can use set the portlet mode on render URL
-            // before having set the content type on the response
-            PortletURL url1 = response.createRenderURL();
-            url1.setPortletMode(PortletMode.VIEW);
-
-            // Test we can set null portlet mode
-            url1.setPortletMode(null);
-
-            // Test that we can use set the portlet mode on action URL
-            // before having set the content type on the response
-            PortletURL url2 = response.createActionURL();
-            url2.setPortletMode(PortletMode.VIEW);
-
-            // Test we can set null portlet mode
-            url2.setPortletMode(null);
-            return new EndTestResponse();
-         }
-      });
-   }
-
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestActionWithPortletModeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestActionWithPortletModeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestActionWithPortletModeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.jsr168.ext.portletmode.extended.TestActionWithPortletModePortlet;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.PortletMode;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestActionWithPortletModeTestCase
+{
+   public TestActionWithPortletModeTestCase(PortletTest seq)
+   {
+      seq.addAction(0, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletModeException
+         {
+            PortletURL url = response.createActionURL();
+            url.setPortletMode(PortletMode.EDIT);
+            InvokeGetResponse result = new InvokeGetResponse(url.toString());
+            return result;
+         }
+      });
+
+      seq.addAction(1, TestActionWithPortletModePortlet.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
+         {
+            assertEquals(PortletMode.EDIT, request.getPortletMode());
+         }
+      });
+
+      seq.addAction(1, TestActionWithPortletModePortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringActionTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringActionTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringActionTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletModeException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestDuringActionTestCase
+{
+   public TestDuringActionTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            InvokeGetResponse result = new InvokeGetResponse(url.toString());
+            return result;
+         }
+      });
+
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletModeException
+         {
+            // Test we can set null portlet mode
+            response.setPortletMode(null);
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringRenderTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringRenderTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletmode/TestDuringRenderTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.portletmode;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertFalse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletModeException;
+import javax.portlet.PortletURL;
+import javax.portlet.PortletMode;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestDuringRenderTestCase
+{
+   public TestDuringRenderTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context) throws PortletModeException
+         {
+            // Test null returns false
+            assertFalse(request.isPortletModeAllowed(null));
+
+            // Test that we can use set the portlet mode on render URL
+            // before having set the content type on the response
+            PortletURL url1 = response.createRenderURL();
+            url1.setPortletMode(PortletMode.VIEW);
+
+            // Test we can set null portlet mode
+            url1.setPortletMode(null);
+
+            // Test that we can use set the portlet mode on action URL
+            // before having set the content type on the response
+            PortletURL url2 = response.createActionURL();
+            url2.setPortletMode(PortletMode.VIEW);
+
+            // Test we can set null portlet mode
+            url2.setPortletMode(null);
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseFormTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseFormTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseFormTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,118 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.io.IOException;
+
+/**
+ * Test that a POST request having a content type set to x-www-form-urlencoded will make the body content unavailable
+ * as an input stream or a reader and the parameters are decoded.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ActionRequestUseFormTestCase
+{
+   public ActionRequestUseFormTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            url.setParameter("g_foo1", "g_bar1_1");
+            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
+            url.setParameter("g_foo3", new String[]{"g_bar3_1"});
+            InvokePostResponse iur = new InvokePostResponse(url.toString());
+            HttpRequest.Form body = new HttpRequest.Form();
+            body.addParameter("g_foo3", new String[]{"g_bar3_2"});
+            body.addParameter("g_foo4", new String[]{"g_bar4_1"});
+            body.addParameter("g_foo5", new String[]{"g_bar5_1", "g_bar5_2"});
+            iur.setBody(body);
+            iur.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
+            return iur;
+         }
+      });
+
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
+         {
+            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
+            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
+            assertEquals(new String[]{"g_bar3_1", "g_bar3_2"}, request.getParameterValues("g_foo3"));
+            assertEquals(new String[]{"g_bar4_1"}, request.getParameterValues("g_foo4"));
+            assertEquals(new String[]{"g_bar5_1", "g_bar5_2"}, request.getParameterValues("g_foo5"));
+            assertEquals(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED, request.getContentType());
+
+            try
+            {
+               request.getPortletInputStream();
+               fail("Should not get the input stream");
+            }
+            catch (IllegalStateException expected)
+            {
+               //expected
+            }
+
+            try
+            {
+               request.getReader();
+               fail("Should not get the reader");
+            }
+            catch (IllegalStateException expected)
+            {
+               //expected
+            }
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseInputStreamTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseInputStreamTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseInputStreamTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,133 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ByteArrayOutputStream;
+
+/**
+ * Test that a POST request having a content type not set to x-www-form-urlencoded will make the body content
+ * available as a reader.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ActionRequestUseInputStreamTestCase
+{
+
+   private final byte[] byteContent = {65, 66, 67, 68, 69, 70};
+
+   public ActionRequestUseInputStreamTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            url.setParameter("g_foo1", "g_bar1_1");
+            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
+            InvokePostResponse iur = new InvokePostResponse(url.toString());
+            HttpRequest.Raw body = new HttpRequest.Raw();
+            body.setBytes(byteContent);
+            iur.setBody(body);
+            iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
+            return iur;
+         }
+      });
+
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
+         {
+
+            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
+            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
+            assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
+            assertEquals(byteContent.length, request.getContentLength());
+            InputStream in = null;
+            try
+            {
+               in = request.getPortletInputStream();
+               ByteArrayOutputStream out = new ByteArrayOutputStream();
+               IOTools.copy(in, out);
+               out.close();
+               byte[] bytes = out.toByteArray();
+               assertEquals(-1, in.read());
+               assertEquals(byteContent, bytes);
+            }
+            catch (IllegalStateException e)
+            {
+               fail("Was not expecting an ISE");
+            }
+            catch (IOException e)
+            {
+               fail("Was not expecting an IOException");
+            }
+            finally
+            {
+               IOTools.safeClose(in);
+            }
+            try
+            {
+               request.getReader();
+               fail("The reader should not be available");
+            }
+            catch (IllegalStateException expected)
+            {
+            }
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseReaderTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseReaderTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/ActionRequestUseReaderTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.common.http.HttpRequest;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.fail;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringWriter;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ActionRequestUseReaderTestCase
+{
+
+   private final byte[] byteContent = {65, 66, 67, 68, 69, 70};
+
+   public ActionRequestUseReaderTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            url.setParameter("g_foo1", "g_bar1_1");
+            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
+            InvokePostResponse iur = new InvokePostResponse(url.toString());
+            HttpRequest.Raw body = new HttpRequest.Raw();
+            body.setBytes(byteContent);
+            iur.setBody(body);
+            iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
+            return iur;
+         }
+      });
+
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
+         {
+            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
+            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
+            assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
+            assertEquals(byteContent.length, request.getContentLength());
+            Reader in = null;
+            try
+            {
+               in = request.getReader();
+               StringWriter out = new StringWriter();
+               IOTools.copy(in, out);
+               out.close();
+               byte[] bytes = out.toString().getBytes("UTF-8");
+               assertEquals(-1, in.read());
+               assertEquals(byteContent, bytes);
+            }
+            catch (IllegalStateException e)
+            {
+               fail("Was not expecting an ISE");
+            }
+            catch (IOException e)
+            {
+               fail("Was not expecting an IOException");
+            }
+            finally
+            {
+               IOTools.safeClose(in);
+            }
+            try
+            {
+               request.getPortletInputStream();
+               fail("The inputstream should not be available");
+            }
+            catch (IllegalStateException expected)
+            {
+            }
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/PortletRequestsSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,463 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.portletrequests;
-
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.common.http.HttpRequest;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.remote.driver.handler.http.response.InvokePostResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletURL;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletRequestsSequenceBuilder extends PortletTestSuite
-{
-
-   private final byte[] byteContent = {65, 66, 67, 68, 69, 70};
-
-   /**
-    * Test that a POST request having a content type set to x-www-form-urlencoded will make the body content unavailable
-    * as an input stream or a reader and the parameters are decoded.
-    */
-   public void createActionRequestUseFormCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ActionRequestUseForm", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            url.setParameter("g_foo1", "g_bar1_1");
-            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
-            url.setParameter("g_foo3", new String[]{"g_bar3_1"});
-            InvokePostResponse iur = new InvokePostResponse(url.toString());
-            HttpRequest.Form body = new HttpRequest.Form();
-            body.addParameter("g_foo3", new String[]{"g_bar3_2"});
-            body.addParameter("g_foo4", new String[]{"g_bar4_1"});
-            body.addParameter("g_foo5", new String[]{"g_bar5_1", "g_bar5_2"});
-            iur.setBody(body);
-            iur.setContentType(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED);
-            return iur;
-         }
-      });
-
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
-         {
-            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
-            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
-            assertEquals(new String[]{"g_bar3_1", "g_bar3_2"}, request.getParameterValues("g_foo3"));
-            assertEquals(new String[]{"g_bar4_1"}, request.getParameterValues("g_foo4"));
-            assertEquals(new String[]{"g_bar5_1", "g_bar5_2"}, request.getParameterValues("g_foo5"));
-            assertEquals(InvokePostResponse.APPLICATION_X_WWW_FORM_URLENCODED, request.getContentType());
-
-            try
-            {
-               request.getPortletInputStream();
-               fail("Should not get the input stream");
-            }
-            catch (IllegalStateException expected)
-            {
-               //expected
-            }
-
-            try
-            {
-               request.getReader();
-               fail("Should not get the reader");
-            }
-            catch (IllegalStateException expected)
-            {
-               //expected
-            }
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * Test that a POST request having a content type not set to x-www-form-urlencoded will make the body content
-    * available as an input stream.
-    */
-   public void createActionRequestUseInputStreamCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ActionRequestUseInputStream", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            url.setParameter("g_foo1", "g_bar1_1");
-            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
-            InvokePostResponse iur = new InvokePostResponse(url.toString());
-            HttpRequest.Raw body = new HttpRequest.Raw();
-            body.setBytes(byteContent);
-            iur.setBody(body);
-            iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
-            return iur;
-         }
-      });
-
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
-         {
-
-            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
-            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
-            assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
-            assertEquals(byteContent.length, request.getContentLength());
-            InputStream in = null;
-            try
-            {
-               in = request.getPortletInputStream();
-               ByteArrayOutputStream out = new ByteArrayOutputStream();
-               IOTools.copy(in, out);
-               out.close();
-               byte[] bytes = out.toByteArray();
-               assertEquals(-1, in.read());
-               assertEquals(byteContent, bytes);
-            }
-            catch (IllegalStateException e)
-            {
-               fail("Was not expecting an ISE");
-            }
-            catch (IOException e)
-            {
-               fail("Was not expecting an IOException");
-            }
-            finally
-            {
-               IOTools.safeClose(in);
-            }
-            try
-            {
-               request.getReader();
-               fail("The reader should not be available");
-            }
-            catch (IllegalStateException expected)
-            {
-            }
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * Test that a POST request having a content type not set to x-www-form-urlencoded will make the body content
-    * available as a reader.
-    */
-   public void createActionRequestUseReaderCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ActionRequestUseReader", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            url.setParameter("g_foo1", "g_bar1_1");
-            url.setParameter("g_foo2", new String[]{"g_bar2_1", "g_bar2_2"});
-            InvokePostResponse iur = new InvokePostResponse(url.toString());
-            HttpRequest.Raw body = new HttpRequest.Raw();
-            body.setBytes(byteContent);
-            iur.setBody(body);
-            iur.setContentType(InvokePostResponse.MULTIPART_FORM_DATA);
-            return iur;
-         }
-      });
-
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws IOException
-         {
-            assertEquals(new String[]{"g_bar1_1"}, request.getParameterValues("g_foo1"));
-            assertEquals(new String[]{"g_bar2_1", "g_bar2_2"}, request.getParameterValues("g_foo2"));
-            assertEquals(InvokePostResponse.MULTIPART_FORM_DATA, request.getContentType());
-            assertEquals(byteContent.length, request.getContentLength());
-            Reader in = null;
-            try
-            {
-               in = request.getReader();
-               StringWriter out = new StringWriter();
-               IOTools.copy(in, out);
-               out.close();
-               byte[] bytes = out.toString().getBytes("UTF-8");
-               assertEquals(-1, in.read());
-               assertEquals(byteContent, bytes);
-            }
-            catch (IllegalStateException e)
-            {
-               fail("Was not expecting an ISE");
-            }
-            catch (IOException e)
-            {
-               fail("Was not expecting an IOException");
-            }
-            finally
-            {
-               IOTools.safeClose(in);
-            }
-            try
-            {
-               request.getPortletInputStream();
-               fail("The inputstream should not be available");
-            }
-            catch (IllegalStateException expected)
-            {
-            }
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * This case works with two portlets involved in the same render request. To pass the test, the assert result of the
-    * two portlets must pass.
-    */
-   public void createRequestAttributeCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("RequestAttribute", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            // Take a snapshot of the attribute names
-            Set snapshot = Tools.toSet(request.getAttributeNames());
-
-            // Test that we can remove an attribute without affecting the incoming request, i.e
-            // the same attribute will be present in other render request
-            assertNotNull(request.getAttribute("javax.portlet.config"));
-            request.removeAttribute("javax.portlet.config");
-            assertNull(request.getAttribute("javax.portlet.config"));
-
-            // Test addition of an attribute
-            request.setAttribute("bar", "bar");
-            assertEquals("bar", request.getAttribute("bar"));
-
-            // Test the portlet request names are what we expect
-            HashSet expectedNames = new HashSet(snapshot);
-            expectedNames.remove("javax.portlet.config");
-            expectedNames.add("bar");
-            assertEquals(expectedNames, Tools.toSet(request.getAttributeNames()));
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * This case works with two portlets involved in the same render request. To pass the test, the assert result of the
-    * two portlets must pass.
-    */
-   public void createRequestAttributeScopingCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("RequestAttributeScoping", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            assertNull(request.getAttribute("foo"));
-            request.setAttribute("foo", "foo");
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createRequestParameterCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("RequestParameter", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            url.setParameter("foo1", "bar1");
-            url.setParameter("foo2", new String[]{"bar2_1", "bar2_2"});
-            return new InvokeGetResponse(url.toString());
-         }
-      });
-
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
-         {
-            // The expected map
-            Map expectedParameterMap = new HashMap();
-            expectedParameterMap.put("foo1", Tools.toSet(new String[]{"bar1"}));
-            expectedParameterMap.put("foo2", Tools.toSet(new String[]{"bar2_1", "bar2_2"}));
-
-            // Transform the map to be comparable
-            Map parameterMap = new HashMap(request.getParameterMap());
-            for (Iterator i = parameterMap.entrySet().iterator(); i.hasNext();)
-            {
-               Map.Entry entry = (Map.Entry)i.next();
-               String[] values = (String[])entry.getValue();
-               entry.setValue(Tools.toSet(values));
-            }
-
-            // Compare both
-            assertEquals(expectedParameterMap, parameterMap);
-
-            //
-            Set enumeration = Tools.toSet(request.getParameterNames());
-            Set expectedEnumeration = Tools.toSet(new Object[]{"foo1", "foo2"});
-            assertEquals(expectedEnumeration, enumeration);
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-
-   /** Show that we can access request headers from the portlet request properties. */
-   public void createRequestHeaderAccess(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("RequestHeaderAccess", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            // Test the value is not there yet
-            Set propertyNames = Tools.toSet(request.getPropertyNames());
-            assertFalse(propertyNames.contains("myheader"));
-            assertNull(request.getProperty("myheader"));
-            assertFalse(request.getProperties("myheader").hasMoreElements());
-
-            // Invoke render with header
-            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
-            render.addHeader("myheader").addElement("render-value");
-            return render;
-         }
-      });
-
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            // Test the header is here
-            Set propertyNames = Tools.toSet(request.getPropertyNames());
-            assertTrue(propertyNames.contains("myheader"));
-            assertEquals("render-value", request.getProperty("myheader"));
-            Enumeration values = request.getProperties("myheader");
-            assertTrue(values.hasMoreElements());
-            assertEquals("render-value", values.nextElement());
-            assertFalse(values.hasMoreElements());
-
-            // Invoke action with header
-            InvokeGetResponse action = new InvokeGetResponse(response.createActionURL().toString());
-            action.addHeader("myheader").addElement("action-value");
-            return action;
-         }
-      });
-
-      seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
-         {
-            // Test the header is here
-            Set propertyNames = Tools.toSet(request.getPropertyNames());
-            assertTrue(propertyNames.contains("myheader"));
-            assertEquals("action-value", request.getProperty("myheader"));
-            Enumeration values = request.getProperties("myheader");
-            assertTrue(values.hasMoreElements());
-            assertEquals("action-value", values.nextElement());
-            assertFalse(values.hasMoreElements());
-         }
-      });
-
-      seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeScopingTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeScopingTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeScopingTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * This case works with two portlets involved in the same render request. To pass the test, the assert result of the
+ * two portlets must pass.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class RequestAttributeScopingTestCase
+{
+   public RequestAttributeScopingTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            assertNull(request.getAttribute("foo"));
+            request.setAttribute("foo", "foo");
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestAttributeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import java.util.Set;
+import java.util.HashSet;
+
+/**
+ * This case works with two portlets involved in the same render request. To pass the test, the assert result of the
+ * two portlets must pass.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class RequestAttributeTestCase
+{
+   public RequestAttributeTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            // Take a snapshot of the attribute names
+            Set snapshot = Tools.toSet(request.getAttributeNames());
+
+            // Test that we can remove an attribute without affecting the incoming request, i.e
+            // the same attribute will be present in other render request
+            assertNotNull(request.getAttribute("javax.portlet.config"));
+            request.removeAttribute("javax.portlet.config");
+            assertNull(request.getAttribute("javax.portlet.config"));
+
+            // Test addition of an attribute
+            request.setAttribute("bar", "bar");
+            assertEquals("bar", request.getAttribute("bar"));
+
+            // Test the portlet request names are what we expect
+            HashSet expectedNames = new HashSet(snapshot);
+            expectedNames.remove("javax.portlet.config");
+            expectedNames.add("bar");
+            assertEquals(expectedNames, Tools.toSet(request.getAttributeNames()));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestHeaderAccessTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestHeaderAccessTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestHeaderAccessTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,119 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertFalse;
+import static org.jboss.unit.api.Assert.assertNull;
+import static org.jboss.unit.api.Assert.assertTrue;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.util.Set;
+import java.util.Enumeration;
+
+/**
+ * Show that we can access request headers from the portlet request properties.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class RequestHeaderAccessTestCase
+{
+   public RequestHeaderAccessTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            // Test the value is not there yet
+            Set propertyNames = Tools.toSet(request.getPropertyNames());
+            assertFalse(propertyNames.contains("myheader"));
+            assertNull(request.getProperty("myheader"));
+            assertFalse(request.getProperties("myheader").hasMoreElements());
+
+            // Invoke render with header
+            InvokeGetResponse render = new InvokeGetResponse(response.createRenderURL().toString());
+            render.addHeader("myheader").addElement("render-value");
+            return render;
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            // Test the header is here
+            Set propertyNames = Tools.toSet(request.getPropertyNames());
+            assertTrue(propertyNames.contains("myheader"));
+            assertEquals("render-value", request.getProperty("myheader"));
+            Enumeration values = request.getProperties("myheader");
+            assertTrue(values.hasMoreElements());
+            assertEquals("render-value", values.nextElement());
+            assertFalse(values.hasMoreElements());
+
+            // Invoke action with header
+            InvokeGetResponse action = new InvokeGetResponse(response.createActionURL().toString());
+            action.addHeader("myheader").addElement("action-value");
+            return action;
+         }
+      });
+
+      seq.addAction(2, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
+         {
+            // Test the header is here
+            Set propertyNames = Tools.toSet(request.getPropertyNames());
+            assertTrue(propertyNames.contains("myheader"));
+            assertEquals("action-value", request.getProperty("myheader"));
+            Enumeration values = request.getProperties("myheader");
+            assertTrue(values.hasMoreElements());
+            assertEquals("action-value", values.nextElement());
+            assertFalse(values.hasMoreElements());
+         }
+      });
+
+      seq.addAction(2, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestParameterTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestParameterTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletrequests/RequestParameterTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * 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.portletrequests;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class RequestParameterTestCase
+{
+   public RequestParameterTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            url.setParameter("foo1", "bar1");
+            url.setParameter("foo2", new String[]{"bar2_1", "bar2_2"});
+            return new InvokeGetResponse(url.toString());
+         }
+      });
+
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
+         {
+            // The expected map
+            Map expectedParameterMap = new HashMap();
+            expectedParameterMap.put("foo1", Tools.toSet(new String[]{"bar1"}));
+            expectedParameterMap.put("foo2", Tools.toSet(new String[]{"bar2_1", "bar2_2"}));
+
+            // Transform the map to be comparable
+            Map parameterMap = new HashMap(request.getParameterMap());
+            for (Iterator i = parameterMap.entrySet().iterator(); i.hasNext();)
+            {
+               Map.Entry entry = (Map.Entry)i.next();
+               String[] values = (String[])entry.getValue();
+               entry.setValue(Tools.toSet(values));
+            }
+
+            // Compare both
+            assertEquals(expectedParameterMap, parameterMap);
+
+            //
+            Set enumeration = Tools.toSet(request.getParameterNames());
+            Set expectedEnumeration = Tools.toSet(new Object[]{"foo1", "foo2"});
+            assertEquals(expectedEnumeration, enumeration);
+         }
+      });
+
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/ContentTypeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/ContentTypeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/ContentTypeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.portletresponses;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ContentTypeTestCase
+{
+   public ContentTypeTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            String responseContentType = request.getResponseContentType();
+            response.setContentType(responseContentType);
+            assertEquals(responseContentType, response.getContentType());
+
+            // Test that character encoding is ignored as specified by the spec in PLT.12.3.1
+            response.setContentType(responseContentType + "; charset=UTF-8");
+            assertEquals(responseContentType, response.getContentType());
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/portletresponses/PortletResponsesSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,67 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.portletresponses;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletResponsesSequenceBuilder extends PortletTestSuite
-{
-   public void createContentTypeCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ContentType", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            String responseContentType = request.getResponseContentType();
-            response.setContentType(responseContentType);
-            assertEquals(responseContentType, response.getContentType());
-
-            // Test that character encoding is ignored as specified by the spec in PLT.12.3.1
-            response.setContentType(responseContentType + "; charset=UTF-8");
-            assertEquals(responseContentType, response.getContentType());
-            return new EndTestResponse();
-         }
-      });
-   }
-
-
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/IsReadOnlyTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/IsReadOnlyTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/IsReadOnlyTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.preferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP2;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletPreferences;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+
+/**
+ * Asserts that isReadOnly() returns correct values during both render and action phase.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class IsReadOnlyTestCase
+{
+   public IsReadOnlyTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            // Get prefs
+            PortletPreferences prefs = request.getPreferences();
+
+            //assert that isReadOnly returns correct values
+            assertEquals(true, prefs.isReadOnly("static_single_pref"));
+            assertEquals(false, prefs.isReadOnly("static_multi_pref"));
+            return new InvokeGetResponse(response.createActionURL().toString());
+         }
+      });
+
+      seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
+         {
+            // Get prefs
+            PortletPreferences prefs = request.getPreferences();
+
+            //assert that isReadOnly returns correct values
+            assertEquals(true, prefs.isReadOnly("static_single_pref"));
+            assertEquals(false, prefs.isReadOnly("static_multi_pref"));
+         }
+      });
+
+      seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/MapTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/MapTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/MapTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,117 @@
+/******************************************************************************
+ * 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.preferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP3;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+import static org.jboss.unit.api.Assert.assertTrue;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.PortletPreferences;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class MapTestCase
+{
+   public MapTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new InvokeGetResponse(response.createActionURL().toString());
+         }
+      });
+
+      seq.addAction(1, UTP3.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException
+         {
+            // Get prefs map
+            PortletPreferences prefs = request.getPreferences();
+            Map map = prefs.getMap();
+
+            //
+            assertEquals(2, map.size());
+            assertTrue(map.containsKey("single_pref"));
+            assertTrue(map.containsValue(new String[]{"single_pref_value"}));
+            assertEquals(new String[]{"single_pref_value"}, (Object[])map.get("single_pref"));
+            assertTrue(map.containsKey("multi_pref"));
+            assertTrue(map.containsValue(new String[]{"multi_pref_value_1", "multi_pref_value_2"}));
+            assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, (Object[])map.get("multi_pref"));
+
+            // Modify prefs
+            prefs.setValue("single_pref", "new_single_pref_value");
+            prefs.setValues("multi_pref", new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
+
+            //
+            map = prefs.getMap();
+            assertEquals(2, map.size());
+            assertTrue(map.containsKey("single_pref"));
+            assertTrue(map.containsValue(new String[]{"new_single_pref_value"}));
+            assertEquals(new String[]{"new_single_pref_value"}, (Object[])map.get("single_pref"));
+            assertTrue(map.containsKey("multi_pref"));
+            assertTrue(map.containsValue(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}));
+            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, (Object[])map.get("multi_pref"));
+
+            // Modify prefs
+            prefs.setValue("single_pref", null);
+            prefs.setValues("multi_pref", null);
+
+            //
+            map = prefs.getMap();
+            assertEquals(2, map.size());
+            assertTrue(map.containsKey("single_pref"));
+            assertTrue(map.containsValue(new String[]{null}));
+            assertEquals(new String[]{null}, (Object[])map.get("single_pref"));
+            assertTrue(map.containsKey("multi_pref"));
+            assertEquals(new String[]{null}, (Object[])map.get("multi_pref"));
+         }
+      });
+
+      seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/PreferencesSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,242 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.preferences;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.portlet.framework.UTP2;
-import org.jboss.portal.test.portlet.framework.UTP4;
-import org.jboss.portal.test.portlet.framework.UTP3;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletURL;
-import javax.portlet.ReadOnlyException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.ValidatorException;
-import java.io.IOException;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PreferencesSequenceBuilder extends PortletTestSuite
-{
-
-   /**
-    * Asserts that isReadOnly() returns correct values during both render and action phase
-    *
-    * @param registry
-    */
-   public void createIsReadOnlyCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("IsReadOnly", seq);
-
-
-      seq.addAction(0, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            // Get prefs
-            PortletPreferences prefs = request.getPreferences();
-
-            //assert that isReadOnly returns correct values
-            assertEquals(true, prefs.isReadOnly("static_single_pref"));
-            assertEquals(false, prefs.isReadOnly("static_multi_pref"));
-            return new InvokeGetResponse(response.createActionURL().toString());
-         }
-      });
-
-      seq.addAction(1, UTP2.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
-         {
-            // Get prefs
-            PortletPreferences prefs = request.getPreferences();
-
-            //assert that isReadOnly returns correct values
-            assertEquals(true, prefs.isReadOnly("static_single_pref"));
-            assertEquals(false, prefs.isReadOnly("static_multi_pref"));
-         }
-      });
-
-      seq.addAction(1, UTP2.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createStoreMustPersistAllChangesCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("StoreMustPersistAllChanges", seq);
-      seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletURL url = response.createActionURL();
-            return new InvokeGetResponse(url.toString());
-         }
-      });
-
-      seq.addAction(1, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException, IOException, ValidatorException
-         {
-            // Get prefs
-            PortletPreferences prefs = request.getPreferences();
-
-            // Check the initial value are good
-            assertEquals("static_single_pref_value", prefs.getValue("static_single_pref", "other"));
-            assertEquals(new String[]{"static_multi_pref_value_1", "static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
-            assertEquals("other", prefs.getValue("dynamic_single_pref", "other"));
-            assertEquals(new String[]{"other"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
-
-            // Set values
-            prefs.setValue("static_single_pref", "new_static_single_pref_value");
-            prefs.setValues("static_multi_pref", new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"});
-            prefs.setValue("dynamic_single_pref", "new_dynamic_single_pref_value");
-            prefs.setValues("dynamic_multi_pref", new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"});
-
-            // Store
-            prefs.store();
-         }
-      });
-
-      seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new InvokeGetResponse(response.createActionURL().toString());
-         }
-      });
-
-      seq.addAction(2, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
-         {
-            // Get prefs
-            PortletPreferences prefs = request.getPreferences();
-
-            // Check the new value are good
-            assertEquals("new_static_single_pref_value", prefs.getValue("static_single_pref", "other"));
-            assertEquals(new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
-            assertEquals("new_dynamic_single_pref_value", prefs.getValue("dynamic_single_pref", "other"));
-            assertEquals(new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
-         }
-      });
-
-      seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   public void createMapCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("Map", seq);
-
-      seq.addAction(0, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new InvokeGetResponse(response.createActionURL().toString());
-         }
-      });
-
-      seq.addAction(1, UTP3.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException
-         {
-            // Get prefs map
-            PortletPreferences prefs = request.getPreferences();
-            Map map = prefs.getMap();
-
-            //
-            assertEquals(2, map.size());
-            assertTrue(map.containsKey("single_pref"));
-            assertTrue(map.containsValue(new String[]{"single_pref_value"}));
-            assertEquals(new String[]{"single_pref_value"}, (Object[])map.get("single_pref"));
-            assertTrue(map.containsKey("multi_pref"));
-            assertTrue(map.containsValue(new String[]{"multi_pref_value_1", "multi_pref_value_2"}));
-            assertEquals(new String[]{"multi_pref_value_1", "multi_pref_value_2"}, (Object[])map.get("multi_pref"));
-
-            // Modify prefs
-            prefs.setValue("single_pref", "new_single_pref_value");
-            prefs.setValues("multi_pref", new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"});
-
-            //
-            map = prefs.getMap();
-            assertEquals(2, map.size());
-            assertTrue(map.containsKey("single_pref"));
-            assertTrue(map.containsValue(new String[]{"new_single_pref_value"}));
-            assertEquals(new String[]{"new_single_pref_value"}, (Object[])map.get("single_pref"));
-            assertTrue(map.containsKey("multi_pref"));
-            assertTrue(map.containsValue(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}));
-            assertEquals(new String[]{"new_multi_pref_value_1", "new_multi_pref_value_2"}, (Object[])map.get("multi_pref"));
-
-            // Modify prefs
-            prefs.setValue("single_pref", null);
-            prefs.setValues("multi_pref", null);
-
-            //
-            map = prefs.getMap();
-            assertEquals(2, map.size());
-            assertTrue(map.containsKey("single_pref"));
-            assertTrue(map.containsValue(new String[]{null}));
-            assertEquals(new String[]{null}, (Object[])map.get("single_pref"));
-            assertTrue(map.containsKey("multi_pref"));
-            assertEquals(new String[]{null}, (Object[])map.get("multi_pref"));
-         }
-      });
-
-      seq.addAction(1, UTP3.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/StoreMustPersistAllChangesTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/StoreMustPersistAllChangesTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/preferences/StoreMustPersistAllChangesTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,120 @@
+/******************************************************************************
+ * 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.preferences;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP4;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+import javax.portlet.PortletPreferences;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class StoreMustPersistAllChangesTestCase
+{
+   public StoreMustPersistAllChangesTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletURL url = response.createActionURL();
+            return new InvokeGetResponse(url.toString());
+         }
+      });
+
+      seq.addAction(1, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws ReadOnlyException, IOException, ValidatorException
+         {
+            // Get prefs
+            PortletPreferences prefs = request.getPreferences();
+
+            // Check the initial value are good
+            assertEquals("static_single_pref_value", prefs.getValue("static_single_pref", "other"));
+            assertEquals(new String[]{"static_multi_pref_value_1", "static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
+            assertEquals("other", prefs.getValue("dynamic_single_pref", "other"));
+            assertEquals(new String[]{"other"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+
+            // Set values
+            prefs.setValue("static_single_pref", "new_static_single_pref_value");
+            prefs.setValues("static_multi_pref", new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"});
+            prefs.setValue("dynamic_single_pref", "new_dynamic_single_pref_value");
+            prefs.setValues("dynamic_multi_pref", new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"});
+
+            // Store
+            prefs.store();
+         }
+      });
+
+      seq.addAction(1, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new InvokeGetResponse(response.createActionURL().toString());
+         }
+      });
+
+      seq.addAction(2, UTP4.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context)
+         {
+            // Get prefs
+            PortletPreferences prefs = request.getPreferences();
+
+            // Check the new value are good
+            assertEquals("new_static_single_pref_value", prefs.getValue("static_single_pref", "other"));
+            assertEquals(new String[]{"new_static_multi_pref_value_1", "new_static_multi_pref_value_2"}, prefs.getValues("static_multi_pref", new String[]{"other"}));
+            assertEquals("new_dynamic_single_pref_value", prefs.getValue("dynamic_single_pref", "other"));
+            assertEquals(new String[]{"new_dynamic_multi_pref_value_1", "new_dynamic_multi_pref_value_2"}, prefs.getValues("dynamic_multi_pref", new String[]{"other"}));
+         }
+      });
+
+      seq.addAction(2, UTP4.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/CrossContextSessionAttributeTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/CrossContextSessionAttributeTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/CrossContextSessionAttributeTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.session;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.ServletServiceTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.test.portlet.framework.UTS1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+import static org.jboss.unit.api.Assert.assertEquals;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+import javax.servlet.Servlet;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+
+/**
+ * The goal is to test that cross context session attributes are set in container and are accessible from the direct
+ * servlet.
+ * <p/>
+ * 1/ portlet put key=value in the http session 2/ portlet ask the client to perform get on /servlet 3/ servlet check
+ * that key=value
+ * 
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class CrossContextSessionAttributeTestCase
+{
+   public CrossContextSessionAttributeTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession();
+            session.setAttribute("key", "value", PortletSession.APPLICATION_SCOPE);
+            String path = request.getContextPath();
+            InvokeGetResponse igr = new InvokeGetResponse(path + "/universalServletA");
+            return igr;
+         }
+      });
+
+      /**
+       * This servlet is normally accessed after that the CrossContextSessionAttributePortlet asked
+       * the client to do it. This portlet should have put in the session an attribute that this servlet
+       * will assert the presence of.
+       */
+      seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
+      {
+         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
+         {
+            HttpSession session = request.getSession();
+            assertEquals("value", session.getAttribute("key"));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/ObtainNonNullSessionUsingCreateEqualsFalseTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.session;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+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.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertEquals;
+import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletSecurityException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class ObtainNonNullSessionUsingCreateEqualsFalseTestCase
+{
+   public ObtainNonNullSessionUsingCreateEqualsFalseTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession();
+            assertNotNull(session);
+            session.setAttribute("foo_1", "bar_1");
+            InvokeGetResponse igr = new InvokeGetResponse(response.createActionURL().toString());
+            return igr;
+         }
+      });
+      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
+      {
+         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, PortletSecurityException, IOException
+         {
+            PortletSession session = request.getPortletSession(false);
+            assertNotNull(session);
+            assertEquals("bar_1", session.getAttribute("foo_1"));
+            session.setAttribute("foo_2", "bar_2");
+         }
+      });
+      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession(false);
+            assertNotNull(session);
+            assertEquals("bar_1", session.getAttribute("foo_1"));
+            assertEquals("bar_2", session.getAttribute("foo_2"));
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionDoesNotExistBeforeItIsRequestedTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionDoesNotExistBeforeItIsRequestedTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionDoesNotExistBeforeItIsRequestedTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.session;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.test.portlet.framework.UTP1;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNull;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.PortletSession;
+
+/**
+ * Test that a session does not exist the first time the portlet is accessed.
+ * 
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class SessionDoesNotExistBeforeItIsRequestedTestCase
+{
+   public SessionDoesNotExistBeforeItIsRequestedTestCase(PortletTest seq)
+   {
+      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            PortletSession session = request.getPortletSession(false);
+            assertNull(session);
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/ext/session/SessionSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,166 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.ext.session;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletActionTestAction;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.actions.ServletServiceTestAction;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.unit.remote.driver.handler.http.response.InvokeGetResponse;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class SessionSequenceBuilder extends PortletTestSuite
-{
-
-   /**
-    * Test that a session does not exist the first time the portlet is accessed.
-    *
-    * @param registry
-    */
-   public void createSessionDoesNotExistBeforeItIsRequested(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("SessionDoesNotExistBeforeItIsRequested", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession(false);
-            assertNull(session);
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * .
-    *
-    * @param registry
-    */
-   public void createObtainNonNullSessionUsingCreateEqualsFalse(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("ObtainNonNullSessionUsingCreateEqualsFalse", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession();
-            assertNotNull(session);
-            session.setAttribute("foo_1", "bar_1");
-            InvokeGetResponse igr = new InvokeGetResponse(response.createActionURL().toString());
-            return igr;
-         }
-      });
-      seq.addAction(1, UTP1.ACTION_JOINPOINT, new PortletActionTestAction()
-      {
-         protected void run(Portlet portlet, ActionRequest request, ActionResponse response, PortletTestContext context) throws PortletException, PortletSecurityException, IOException
-         {
-            PortletSession session = request.getPortletSession(false);
-            assertNotNull(session);
-            assertEquals("bar_1", session.getAttribute("foo_1"));
-            session.setAttribute("foo_2", "bar_2");
-         }
-      });
-      seq.addAction(1, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession(false);
-            assertNotNull(session);
-            assertEquals("bar_1", session.getAttribute("foo_1"));
-            assertEquals("bar_2", session.getAttribute("foo_2"));
-            return new EndTestResponse();
-         }
-      });
-   }
-
-   /**
-    * The goal is to test that cross context session attributes are set in container and are accessible from the direct
-    * servlet.
-    * <p/>
-    * 1/ portlet put key=value in the http session 2/ portlet ask the client to perform get on /servlet 3/ servlet check
-    * that key=value
-    */
-   public void createCrossContextSessionAttributeCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("CrossContextSessionAttribute", seq);
-      seq.addAction(0, UTP1.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            PortletSession session = request.getPortletSession();
-            session.setAttribute("key", "value", PortletSession.APPLICATION_SCOPE);
-            String path = request.getContextPath();
-            InvokeGetResponse igr = new InvokeGetResponse(path + "/universalServletA");
-            return igr;
-         }
-      });
-
-      /**
-       * This servlet is normally accessed after that the CrossContextSessionAttributePortlet asked
-       * the client to do it. This portlet should have put in the session an attribute that this servlet
-       * will assert the presence of.
-       */
-      seq.addAction(1, UTS1.SERVICE_JOINPOINT, new ServletServiceTestAction()
-      {
-         protected DriverResponse run(Servlet servlet, HttpServletRequest request, HttpServletResponse response, PortletTestContext context) throws ServletException, IOException
-         {
-            HttpSession session = request.getSession();
-            assertEquals("value", session.getAttribute("key"));
-            return new EndTestResponse();
-         }
-      });
-
-
-   }
-
-}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/Log4jSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,61 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.misc.log4j;
-
-import org.apache.log4j.Logger;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 5113 $
- */
-public class Log4jSequenceBuilder extends PortletTestSuite
-{
-   public void createLog4j(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TestLog4j", seq);
-      seq.addAction(0, LoggingPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
-      {
-         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
-         {
-            Logger logger = ((LoggingPortlet)portlet).getLogger();
-            assertNotNull(logger);
-            assertTrue("Logger is an instance of " + logger.getClass().getName() + " instead of " + CustomLogger.class.getName(), logger instanceof CustomLogger);
-            return new EndTestResponse();
-         }
-      });
-   }
-}

Added: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/TestLog4jTestCase.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/TestLog4jTestCase.java	                        (rev 0)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/misc/log4j/TestLog4jTestCase.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.misc.log4j;
+
+import org.jboss.portal.test.framework.portlet.PortletTest;
+import org.jboss.portal.test.framework.portlet.PortletTestContext;
+import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
+import org.jboss.portal.unit.annotations.TestCase;
+import org.jboss.unit.driver.DriverResponse;
+import org.jboss.unit.driver.response.EndTestResponse;
+import static org.jboss.unit.api.Assert.assertNotNull;
+import static org.jboss.unit.api.Assert.assertTrue;
+import org.apache.log4j.Logger;
+
+import javax.portlet.Portlet;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+ at TestCase
+public class TestLog4jTestCase
+{
+   public TestLog4jTestCase(PortletTest seq)
+   {
+      seq.addAction(0, LoggingPortlet.RENDER_JOINPOINT, new PortletRenderTestAction()
+      {
+         protected DriverResponse run(Portlet portlet, RenderRequest request, RenderResponse response, PortletTestContext context)
+         {
+            Logger logger = ((LoggingPortlet)portlet).getLogger();
+            assertNotNull(logger);
+            assertTrue("Logger is an instance of " + logger.getClass().getName() + " instead of " + CustomLogger.class.getName(), logger instanceof CustomLogger);
+            return new EndTestResponse();
+         }
+      });
+   }
+}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletconfig/PortletConfigSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,67 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.tck.portletconfig;
-
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-import org.jboss.portal.test.framework.portlet.PortletTestContext;
-import org.jboss.portal.test.framework.portlet.actions.PortletRenderTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesNotInResourceBundlePortlet;
-import org.jboss.portal.test.portlet.jsr168.tck.portletconfig.spec.InlineValuesWithNoResourceBundleDefinedPortlet;
-import org.jboss.unit.driver.response.EndTestResponse;
-import org.jboss.unit.driver.DriverResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletConfig;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletConfigSequenceBuilder extends PortletTestSuite
-{
-   public void createInlineValuesNotInResourceBundle(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("InlineValuesNotInResourceBundle", seq);
-
-   }
-
-   public void createInlineValuesWithNoResourceBundleDefined(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("InlineValuesWithNoResourceBundleDefined", seq);
-
-   }
-
-
-}

Deleted: modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/main/org/jboss/portal/test/portlet/jsr168/tck/portletcontext/PortletContextSequenceBuilder.java	2007-11-07 20:12:31 UTC (rev 8843)
@@ -1,76 +0,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.                   *
- ******************************************************************************/
-package org.jboss.portal.test.portlet.jsr168.tck.portletcontext;
-
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.test.framework.portlet.PortletTest;
-import org.jboss.portal.test.framework.portlet.PortletTestDriver;
-import org.jboss.portal.test.framework.portlet.PortletTestSuite;
-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.ServletServiceTestAction;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestPortlet;
-import org.jboss.portal.test.framework.portlet.components.AbstractUniversalTestServlet;
-import org.jboss.portal.test.portlet.framework.UTP1;
-import org.jboss.portal.test.portlet.framework.UTS1;
-import org.jboss.unit.driver.DriverResponse;
-import org.jboss.unit.driver.response.EndTestResponse;
-
-import static org.jboss.unit.api.Assert.*;
-
-import javax.portlet.Portlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.servlet.Servlet;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-
-/**
- * @author <a href="mailto:boleslaw.dawidowicz at jboss.org">Boleslaw Dawidowicz</a>
- * @version $Revision: 7954 $
- */
-public class PortletContextSequenceBuilder extends PortletTestSuite
-{
-
-
-   /**
-    * @portlet.specification assert="SPEC:46 - "
-    */
-   public void createTempDirCase(PortletTestDriver registry)
-   {
-      PortletTest seq = new PortletTest();
-      registry.addSequence("TempDir", seq);
-   }
-
-
-}

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/dispatcher-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -149,7 +149,7 @@
    </filter-mapping>
 
    <listener>
-         <listener-class>org.jboss.portal.test.portlet.jsr168.ext.dispatcher.DispatcherSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
    <servlet>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/expiringcache-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-         <listener-class>org.jboss.portal.test.portlet.jsr168.ext.expiringcache.ExpiringCacheSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/neverexpiringcache-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-         <listener-class>org.jboss.portal.test.portlet.jsr168.ext.neverexpiringcache.NeverExpiringCacheSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/nocache-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-         <listener-class>org.jboss.portal.test.portlet.jsr168.ext.nocache.NoCacheSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletconfig-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -27,6 +27,6 @@
    "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletconfig.PortletConfigSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletmode-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -27,6 +27,6 @@
    "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletmode.PortletModeSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletrequests-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -27,6 +27,6 @@
    "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletrequests.PortletRequestsSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/portletresponses-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.portletresponses.PortletResponsesSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/preferences-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -27,6 +27,6 @@
    "http://java.sun.com/dtd/web-app_2_3.dtd">
 <web-app>
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.preferences.PreferencesSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 </web-app>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/ext/session-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.ext.session.SessionSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
    <servlet>

Modified: modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml
===================================================================
--- modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml	2007-11-07 20:09:52 UTC (rev 8842)
+++ modules/portlet/trunk/portlet/src/resources/test/jsr168/misc/log4j-war/WEB-INF/web.xml	2007-11-07 20:12:31 UTC (rev 8843)
@@ -28,7 +28,7 @@
 <web-app>
 
    <listener>
-      <listener-class>org.jboss.portal.test.portlet.jsr168.misc.log4j.Log4jSequenceBuilder</listener-class>
+      <listener-class>org.jboss.portal.test.framework.portlet.PortletTestSuite</listener-class>
    </listener>
 
 </web-app>




More information about the portal-commits mailing list