portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CDore...@hannaford.com
Subject Re: [ROLLBACK] : Re: svn commit: r554210 - in /portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src: main/java/org/apache/pluto/driver/url/impl/ test/java/org/apache/pluto/driver/url/impl/
Date Sun, 08 Jul 2007 23:24:51 GMT
<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><DIV>David,</DIV><DIV>As you suggested, I did fixed the JDK 1.5 dependancy rather than rollback in SVN revision<STRONG> </STRONG><FONT color=#0000ff size=2><FONT color=#000000>554470</FONT>.<FONT color=#000000> I also found two other classes using String.contains(), which I fixed by substituting a call to String.indexOf() and checking for a non -1 return value.</FONT></FONT><BR><DIV>/Craig<BR><DIV><BR></DIV><FONT color=#990099>-----"David H. DeWolf" &lt;ddewolf@apache.org&gt; wrote: -----<BR><BR></FONT><blockquote style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: cdoremus@apache.org<BR>From: "David H. DeWolf" &lt;ddewolf@apache.org&gt;<BR>Date: 07/08/2007 03:06PM<BR>cc: pluto-scm@portals.apache.org<BR>Subject: [ROLLBACK] : Re: svn commit: r554210 - in /portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src: main/java/org/apache/pluto/driver/url/impl/ test/java/org/apache/pluto/driver/url/impl/<BR><BR><FONT face="Default Monospace,Courier New,Courier,monospace" size=2  >Craig,<BR><BR>Please roll back this commit. &nbsp;The String.contains(CharSequence) method <BR>was not introduced until java 1.5. The 1.1 branch is not supposed to <BR>rely on 1.5.<BR><BR><BR>Of course, if you can fix the 1.5 dependencies without giving up the <BR>included fix, that would be ideal, but 1.4 compat is more important than <BR>the fix.<BR><BR>David<BR><BR>cdoremus@apache.org wrote:<BR>&gt; Author: cdoremus<BR>&gt; Date: Sat Jul &nbsp;7 07:26:31 2007<BR>&gt; New Revision: 554210<BR>&gt; <BR>&gt; URL: <A href="http://svn.apache.org/viewvc?view=rev&amp;rev=554210" target=blank  >http://svn.apache.org/viewvc?view=rev&amp;rev=554210</A><BR>&gt; Log:<BR>&gt; Fix for PLUTO-361. Thank you Marc Veary for the patch! Also applied trunk diffs in PortalURLParserImpl and RelativePortalURLImpl.<BR>&gt; <BR>&gt; Added:<BR>&gt; &nbsp; &nbsp; portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java<BR>&gt; &nbsp; &nbsp; portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java<BR>&gt; Modified:<BR>&gt; &nbsp; &nbsp; portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java<BR>&gt; &nbsp; &nbsp; portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java<BR>&gt; <BR>&gt; Modified: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java<BR>&gt; URL: <A href="http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java?view=diff&amp;rev=554210&amp;r1=554209&amp;r2=554210"   target=blank  >http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java?view=diff&amp;rev=554210&amp;r1=554209&amp;r2=554210</A><BR>&gt; ==============================================================================<BR>&gt; --- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java (original)<BR>&gt; +++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/PortalURLParserImpl.java Sat Jul &nbsp;7 07:26:31 2007<BR>&gt; @@ -104,16 +104,16 @@<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;String servletName = request.getServletPath();<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Construct portal URL using info retrieved from servlet request.<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;PortalURL portalURL = &nbsp;new RelativePortalURLImpl(contextPath, servletName, this);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;PortalURL portalURL =        &nbsp;new RelativePortalURLImpl(contextPath, servletName);<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Support added for filter. &nbsp;Should we seperate into a different impl?<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;String pathInfo = request.getPathInfo();<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (pathInfo == null) {<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(servletName.indexOf(".jsp") &gt; 0 &amp;&amp; !servletName.endsWith(".jsp")) {<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(servletName.contains(".jsp") &amp;&amp; !servletName.endsWith(".jsp")) {<BR>&gt; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;int idx =            servletName.indexOf(".jsp")+".jsp".length();<BR>&gt;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pathInfo =           servletName.substring(idx);<BR>&gt; &nbsp; &nbsp; &nbsp;   &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;servletName =           servletName.substring(0, idx);<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;portalURL = new RelativePortalURLImpl(contextPath, servletName, this);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;portalURL = new RelativePortalURLImpl(contextPath, servletName);<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} else {<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return portalURL;<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; @@ -154,7 +154,16 @@<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>if (st.hasMoreTokens()) {<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>value = st.nextToken();<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>portalURL.addParameter(decodeParameter(token, value));<BR>&gt; +<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// Defect PLUTO-361<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// ADDED<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>PortalURLParameter param =   decodeParameter( token, value );<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>if( param != null )<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>portalURL.addParameter( param );<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// REMOVED<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// portalURL.addParameter(decodeParameter(token, value));<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (renderPath.length() &gt; 0) {<BR>&gt; @@ -249,9 +258,9 @@<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Fix for PLUTO-247 - check if query string contains parameters<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if ( query.length() &gt; 1 ) {<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return buffer.append(query).toString();<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;} else {<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return buffer.toString();<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return buffer.toString();<BR>&gt; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp;private String encodeQueryParam(String param) {<BR>&gt; @@ -350,6 +359,13 @@<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if (LOG.isDebugEnabled()) {<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LOG.debug("Decoding parameter: name=" + name<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>+ ", value=" + value);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;// Defect PLUTO-361<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;// ADDED: if the length is less than this, there is no parameter...<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if( name.length() &lt; (PREFIX + PORTLET_ID).length() )<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>return null;<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// Decode the name into window ID and parameter name.<BR>&gt; <BR>&gt; Modified: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java<BR>&gt; URL: <A href="http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java?view=diff&amp;rev=554210&amp;r1=554209&amp;r2=554210"   target=blank  >http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java?view=diff&amp;rev=554210&amp;r1=554209&amp;r2=554210</A><BR>&gt; ==============================================================================<BR>&gt; --- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java (original)<BR>&gt; +++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/url/impl/RelativePortalURLImpl.java Sat Jul &nbsp;7 07:26:31 2007<BR>&gt; @@ -16,20 +16,18 @@<BR>&gt; &nbsp; */<BR>&gt; &nbsp;package org.apache.pluto.driver.url.impl;<BR>&gt; &nbsp;<BR>&gt; -import java.util.Collection;<BR>&gt; -import java.util.Collections;<BR>&gt; -import java.util.HashMap;<BR>&gt; -import java.util.Iterator;<BR>&gt; -import java.util.Map;<BR>&gt; +import org.apache.pluto.driver.url.PortalURL;<BR>&gt; +import org.apache.pluto.driver.url.PortalURLParameter;<BR>&gt; +import org.apache.commons.logging.Log;<BR>&gt; +import org.apache.commons.logging.LogFactory;<BR>&gt; &nbsp;<BR>&gt; &nbsp;import javax.portlet.PortletMode;<BR>&gt; &nbsp;import javax.portlet.WindowState;<BR>&gt; -<BR>&gt; -import org.apache.commons.logging.Log;<BR>&gt; -import org.apache.commons.logging.LogFactory;<BR>&gt; -import org.apache.pluto.driver.url.PortalURL;<BR>&gt; -import org.apache.pluto.driver.url.PortalURLParameter;<BR>&gt; -import org.apache.pluto.driver.url.PortalURLParser;<BR>&gt; +import java.util.Map;<BR>&gt; +import java.util.HashMap;<BR>&gt; +import java.util.Collection;<BR>&gt; +import java.util.Collections;<BR>&gt; +import java.util.Iterator;<BR>&gt; &nbsp;<BR>&gt; &nbsp;/**<BR>&gt; &nbsp; * The portal URL.<BR>&gt; @@ -41,13 +39,7 @@<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp;private String servletPath;<BR>&gt; &nbsp; &nbsp; &nbsp;private String renderPath;<BR>&gt; - &nbsp; &nbsp;private String actionWindow; &nbsp; &nbsp;<BR>&gt; - &nbsp; &nbsp;<BR>&gt; - &nbsp; &nbsp;/** <BR>&gt; - &nbsp; &nbsp; * PortalURLParser used to construct the string<BR>&gt; - &nbsp; &nbsp; * representation of this portal url.<BR>&gt; - &nbsp; &nbsp; */<BR>&gt; - &nbsp; &nbsp;private PortalURLParser urlParser;<BR>&gt; + &nbsp; &nbsp;private String actionWindow;<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp;/** The window states: key is the window ID, value is WindowState. */<BR>&gt; &nbsp; &nbsp; &nbsp;private Map windowStates = new HashMap();<BR>&gt; @@ -61,14 +53,12 @@<BR>&gt; &nbsp; &nbsp; &nbsp; * Constructs a PortalURLImpl instance using customized port.<BR>&gt; &nbsp; &nbsp; &nbsp; * @param contextPath &nbsp;the servlet context path.<BR>&gt; &nbsp; &nbsp; &nbsp; * @param servletName &nbsp;the servlet name.<BR>&gt; - &nbsp; &nbsp; * @param urlParser &nbsp; &nbsp;the {@link PortalURLParser} used to construct a string representation of the url.<BR>&gt; &nbsp; &nbsp; &nbsp; */<BR>&gt; - &nbsp; &nbsp;public RelativePortalURLImpl(String contextPath, String servletName, PortalURLParser urlParser) {<BR>&gt; + &nbsp; &nbsp;public RelativePortalURLImpl(String contextPath, String servletName) {<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>StringBuffer buffer = new StringBuffer();<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>buffer.append(contextPath);<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>buffer.append(servletName);<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;servletPath =       buffer.toString();<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;this.urlParser = urlParser;<BR>&gt; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp;<BR>&gt; &nbsp; &nbsp; &nbsp;/**<BR>&gt; @@ -167,7 +157,7 @@<BR>&gt; &nbsp; &nbsp; &nbsp; * @see PortalURLParserImpl#toString(org.apache.pluto.driver.url.PortalURL)<BR>&gt; &nbsp; &nbsp; &nbsp; */<BR>&gt; &nbsp; &nbsp; &nbsp;public String toString() {<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;return urlParser.toString(this);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return PortalURLParserImpl.getParser().toString(this);<BR>&gt; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp;<BR>&gt; &nbsp;<BR>&gt; @@ -200,7 +190,6 @@<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>portalURL.windowStates =  new HashMap(windowStates);<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>portalURL.renderPath =  renderPath;<BR>&gt; &nbsp; &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>portalURL.actionWindow =  actionWindow;<BR>&gt; - &nbsp; &nbsp; &nbsp; &nbsp;portalURL.urlParser = urlParser;<BR>&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return portalURL;<BR>&gt; &nbsp; &nbsp; &nbsp;}<BR>&gt; &nbsp;}<BR>&gt; <BR>&gt; Added: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java<BR>&gt; URL: <A href="http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java?view=auto&amp;rev=554210"   target=blank  >http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java?view=auto&amp;rev=554210</A><BR>&gt; ==============================================================================<BR>&gt; --- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java (added)<BR>&gt; +++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/MockHttpServletRequest.java Sat Jul &nbsp;7 07:26:31 2007<BR>&gt; @@ -0,0 +1,621 @@<BR>&gt; +package org.apache.pluto.driver.url.impl;<BR>&gt; +<BR>&gt; +import java.io.BufferedReader;<BR>&gt; +import java.io.IOException;<BR>&gt; +import java.io.UnsupportedEncodingException;<BR>&gt; +import java.security.Principal;<BR>&gt; +import java.util.ArrayList;<BR>&gt; +import java.util.Collections;<BR>&gt; +import java.util.Enumeration;<BR>&gt; +import java.util.HashMap;<BR>&gt; +import java.util.List;<BR>&gt; +import java.util.Locale;<BR>&gt; +import java.util.Map;<BR>&gt; +import java.util.Vector;<BR>&gt; +<BR>&gt; +import javax.servlet.RequestDispatcher;<BR>&gt; +import javax.servlet.ServletInputStream;<BR>&gt; +import javax.servlet.http.Cookie;<BR>&gt; +import javax.servlet.http.HttpServletRequest;<BR>&gt; +import javax.servlet.http.HttpSession;<BR>&gt; +<BR>&gt; +/**<BR>&gt; + * Copied from mockrunner 0.3.8<BR>&gt; + * Mock implementation of &lt;code&gt;HttpServletRequest&lt;/code&gt;.<BR>&gt; + */<BR>&gt; +public class MockHttpServletRequest implements HttpServletRequest<BR>&gt; +{<BR>&gt; + &nbsp; &nbsp;private Map attributes;<BR>&gt; + &nbsp; &nbsp;private Map parameters;<BR>&gt; + &nbsp; &nbsp;private Vector locales;<BR>&gt; + &nbsp; &nbsp;private Map requestDispatchers;<BR>&gt; + &nbsp; &nbsp;private HttpSession session;<BR>&gt; + &nbsp; &nbsp;private String method;<BR>&gt; + &nbsp; &nbsp;private String authType;<BR>&gt; + &nbsp; &nbsp;private Map headers;<BR>&gt; + &nbsp; &nbsp;private String contextPath;<BR>&gt; + &nbsp; &nbsp;private String pathInfo;<BR>&gt; + &nbsp; &nbsp;private String pathTranslated;<BR>&gt; + &nbsp; &nbsp;private String queryString;<BR>&gt; + &nbsp; &nbsp;private StringBuffer requestUrl;<BR>&gt; + &nbsp; &nbsp;private String requestUri;<BR>&gt; + &nbsp; &nbsp;private String servletPath;<BR>&gt; + &nbsp; &nbsp;private Principal principal;<BR>&gt; + &nbsp; &nbsp;private String remoteUser;<BR>&gt; + &nbsp; &nbsp;private boolean requestedSessionIdIsFromCookie;<BR>&gt; + &nbsp; &nbsp;private String protocol;<BR>&gt; + &nbsp; &nbsp;private String serverName;<BR>&gt; + &nbsp; &nbsp;private int serverPort;<BR>&gt; + &nbsp; &nbsp;private String scheme;<BR>&gt; + &nbsp; &nbsp;private String remoteHost;<BR>&gt; + &nbsp; &nbsp;private String remoteAddr;<BR>&gt; + &nbsp; &nbsp;private Map roles;<BR>&gt; + &nbsp; &nbsp;private String characterEncoding;<BR>&gt; + &nbsp; &nbsp;private int contentLength;<BR>&gt; + &nbsp; &nbsp;private String contentType;<BR>&gt; + &nbsp; &nbsp;private List cookies;<BR>&gt; + &nbsp; &nbsp;private String localAddr;<BR>&gt; + &nbsp; &nbsp;private String localName;<BR>&gt; + &nbsp; &nbsp;private int localPort;<BR>&gt; + &nbsp; &nbsp;private int remotePort;<BR>&gt; + &nbsp; &nbsp;private boolean sessionCreated;<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public MockHttpServletRequest()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;resetAll();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;/**<BR>&gt; + &nbsp; &nbsp; * Resets the state of this object to the default values<BR>&gt; + &nbsp; &nbsp; */<BR>&gt; + &nbsp; &nbsp;public void resetAll()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.attributes = new HashMap();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.parameters = new HashMap();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.locales = new Vector();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.requestDispatchers = new HashMap();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.method = "GET";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;headers = new HashMap();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;requestedSessionIdIsFromCookie = true;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;protocol = "HTTP/1.1";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;serverName = "localhost";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;serverPort = 8080;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;scheme = "http";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;remoteHost =       "localhost";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;remoteAddr = "127.0.0.1";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;roles = new HashMap();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;contentLength = -1;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;cookies = new ArrayList();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;localAddr = "127.0.0.1";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;localName =       "localhost";<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;localPort = 8080;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;remotePort = 5000;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;sessionCreated = false;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getParameter(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;String[] values = getParameterValues(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if (null != values &amp;&amp; 0 &lt; values.length)<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return values[0];<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return null;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void clearParameters()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;parameters.clear();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String[] getParameterValues(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return (String[])parameters.get(key);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setupAddParameter(String key, String[] values)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;parameters.put(key, values);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setupAddParameter(String key, String value)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;setupAddParameter(key, new String[] { value });<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Enumeration getParameterNames()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Vector parameterKeys =        new Vector(parameters.keySet());<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return parameterKeys.elements();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Map getParameterMap()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return Collections.unmodifiableMap(parameters);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void clearAttributes()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;attributes.clear();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Object getAttribute(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return attributes.get(key);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Enumeration getAttributeNames()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Vector attKeys = new Vector(attributes.keySet());<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return attKeys.elements();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void removeAttribute(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Object value = attributes.get(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;attributes.remove(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null != value)<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//callAttributeListenersRemovedMethod(key, value);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setAttribute(String key, Object value)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;Object oldValue =        attributes.get(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == value)<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;attributes.remove(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;else<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;attributes.put(key, value);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;//handleAttributeListenerCalls(key, value, oldValue);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public HttpSession getSession()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;sessionCreated =       true;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return session; <BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public HttpSession getSession(boolean create)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(!create &amp;&amp; !sessionCreated) return null;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return getSession();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setSession(HttpSession session) <BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.session = session; &nbsp; <BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public RequestDispatcher getRequestDispatcher(String path)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>return null;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;/**<BR>&gt; + &nbsp; &nbsp; * Returns the map of &lt;code&gt;RequestDispatcher&lt;/code&gt; objects. The specified path<BR>&gt; + &nbsp; &nbsp; * maps to the corresponding &lt;code&gt;RequestDispatcher&lt;/code&gt; object.<BR>&gt; + &nbsp; &nbsp; * @return the map of &lt;code&gt;RequestDispatcher&lt;/code&gt; objects<BR>&gt; + &nbsp; &nbsp; */<BR>&gt; + &nbsp; &nbsp;public Map getRequestDispatcherMap()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return Collections.unmodifiableMap(requestDispatchers);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;/**<BR>&gt; + &nbsp; &nbsp; * Clears the map of &lt;code&gt;RequestDispatcher&lt;/code&gt; objects. <BR>&gt; + &nbsp; &nbsp; */<BR>&gt; + &nbsp; &nbsp;public void clearRequestDispatcherMap()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;requestDispatchers.clear();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRequestDispatcher(String path, RequestDispatcher dispatcher)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public Locale getLocale()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(locales.size() &lt; 1) return Locale.getDefault();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return (Locale)locales.get(0);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Enumeration getLocales()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return locales.elements();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void addLocale(Locale locale)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;locales.add(locale);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void addLocales(List localeList)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;locales.addAll(localeList);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getMethod()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return method;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setMethod(String method)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.method = method;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getAuthType()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return authType;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setAuthType(String authType)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.authType = authType;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public long getDateHeader(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>return -1;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getHeader(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;List headerList = (List)headers.get(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == headerList || 0 == headerList.size()) return null;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return (String)headerList.get(0);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Enumeration getHeaderNames()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return new Vector(headers.keySet()).elements();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Enumeration getHeaders(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;List headerList = (List)headers.get(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == headerList) return null;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return new Vector(headerList).elements();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public int getIntHeader(String key)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;String header = getHeader(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == header) return -1;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return new Integer(header).intValue();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void addHeader(String key, String value)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;List valueList = (List) headers.get(key);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if (null == valueList)<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;valueList = new ArrayList();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;headers.put(key, valueList);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;valueList.add(value);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setHeader(String key, String value)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;List valueList = new ArrayList();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;headers.put(key, valueList);<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;valueList.add(value);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void clearHeaders()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;headers.clear();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getContextPath()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return contextPath;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setContextPath(String contextPath)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.contextPath =       contextPath;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getPathInfo()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return pathInfo;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setPathInfo(String pathInfo)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.pathInfo = pathInfo;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getPathTranslated()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return pathTranslated;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setPathTranslated(String pathTranslated)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.pathTranslated =       pathTranslated;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getQueryString()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return queryString;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setQueryString(String queryString)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.queryString = queryString;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getRequestURI()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return requestUri;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRequestURI(String requestUri)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.requestUri = requestUri;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public StringBuffer getRequestURL()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return requestUrl;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRequestURL(String requestUrl)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.requestUrl = new StringBuffer(requestUrl);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getServletPath()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return servletPath;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setServletPath(String servletPath)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.servletPath = servletPath;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public Principal getUserPrincipal()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return principal;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setUserPrincipal(Principal principal)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.principal = principal;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getRemoteUser()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return remoteUser;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setRemoteUser(String remoteUser)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.remoteUser = remoteUser;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public Cookie[] getCookies()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return (Cookie[])cookies.toArray(new Cookie[cookies.size()]);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void addCookie(Cookie cookie)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;cookies.add(cookie);<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getRequestedSessionId()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;HttpSession session =        getSession();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == session) return null;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return session.getId();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public boolean isRequestedSessionIdFromCookie()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return requestedSessionIdIsFromCookie;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public boolean isRequestedSessionIdFromUrl()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return isRequestedSessionIdFromURL();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public boolean isRequestedSessionIdFromURL()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return !requestedSessionIdIsFromCookie;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRequestedSessionIdFromCookie(boolean requestedSessionIdIsFromCookie)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp;   &nbsp; &nbsp; &nbsp;this.requestedSessionIdIsFromCookie =       requestedSessionIdIsFromCookie;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public boolean isRequestedSessionIdValid()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;HttpSession session = getSession();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == session) return false;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return true;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public boolean isUserInRole(String role)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return ((Boolean)roles.get(role)).booleanValue();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setUserInRole(String role, boolean isInRole)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;roles.put(role, new Boolean(isInRole));<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getCharacterEncoding()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return characterEncoding;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setCharacterEncoding(String characterEncoding) throws UnsupportedEncodingException<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.characterEncoding =       characterEncoding;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public int getContentLength()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return contentLength;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setContentLength(int contentLength)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.contentLength = contentLength;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getContentType()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return contentType;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setContentType(String contentType)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.contentType = contentType;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getProtocol()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return protocol;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setProtocol(String protocol)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.protocol =       protocol;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getServerName()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return serverName;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setServerName(String serverName)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.serverName = serverName;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public int getServerPort()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return serverPort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setServerPort(int serverPort)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.serverPort =       serverPort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getScheme()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return scheme;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setScheme(String scheme)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.scheme = scheme;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getRemoteAddr()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return remoteAddr;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRemoteAddr(String remoteAddr)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.remoteAddr = remoteAddr;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getRemoteHost()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return remoteHost;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setRemoteHost(String remoteHost)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.remoteHost =       remoteHost;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public BufferedReader getReader() throws IOException<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return null;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public ServletInputStream getInputStream() throws IOException<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return null;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setBodyContent(byte[] data)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setBodyContent(String bodyContent)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getRealPath(String path)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;HttpSession session = getSession();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == session) return null;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return session.getServletContext().getRealPath(path);<BR>&gt; + &nbsp; &nbsp;} <BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public boolean isSecure()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;String scheme = getScheme();<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;if(null == scheme) return false;<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return scheme.equals("https");<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public String getLocalAddr()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return localAddr;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setLocalAddr(String localAddr)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.localAddr = localAddr;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public String getLocalName()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return localName;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setLocalName(String localName)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.localName = localName;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public int getLocalPort()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return localPort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; + &nbsp; &nbsp;<BR>&gt; + &nbsp; &nbsp;public void setLocalPort(int localPort)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.localPort = localPort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public int getRemotePort()<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;return remotePort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;public void setRemotePort(int remotePort)<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp; &nbsp; &nbsp;this.remotePort = remotePort;<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +}<BR>&gt; <BR>&gt; Added: portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java<BR>&gt; URL: <A href="http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java?view=auto&amp;rev=554210"   target=blank  >http://svn.apache.org/viewvc/portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java?view=auto&amp;rev=554210</A><BR>&gt; ==============================================================================<BR>&gt; --- portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java (added)<BR>&gt; +++ portals/pluto/branches/pluto-1.1.x/pluto-portal-driver-impl/src/test/java/org/apache/pluto/driver/url/impl/TestPortalURLParser.java Sat Jul &nbsp;7 07:26:31 2007<BR>&gt; @@ -0,0 +1,64 @@<BR>&gt; +package org.apache.pluto.driver.url.impl;<BR>&gt; +<BR>&gt; +import junit.framework.TestCase;<BR>&gt; +<BR>&gt; +import org.apache.commons.logging.Log;<BR>&gt; +import org.apache.commons.logging.LogFactory;<BR>&gt; +import org.apache.pluto.driver.url.PortalURL;<BR>&gt; +import org.apache.pluto.driver.url.PortalURLParser;<BR>&gt; +<BR>&gt; +/**<BR>&gt; + * TestPortalURLParser.java<BR>&gt; + * Unit Test for Defect PLUTO-361<BR>&gt; + */<BR>&gt; +public class TestPortalURLParser extends TestCase<BR>&gt; +{<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>private static final Log LOG = LogFactory.getLog( TestPortalURLParser.class );<BR>&gt; +<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>private PortalURLParser parser;<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>private MockHttpServletRequest request;<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>private Throwable throwable = null;<BR>&gt; +<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>public void test_DefectPLUTO_361()<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// This is a well formed request.<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request = new MockHttpServletRequest();<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setContextPath( "/pluto" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setRequestURI( "/pluto/portal//Test%20Page/__ac0x3testsuite0x2TestPortlet1!764587357|0" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setRequestURL( "<A href="http://localhost:8080/pluto/portal//Test%20Page/__ac0x3testsuite0x2TestPortlet1!764587357|0"   target=blank  >http://localhost:8080/pluto/portal//Test%20Page/__ac0x3testsuite0x2TestPortlet1!764587357|0</A>" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN> this.request.setQueryString("testId=0&amp;org.apache.pluto.testsuite.PARAM_ACTION_KEY=org.apache.pluto.testsuite.ACTION_VALUE" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setPathInfo( "/Test Page/__ac0x3testsuite0x2TestPortlet1!764587357|0" );<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>try<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>PortalURL portalURL =   this.parser.parse( this.request );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>} catch( Throwable t ) {<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.throwable = t;<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>LOG.error( "ERROR:", t );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>assertNull( "No exception should be thrown", this.throwable );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.throwable = null;<BR>&gt; +<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>// Not so well formed request as per defect PLUTO-361<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request = new MockHttpServletRequest();<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setContextPath( "/pluto" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setRequestURI( "/pluto/portal/__" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setRequestURL( "<A href="http://localhost:8080/pluto/portal/__" target=blank  >http://localhost:8080/pluto/portal/__</A>" );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.request.setPathInfo( "/__" );<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>try<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>PortalURL portalURL =   this.parser.parse( this.request );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>} catch( Throwable t ) {<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.throwable = t;<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>LOG.error( "ERROR:", t );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>assertNull( "No exception should be thrown", this.throwable );<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.throwable = null;<BR>&gt; +<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}<BR>&gt; +<BR>&gt; + &nbsp; &nbsp;protected void setUp() throws Exception<BR>&gt; + &nbsp; &nbsp;{<BR>&gt; + &nbsp; &nbsp;<SPAN style="VISIBILITY: hidden">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>this.parser =  PortalURLParserImpl.getParser();<BR>&gt; + &nbsp; &nbsp;}<BR>&gt; +}<BR>&gt; <BR>&gt; <BR>&gt; <BR></FONT></blockquote><br></DIV></DIV></FONT>
Mime
View raw message