org.apache.commons.cactus.util
Class AssertUtils
java.lang.Object
|
+--org.apache.commons.cactus.util.AssertUtils
- public class AssertUtils
- extends java.lang.Object
Cactus utility classes to help assert returned results from server side
code.
- Version:
- 1.1
Method Summary |
static java.util.Hashtable |
getCookies(java.net.HttpURLConnection theConnection)
Extract the cookies from a HTTP connection. |
static java.lang.String |
getResponseAsString(java.net.HttpURLConnection theConnection)
|
static java.lang.String[] |
getResponseAsStringArray(java.net.HttpURLConnection theConnection)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AssertUtils
public AssertUtils()
getResponseAsString
public static java.lang.String getResponseAsString(java.net.HttpURLConnection theConnection)
throws java.io.IOException
- Parameters:
theConnection
- the connection object used to connect to the server
redirector.- Returns:
- the servlet output stream bytes as a string.
getResponseAsStringArray
public static java.lang.String[] getResponseAsStringArray(java.net.HttpURLConnection theConnection)
throws java.io.IOException
- Parameters:
theConnection
- the connection object used to connect to the server
redirector.- Returns:
- the servlet output stream bytes as an array of string (each
string is a separate line from the output stream).
getCookies
public static java.util.Hashtable getCookies(java.net.HttpURLConnection theConnection)
- Extract the cookies from a HTTP connection.
- Parameters:
theConnection
- the HTTP connection from which to extract server
returned cookies.- Returns:
- a hashtable of
ClientCookie
objects.
Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.