|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.uwyn.rife.test.MockForm
public class MockForm
Corresponds to a form in a HTML document after it has been parsed with
ParsedHtml.parse(com.uwyn.rife.test.MockResponse).
| Method Summary | |
|---|---|
MockForm |
file(String name,
MockFileUpload file)
Sets a file in this form. |
MockForm |
files(String name,
MockFileUpload[] files)
Sets files in this request. |
String |
getAction()
Retrieves the content of this form's action attribute. |
String |
getClassName()
Retrieves the content of this form's class attribute. |
String |
getId()
Retrieves the content of this form's id attribute. |
String |
getMethod()
Retrieves the content of this form's method attribute. |
String |
getName()
Retrieves the content of this form's name attribute. |
Node |
getNode()
Retrieves the DOM XML node that this form corresponds to. |
Collection<String> |
getParameterNames()
Retrieves all the parameter names of this form. |
Map<String,String[]> |
getParameters()
Retrieves all the parameters of this form. |
String |
getParameterValue(String name)
Retrieves the first value of a parameter in this form. |
String[] |
getParameterValues(String name)
Retrieves the values of a parameter in this form. |
MockRequest |
getRequest()
Creates a new MockRequest that contains the method, the
parameters and the files of this form. |
String |
getTitle()
Retrieves the content of this form's title attribute. |
boolean |
hasParameter(String name)
Checks whether a named parameter is present in this form. |
MockForm |
parameter(String name,
String value)
Sets a parameter in this form. |
MockForm |
parameter(String name,
String[] values)
Sets a parameter in this form. |
void |
setFile(String name,
MockFileUpload file)
Sets a file in this form. |
void |
setFiles(String name,
MockFileUpload[] files)
Sets files in this request. |
void |
setParameter(String name,
String value)
Sets a parameter in this form. |
void |
setParameter(String name,
String[] values)
Sets a parameter in this form. |
MockResponse |
submit()
Submit this form with its current parameters and files; and returns the response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public Node getNode()
public MockRequest getRequest()
MockRequest that contains the method, the
parameters and the files of this form.
MockRequestpublic MockResponse submit()
MockResponsepublic Map<String,String[]> getParameters()
Map of the parameters with the names as the keys
and their value arrays as the valuesgetParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)public Collection<String> getParameterNames()
Collection of the parameter namesgetParameters(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)public boolean hasParameter(String name)
name - the name of the parameter to check
true if the parameter is present; or
false otherwise
getParameters(),
getParameterNames(),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)public String getParameterValue(String name)
name - the name of the parameter
null if no such parameter could be found
getParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)public String[] getParameterValues(String name)
name - the name of the parameter
null if no such parameter could be found
getParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)
public void setParameter(String name,
String value)
name - the name of the parametervalue - the value of the parametergetParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[])
public MockForm parameter(String name,
String value)
name - the name of the parametervalue - the value of the parameter
MockForm instancegetParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)
public void setParameter(String name,
String[] values)
name - the name of the parametervalues - the value array of the parametergetParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String)
public MockForm parameter(String name,
String[] values)
name - the name of the parametervalues - the value array of the parameter
MockForm instancegetParameters(),
getParameterNames(),
hasParameter(java.lang.String),
getParameterValue(java.lang.String),
getParameterValues(java.lang.String),
setParameter(String, String[]),
setParameter(String, String)
public void setFile(String name,
MockFileUpload file)
name - the parameter name of the filefile - the file specification that will be uploadedsetFiles(String, MockFileUpload[])
public MockForm file(String name,
MockFileUpload file)
name - the parameter name of the filefile - the file specification that will be uploaded
MockForm instancesetFiles(String, MockFileUpload[])
public void setFiles(String name,
MockFileUpload[] files)
name - the parameter name of the filefiles - the file specifications that will be uploadedsetFile(String, MockFileUpload)
public MockForm files(String name,
MockFileUpload[] files)
name - the parameter name of the filefiles - the file specifications that will be uploaded
MockForm instancesetFile(String, MockFileUpload)public String getId()
id attribute.
id attribute; or
null if no such attribute could be found
public String getClassName()
class attribute.
class attribute; or
null if no such attribute could be found
public String getTitle()
title attribute.
title attribute; or
null if no such attribute could be found
public String getAction()
action attribute.
action attribute; or
null if no such attribute could be found
public String getMethod()
method attribute.
method attribute; or
null if no such attribute could be found
public String getName()
name attribute.
name attribute; or
null if no such attribute could be found
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||