Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.httpServerTest.common
Class HttpResponseObject  view HttpResponseObject download HttpResponseObject.java

java.lang.Object
  extended byorg.enhydra.httpServerTest.common.HttpResponseObject

public class HttpResponseObject
extends java.lang.Object

This class is the data structure that is shared between the client and server tests. The life cycle of this class begins when a client thread's run() method is invoked. The first step in each of the SingleUserGetRequestThread and SingleUserPostRequestThread is to initialize a golden response object of this type from the thread's supplied configuration data. On success of this initialization, each of these threads construct an HTTP request also based on its configuration data. The request is sent to the server which then generates a new object of this type populated with all the request information sent from the client. This object's toString() method is then called by the server and the output, a valid XML structure based on the data populated by the server and validated againt HttpResponseObject.dtd, is returned to the client. The client then parses the response (the XML structure) and does an equal() comparison between the golden response object initialized earlier and the resulting object (from parsing the XML response). If these objects are equal, the process begins again starting with issueing a new request. If these objects are not equal, an assertion is logged by the client thread and, again, the process is repeated with issueing a new request. This structure represents the data returned from the servlet request api and the relationship between its getter methods and the data members held here pretty much match one-to-one.


Field Summary
 java.lang.String authType
          Response object variables.
static java.lang.String BEGIN_ELEMENT_TAG
          Thes are common syntax tags used for constructing XML elements.
static java.lang.String CGI_ARG_ELEMENT
          Static CgiArg element tag and its attributes.
static java.lang.String CGI_ARG_NAME_ATTR
           
static java.lang.String CGI_ARG_VALUE_ATTR
           
static java.lang.String CGI_PARAM_ELEMENT
          Static CgiParam element tag and its attributes.
static java.lang.String CGI_PARAM_NAME_ATTR
           
static java.lang.String CGI_PARAM_VALUE_ATTR
           
 java.util.Hashtable cgiArgs
           
 java.util.Hashtable cgiParams
           
static java.lang.String COOKIE_ELEMENT
          Static Cookie element tag and its attributes.
static java.lang.String COOKIE_NAME_ATTR
           
static java.lang.String COOKIE_VALUE_ATTR
           
 java.util.Hashtable cookies
           
static boolean DEFAULT_SEESION_ID_FROM_COOKIE
           
static java.lang.String DEFAULT_SESSION
          Static default or implied values for element attributes.
static boolean DEFAULT_SESSION_ID_FROM_URL
           
static boolean DEFAULT_SESSION_ID_INVALID
           
static java.lang.String END_ELEMENT_TAG
           
static java.lang.String END_EMPTY_ELEMENT_TAG
           
static java.lang.String END_PCDATA_ELEMENT_TAG
           
static java.lang.String FILE_UPLOAD_ELEMENT
          Static FileUpload element tag and its attributes.
static java.lang.String FILE_UPLOAD_MD5_HASH_KEY_ATTR
           
static java.lang.String HEADER_ELEMENT
          Static Header element tag and its attributes.
static java.lang.String HEADER_NAME_ATTR
           
static java.lang.String HEADER_VALUE_ATTR
           
 java.util.Hashtable headers
           
static java.lang.String HTTP_REQUEST_INFO_AUTH_TYPE_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_ELEMENT
          Static HttpRequestIngo element tag and its attributes.
static java.lang.String HTTP_REQUEST_INFO_METHOD_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_PATH_INFO_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_PATH_TRANSLATED_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_QUERY_STRING_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_REMOTE_USER_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_REQUEST_URI_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_SERVLET_PATH_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_SESSION_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_SESSION_ID_FROM_COOKIE_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_SESSION_ID_FROM_URL_ATTR
           
static java.lang.String HTTP_REQUEST_INFO_SESSION_ID_INVALID_ATTR
           
static java.lang.String HTTP_RESPONSE_OBJ_ELEMENT
          Static HttpResponseObject element tag.
static java.lang.String HTTP_RESPONSE_OBJECT_DTD
          This holds the location of the DTD used to validate the XML structure returned by this class's toString() method.
 java.util.Vector md5HashKey
           
 java.lang.String method
           
 java.lang.String pathInfo
           
 java.lang.String pathTranslated
           
 java.lang.String queryString
           
 java.lang.String remoteUser
           
 java.lang.String requestURI
           
 java.lang.String servletPath
           
 java.lang.String session
           
 boolean sessionIdFromCookie
           
 boolean sessionIdFromURL
           
 boolean sessionIdInvalid
           
static java.lang.String XML_DOCTYPE_STRING_BEGIN
          Static XML document type tag.
static java.lang.String XML_DOCTYPE_STRING_END
           
static java.lang.String XML_HEADER_STRING
          Static XML header tag.
 
Constructor Summary
HttpResponseObject()
           
 
Method Summary
 boolean equals(java.lang.Object object)
          This function overrides the default equals method to provide a detailed comparison of each data member held within this object.
 java.lang.String[] getCgiArgStrings()
          This is a convenience function to format and return valid XML representing all the CGI arguments held in this object.
 java.lang.String[] getCgiParamStrings()
          This is a convenience function to format and return valid XML representing all the CGI parameters held in this object.
 java.lang.String[] getCookieStrings()
          This is a convenience function to format and return valid XML representing all the cookies held in this object.
 java.lang.String[] getFileUploadStrings()
          This is a convenience function to format and return valid XML representing all the file uploads held in this object.
 java.lang.String[] getHeaderStrings()
          This is a convenience function to format and return valid XML representing all the headers held in this object.
 java.lang.String[] getHttpRequestInfoStrings()
          This is a convenience function to format and return valid XML representing the HttpRequestInfo element and all its attributes.
 java.lang.String[] getHttpResponseObjectStrings()
          This is a convenience function to format and return valid XML representing the HttpResponseObject element and all its attributes.
 boolean testHashtables(java.util.Hashtable hashTable1, java.util.Hashtable hashTable2)
          This is a conviencce function to test the equality of two hashtables.
 boolean testPathInfo(java.lang.String pathInfoString1, java.lang.String pathInfoString2)
          This is a convenience function to split the path information strings into a token set and then check that each token in the first string is also in the second string.
 boolean testQueryString(java.lang.String queryString1, java.lang.String queryString2)
          This is a convenience function to split the query string strings into a token set and then check that each token in the first string is also in the second string.
 boolean testRequestURI(java.lang.String uriString1, java.lang.String uriString2)
          This is a convenience function to split the request URI strings into a token set and then check that each token in the first string is also in the second string.
 boolean testStringNulls(java.lang.String string1, java.lang.String string2)
          This is a convenience function fro testing the equality of two possibly null strings.
 boolean testStringTokens(java.util.StringTokenizer tokens1, java.util.StringTokenizer tokens2)
          This is a conviencce function to test the equality of two token sets.
 boolean testVectors(java.util.Vector vector1, java.util.Vector vector2)
          This is a conviencce function to test the equality of two vectors.
 java.lang.String toString()
          This function overrides the default toString method to generate a valid XML structure based on data held within this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XML_HEADER_STRING

public static final java.lang.String XML_HEADER_STRING
Static XML header tag.

See Also:
for details, Constant Field Values

HTTP_RESPONSE_OBJECT_DTD

public static java.lang.String HTTP_RESPONSE_OBJECT_DTD
This holds the location of the DTD used to validate the XML structure returned by this class's toString() method. This value should be set before calling toString().


XML_DOCTYPE_STRING_BEGIN

public static java.lang.String XML_DOCTYPE_STRING_BEGIN
Static XML document type tag. This is the DTD reference used for validity checks.

See Also:
for details

XML_DOCTYPE_STRING_END

public static java.lang.String XML_DOCTYPE_STRING_END

BEGIN_ELEMENT_TAG

public static final java.lang.String BEGIN_ELEMENT_TAG
Thes are common syntax tags used for constructing XML elements.

See Also:
for details, Constant Field Values

END_ELEMENT_TAG

public static final java.lang.String END_ELEMENT_TAG
See Also:
Constant Field Values

END_EMPTY_ELEMENT_TAG

public static final java.lang.String END_EMPTY_ELEMENT_TAG
See Also:
Constant Field Values

END_PCDATA_ELEMENT_TAG

public static final java.lang.String END_PCDATA_ELEMENT_TAG
See Also:
Constant Field Values

HTTP_RESPONSE_OBJ_ELEMENT

public static final java.lang.String HTTP_RESPONSE_OBJ_ELEMENT
Static HttpResponseObject element tag.

See Also:
for details, Constant Field Values

HTTP_REQUEST_INFO_ELEMENT

public static final java.lang.String HTTP_REQUEST_INFO_ELEMENT
Static HttpRequestIngo element tag and its attributes.

See Also:
for details, Constant Field Values

HTTP_REQUEST_INFO_AUTH_TYPE_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_AUTH_TYPE_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_METHOD_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_METHOD_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_PATH_INFO_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_PATH_INFO_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_PATH_TRANSLATED_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_PATH_TRANSLATED_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_QUERY_STRING_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_QUERY_STRING_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_REMOTE_USER_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_REMOTE_USER_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_REQUEST_URI_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_REQUEST_URI_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_SERVLET_PATH_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_SERVLET_PATH_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_SESSION_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_SESSION_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_SESSION_ID_FROM_COOKIE_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_SESSION_ID_FROM_COOKIE_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_SESSION_ID_FROM_URL_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_SESSION_ID_FROM_URL_ATTR
See Also:
Constant Field Values

HTTP_REQUEST_INFO_SESSION_ID_INVALID_ATTR

public static final java.lang.String HTTP_REQUEST_INFO_SESSION_ID_INVALID_ATTR
See Also:
Constant Field Values

CGI_PARAM_ELEMENT

public static final java.lang.String CGI_PARAM_ELEMENT
Static CgiParam element tag and its attributes.

See Also:
for details, Constant Field Values

CGI_PARAM_NAME_ATTR

public static final java.lang.String CGI_PARAM_NAME_ATTR
See Also:
Constant Field Values

CGI_PARAM_VALUE_ATTR

public static final java.lang.String CGI_PARAM_VALUE_ATTR
See Also:
Constant Field Values

CGI_ARG_ELEMENT

public static final java.lang.String CGI_ARG_ELEMENT
Static CgiArg element tag and its attributes.

See Also:
for details, Constant Field Values

CGI_ARG_NAME_ATTR

public static final java.lang.String CGI_ARG_NAME_ATTR
See Also:
Constant Field Values

CGI_ARG_VALUE_ATTR

public static final java.lang.String CGI_ARG_VALUE_ATTR
See Also:
Constant Field Values

HEADER_ELEMENT

public static final java.lang.String HEADER_ELEMENT
Static Header element tag and its attributes.

See Also:
for details, Constant Field Values

HEADER_NAME_ATTR

public static final java.lang.String HEADER_NAME_ATTR
See Also:
Constant Field Values

HEADER_VALUE_ATTR

public static final java.lang.String HEADER_VALUE_ATTR
See Also:
Constant Field Values

COOKIE_ELEMENT

public static final java.lang.String COOKIE_ELEMENT
Static Cookie element tag and its attributes.

See Also:
for details, Constant Field Values

COOKIE_NAME_ATTR

public static final java.lang.String COOKIE_NAME_ATTR
See Also:
Constant Field Values

COOKIE_VALUE_ATTR

public static final java.lang.String COOKIE_VALUE_ATTR
See Also:
Constant Field Values

FILE_UPLOAD_ELEMENT

public static final java.lang.String FILE_UPLOAD_ELEMENT
Static FileUpload element tag and its attributes.

See Also:
for details, Constant Field Values

FILE_UPLOAD_MD5_HASH_KEY_ATTR

public static final java.lang.String FILE_UPLOAD_MD5_HASH_KEY_ATTR
See Also:
Constant Field Values

DEFAULT_SESSION

public static final java.lang.String DEFAULT_SESSION
Static default or implied values for element attributes.

See Also:
for details

DEFAULT_SEESION_ID_FROM_COOKIE

public static final boolean DEFAULT_SEESION_ID_FROM_COOKIE
See Also:
Constant Field Values

DEFAULT_SESSION_ID_FROM_URL

public static final boolean DEFAULT_SESSION_ID_FROM_URL
See Also:
Constant Field Values

DEFAULT_SESSION_ID_INVALID

public static final boolean DEFAULT_SESSION_ID_INVALID
See Also:
Constant Field Values

authType

public java.lang.String authType
Response object variables.


method

public java.lang.String method

pathInfo

public java.lang.String pathInfo

pathTranslated

public java.lang.String pathTranslated

queryString

public java.lang.String queryString

remoteUser

public java.lang.String remoteUser

requestURI

public java.lang.String requestURI

servletPath

public java.lang.String servletPath

session

public java.lang.String session

sessionIdFromCookie

public boolean sessionIdFromCookie

sessionIdFromURL

public boolean sessionIdFromURL

sessionIdInvalid

public boolean sessionIdInvalid

cgiParams

public java.util.Hashtable cgiParams

cgiArgs

public java.util.Hashtable cgiArgs

headers

public java.util.Hashtable headers

cookies

public java.util.Hashtable cookies

md5HashKey

public java.util.Vector md5HashKey
Constructor Detail

HttpResponseObject

public HttpResponseObject()
Method Detail

toString

public java.lang.String toString()
This function overrides the default toString method to generate a valid XML structure based on data held within this object. The generated structure is valid against HttpResponseObject.dtd and is the stream that is sent back from the server to the client.


equals

public boolean equals(java.lang.Object object)
This function overrides the default equals method to provide a detailed comparison of each data member held within this object. If any differences are found, a 'false' value is immediately returned. If all data members are determined to be equal, a 'true' value is returned.


testStringNulls

public boolean testStringNulls(java.lang.String string1,
                               java.lang.String string2)
This is a convenience function fro testing the equality of two possibly null strings. This function considers all strings actaully equal to null, empty strings, and strings holding the value 'null' to be considered null. The purpose of this function is to deal with the case that a string, when sent over an http connection, often gets the string value of 'null' applied to it when parsed by the SAX parser.


testHashtables

public boolean testHashtables(java.util.Hashtable hashTable1,
                              java.util.Hashtable hashTable2)
This is a conviencce function to test the equality of two hashtables. This function will consider a null hashtable and an empty hashtable equal. If both the supplied hashtables are populated, this function will loop through all keys in one hashtable and check that the second hashtable contains each key and that each key has the same value associated with it.


testVectors

public boolean testVectors(java.util.Vector vector1,
                           java.util.Vector vector2)
This is a conviencce function to test the equality of two vectors. This function will consider a null vector and an empty vector equal. If both the supplied vectors are populated, this function will loop through all objects held in one vector and check that the second vector contains each object.


testPathInfo

public boolean testPathInfo(java.lang.String pathInfoString1,
                            java.lang.String pathInfoString2)
This is a convenience function to split the path information strings into a token set and then check that each token in the first string is also in the second string. Any mismatch will return false.


testRequestURI

public boolean testRequestURI(java.lang.String uriString1,
                              java.lang.String uriString2)
This is a convenience function to split the request URI strings into a token set and then check that each token in the first string is also in the second string. Any mismatch will return false.


testQueryString

public boolean testQueryString(java.lang.String queryString1,
                               java.lang.String queryString2)
This is a convenience function to split the query string strings into a token set and then check that each token in the first string is also in the second string. Any mismatch will return false.


testStringTokens

public boolean testStringTokens(java.util.StringTokenizer tokens1,
                                java.util.StringTokenizer tokens2)
This is a conviencce function to test the equality of two token sets. If both the supplied token sets are populated, this function will loop through all objects held in one token set and check that the second token set contains each object.


getCgiParamStrings

public java.lang.String[] getCgiParamStrings()
This is a convenience function to format and return valid XML representing all the CGI parameters held in this object. The XML returned is defined in HttpResponseObject.dtd.


getCgiArgStrings

public java.lang.String[] getCgiArgStrings()
This is a convenience function to format and return valid XML representing all the CGI arguments held in this object. The XML returned is defined in HttpResponseObject.dtd.


getHeaderStrings

public java.lang.String[] getHeaderStrings()
This is a convenience function to format and return valid XML representing all the headers held in this object. The XML returned is defined in HttpResponseObject.dtd.


getCookieStrings

public java.lang.String[] getCookieStrings()
This is a convenience function to format and return valid XML representing all the cookies held in this object. The XML returned is defined in HttpResponseObject.dtd.


getFileUploadStrings

public java.lang.String[] getFileUploadStrings()
This is a convenience function to format and return valid XML representing all the file uploads held in this object. The XML returned is defined in HttpResponseObject.dtd.


getHttpRequestInfoStrings

public java.lang.String[] getHttpRequestInfoStrings()
This is a convenience function to format and return valid XML representing the HttpRequestInfo element and all its attributes. The XML returned is defined in HttpResponseObject.dtd. Position zero in the returned array represents the start tag for this element. Position one in the returned array represents the stop tag for this element.


getHttpResponseObjectStrings

public java.lang.String[] getHttpResponseObjectStrings()
This is a convenience function to format and return valid XML representing the HttpResponseObject element and all its attributes. The XML returned is defined in HttpResponseObject.dtd. Position zero in the returned array represents the start tag for this element. Position one in the returned array represents the stop tag for this element.