[jboss-cvs] jboss-portal/test/src/main/org/jboss/portal/test/framework/container/result ...
Julien Viet
julien at jboss.com
Sun Aug 20 18:53:51 EDT 2006
User: julien
Date: 06/08/20 18:53:51
Modified: test/src/main/org/jboss/portal/test/framework/container/result
Tag: JBoss_Portal_Branch_2_4 InvokeGetResult.java
Log:
backport of JBPORTAL-984 to 2.4.1 : Provice access to HTTP headers in request dispatch to a servlet from a portlet.
Revision Changes Path
No revision
No revision
1.1.2.1 +24 -6 jboss-portal/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: InvokeGetResult.java
===================================================================
RCS file: /cvsroot/jboss/jboss-portal/test/src/main/org/jboss/portal/test/framework/container/result/InvokeGetResult.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -b -r1.1 -r1.1.2.1
--- InvokeGetResult.java 22 Apr 2006 17:43:13 -0000 1.1
+++ InvokeGetResult.java 20 Aug 2006 22:53:51 -0000 1.1.2.1
@@ -24,25 +24,34 @@
import org.jboss.portal.test.framework.container.client.command.DoGetCommand;
import org.jboss.portal.test.framework.container.client.command.ClientCommand;
+import java.util.Map;
+import java.util.HashMap;
+
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @author <a href="mailto:boleslaw.dawidowicz at jboss.com">Boleslaw Dawidowicz</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.1.2.1 $
*/
public class InvokeGetResult extends Result
{
/** The serialVersionUID */
private static final long serialVersionUID = 5968471624915140976L;
+
+ /** . */
private String url;
- public InvokeGetResult()
- {
- }
+ /** . */
+ private Map headers;
public InvokeGetResult(String url)
{
+ if (url == null)
+ {
+ throw new IllegalArgumentException("Cannot invoke against a null URL");
+ }
this.url = url;
+ this.headers = new HashMap();
}
public String getURL()
@@ -50,14 +59,23 @@
return url;
}
- public void setURL(String url)
+ public void setHeader(String headerName, String headerValue)
{
- this.url = url;
+ if (headerName == null)
+ {
+ throw new IllegalArgumentException("No null header name accepted");
+ }
+ if (headerValue == null)
+ {
+ throw new IllegalArgumentException("No null header value accepted");
+ }
+ headers.put(headerName, headerValue);
}
public ClientCommand createCommand()
{
- return new DoGetCommand(url);
+ DoGetCommand dgc = new DoGetCommand(url, headers);
+ return dgc;
}
public String toString()
More information about the jboss-cvs-commits
mailing list