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

Quick Search    Search Deep

com.meterware.httpunit
Class FixedURLWebRequestSource  view FixedURLWebRequestSource download FixedURLWebRequestSource.java

java.lang.Object
  extended bycom.meterware.httpunit.ParameterHolder
      extended bycom.meterware.httpunit.WebRequestSource
          extended bycom.meterware.httpunit.FixedURLWebRequestSource
All Implemented Interfaces:
HTMLElement
Direct Known Subclasses:
WebImage, WebLink

abstract class FixedURLWebRequestSource
extends WebRequestSource

An implementation of web request source whose URL does not change under user action.


Field Summary
private  java.lang.String _characterSet
           
private  java.util.ArrayList _presetParameterList
           
private  java.util.Map _presetParameterMap
           
private static java.lang.String[] NO_VALUES
           
 
Fields inherited from class com.meterware.httpunit.WebRequestSource
 
Constructor Summary
FixedURLWebRequestSource(WebResponse response, org.w3c.dom.Node node, java.net.URL baseURL, java.lang.String destination, FrameSelector frame, java.lang.String defaultTarget, java.lang.String characterSet)
           
 
Method Summary
protected  void addPresetParameter(java.lang.String name, java.lang.String value)
          Records a parameter defined by including it in the destination URL.
private  boolean equals(java.lang.String[] left, java.lang.String[] right)
           
(package private)  java.lang.String getCharacterSet()
          Returns the character set encoding for the request.
protected  java.lang.String getEmptyParameterValue()
           
 java.lang.String[] getParameterNames()
          Returns an array containing the names of any parameters defined as part of this link's URL.
 java.lang.String[] getParameterValues(java.lang.String name)
          Returns the multiple default values of the named parameter.
private  java.util.ArrayList getPresetParameterList()
           
private  java.util.Map getPresetParameterMap()
           
 WebRequest getRequest()
          Creates and returns a web request which will simulate clicking on this link.
(package private)  boolean isFileParameter(java.lang.String name)
          Returns true if the specified parameter is a file field.
(package private)  boolean isSubmitAsMime()
           
private  void loadPresetParameters()
           
(package private)  void recordParameters(ParameterProcessor processor)
          Iterates through the parameters in this holder, recording them in the supplied parameter processor.
(package private)  void recordPredefinedParameters(ParameterProcessor processor)
          Iterates through the fixed, predefined parameters in this holder, recording them in the supplied parameter processor.\ These parameters always go on the URL, no matter what encoding method is used.
(package private)  void removeParameter(java.lang.String name)
          Removes a parameter name from this collection.
(package private)  void selectImageButtonPosition(SubmitButton imageButton, int x, int y)
          Specifies the position at which an image button (if any) was clicked.
protected  void setDestination(java.lang.String destination)
           
(package private)  void setParameter(java.lang.String name, java.lang.String value)
          Sets the value of a parameter in a web request.
(package private)  void setParameter(java.lang.String name, java.lang.String[] values)
          Sets the multiple values of a parameter in a web request.
(package private)  void setParameter(java.lang.String name, UploadFileSpec[] files)
          Sets the multiple values of a file upload parameter in a web request.
(package private)  void setSubmitAsMime(boolean mimeEncoded)
           
 
Methods inherited from class com.meterware.httpunit.WebRequestSource
getAttribute, getAttribute, getBaseResponse, getBaseURL, getClassName, getCurrentFrameContents, getDestination, getDOMSubtree, getFragmentIdentifier, getFrame, getHTMLPage, getID, getName, getNode, getPageFrame, getRelativePage, getRelativeURL, getTarget, getText, getTitle, isSupportedAttribute, loadDestinationParameters, setTargetAttribute, submitRequest, submitRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.meterware.httpunit.HTMLElement
getScriptableDelegate
 

Field Detail

NO_VALUES

private static final java.lang.String[] NO_VALUES

_presetParameterMap

private java.util.Map _presetParameterMap

_presetParameterList

private java.util.ArrayList _presetParameterList

_characterSet

private java.lang.String _characterSet
Constructor Detail

FixedURLWebRequestSource

public FixedURLWebRequestSource(WebResponse response,
                                org.w3c.dom.Node node,
                                java.net.URL baseURL,
                                java.lang.String destination,
                                FrameSelector frame,
                                java.lang.String defaultTarget,
                                java.lang.String characterSet)
Method Detail

getRequest

public WebRequest getRequest()
Creates and returns a web request which will simulate clicking on this link.

Specified by:
getRequest in class WebRequestSource

getParameterNames

public java.lang.String[] getParameterNames()
Returns an array containing the names of any parameters defined as part of this link's URL.

Specified by:
getParameterNames in class WebRequestSource

getParameterValues

public java.lang.String[] getParameterValues(java.lang.String name)
Returns the multiple default values of the named parameter.

Specified by:
getParameterValues in class WebRequestSource

addPresetParameter

protected void addPresetParameter(java.lang.String name,
                                  java.lang.String value)
Description copied from class: WebRequestSource
Records a parameter defined by including it in the destination URL. The value can be null, if the parameter name was not specified with an equals sign.

Specified by:
addPresetParameter in class WebRequestSource

getEmptyParameterValue

protected java.lang.String getEmptyParameterValue()
Specified by:
getEmptyParameterValue in class WebRequestSource

setDestination

protected void setDestination(java.lang.String destination)
Overrides:
setDestination in class WebRequestSource

selectImageButtonPosition

void selectImageButtonPosition(SubmitButton imageButton,
                               int x,
                               int y)
Specifies the position at which an image button (if any) was clicked.

Overrides:
selectImageButtonPosition in class ParameterHolder

recordPredefinedParameters

void recordPredefinedParameters(ParameterProcessor processor)
                          throws java.io.IOException
Iterates through the fixed, predefined parameters in this holder, recording them in the supplied parameter processor.\ These parameters always go on the URL, no matter what encoding method is used.

Specified by:
recordPredefinedParameters in class ParameterHolder

recordParameters

void recordParameters(ParameterProcessor processor)
                throws java.io.IOException
Iterates through the parameters in this holder, recording them in the supplied parameter processor.

Specified by:
recordParameters in class ParameterHolder

removeParameter

void removeParameter(java.lang.String name)
Removes a parameter name from this collection.

Specified by:
removeParameter in class ParameterHolder

setParameter

void setParameter(java.lang.String name,
                  java.lang.String value)
Sets the value of a parameter in a web request.

Specified by:
setParameter in class ParameterHolder

setParameter

void setParameter(java.lang.String name,
                  java.lang.String[] values)
Sets the multiple values of a parameter in a web request.

Specified by:
setParameter in class ParameterHolder

getCharacterSet

java.lang.String getCharacterSet()
Description copied from class: ParameterHolder
Returns the character set encoding for the request.

Overrides:
getCharacterSet in class ParameterHolder

equals

private boolean equals(java.lang.String[] left,
                       java.lang.String[] right)

setParameter

void setParameter(java.lang.String name,
                  UploadFileSpec[] files)
Sets the multiple values of a file upload parameter in a web request.

Specified by:
setParameter in class ParameterHolder

isFileParameter

boolean isFileParameter(java.lang.String name)
Returns true if the specified parameter is a file field.

Overrides:
isFileParameter in class ParameterHolder

isSubmitAsMime

boolean isSubmitAsMime()
Specified by:
isSubmitAsMime in class ParameterHolder

setSubmitAsMime

void setSubmitAsMime(boolean mimeEncoded)
Specified by:
setSubmitAsMime in class ParameterHolder

getPresetParameterMap

private java.util.Map getPresetParameterMap()

getPresetParameterList

private java.util.ArrayList getPresetParameterList()

loadPresetParameters

private void loadPresetParameters()