Author: chris.laprun(a)jboss.com
Date: 2007-05-29 18:53:56 -0400 (Tue, 29 May 2007)
New Revision: 7352
Added:
trunk/wsrp/src/resources/tests/test-session-portlet-war/WEB-INF/jboss-portlet.xml
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/portlet/SessionPortlet.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
Log:
- Added ProducerCache interceptor to Producer stack in test WSRP producer to allow for
correct behavior of response processing and CacheControl generation.
- Made SessionPortlet remotable and simplified the markup.
- Improved robustness of markup checking in MarkupTestCase.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/portlet/SessionPortlet.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/portlet/SessionPortlet.java 2007-05-29
19:29:30 UTC (rev 7351)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/portlet/SessionPortlet.java 2007-05-29
22:53:56 UTC (rev 7352)
@@ -56,12 +56,10 @@
count = ((Integer)session.getAttribute(COUNT)).intValue() + 1;
}
session.setAttribute(COUNT, new Integer(count));
- writer.write("<p>");
- writer.write("" + count);
- writer.write("</p>");
+ writer.write("<p>Session id: " + session.getId() +
"</p>");
+ writer.write("<p>count = " + count + "</p>");
+ writer.write("<a href='" + resp.createRenderURL() +
"'>render</a>");
- writer.write("<div><a href=\"" + resp.createRenderURL() +
"\">render</a></div>");
-
//
writer.close();
}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java
===================================================================
---
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2007-05-29
19:29:30 UTC (rev 7351)
+++
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/producer/MarkupTestCase.java 2007-05-29
22:53:56 UTC (rev 7352)
@@ -490,8 +490,9 @@
// Markup context
MarkupContext markupContext = response.getMarkupContext();
ExtendedAssert.assertNotNull(markupContext);
- ExtendedAssert.assertEquals("<p>" + count +
"</p><div><a href=\"wsrp_rewrite?wsrp-urlType=render" +
-
"&wsrp-navigationalState=JBPNS_/wsrp_rewrite\">render</a></div>",
markupContext.getMarkupString());
+ String markupString = markupContext.getMarkupString();
+ ExtendedAssert.assertTrue(markupString.contains("count = " + count));
+ ExtendedAssert.assertTrue(markupString.contains("<a
href='wsrp_rewrite?wsrp-urlType=render&wsrp-navigationalState=JBPNS_/wsrp_rewrite'>render</a>"));
// checking session
checkSessionForCurrentlyDeployedPortlet(response);
Added: trunk/wsrp/src/resources/tests/test-session-portlet-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-session-portlet-war/WEB-INF/jboss-portlet.xml
(rev 0)
+++
trunk/wsrp/src/resources/tests/test-session-portlet-war/WEB-INF/jboss-portlet.xml 2007-05-29
22:53:56 UTC (rev 7352)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE portlet-app PUBLIC "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <portlet>
+ <portlet-name>Session Test Portlet</portlet-name>
+ <remotable>true</remotable>
+ </portlet>
+</portlet-app>
\ No newline at end of file
Modified:
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
---
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-05-29
19:29:30 UTC (rev 7351)
+++
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-05-29
22:53:56 UTC (rev 7352)
@@ -97,6 +97,13 @@
<xmbean/>
</mbean>
<mbean
+ code="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor"
+ name="portal:service=Interceptor,type=Portlet,name=ProducerCache"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
code="org.jboss.portal.server.impl.invocation.JBossInterceptorStackFactory"
name="portal:service=InterceptorStackFactory,type=Container"
xmbean-dd=""
@@ -106,6 +113,7 @@
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ContextDispatcher</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=WindowStates</depends-list-element>
<depends-list-element>portal:service=Interceptor,type=Portlet,name=Modes</depends-list-element>
+
<depends-list-element>portal:service=Interceptor,type=Portlet,name=ProducerCache</depends-list-element>
</depends-list>
</mbean>