|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
com.canoo.webtest.engine.Configuration
public class Configuration
Captures configuration information.
| Field Summary | |
|---|---|
static String |
DEFAULT_HOST
|
static int |
DEFAULT_PORT
|
protected static int |
DEFAULT_TIMEOUT
The number of seconds before http connections timeout: (default=300) |
static int |
PORT_HTTP
|
static int |
PORT_HTTPS
|
static String |
PROTOCOL_FILE
|
static String |
PROTOCOL_HTTP
|
static String |
PROTOCOL_HTTPS
|
| Fields inherited from class org.apache.tools.ant.Task |
|---|
target, taskName, taskType, wrapper |
| Fields inherited from class org.apache.tools.ant.ProjectComponent |
|---|
description, location, project |
| Constructor Summary | |
|---|---|
Configuration()
Configuration constructor used by instance creation as nested element in ant. |
|
Configuration(WebtestTask testSpec)
Configuration constructor used to generate a default configuration when the user omit it. |
|
| Method Summary | |
|---|---|
void |
addHeader(Header header)
|
void |
addOption(Option option)
|
protected File |
computeSubFolder(File _resultDir)
Compute the name of the subfolder for this test |
protected void |
configurePageCreator(com.gargoylesoftware.htmlunit.WebClient webClient)
Configures WebTest's custom page creator able to create PDFPage (as long as this is not integrated directly into HtmlUnit) |
com.gargoylesoftware.htmlunit.WebClient |
createWebClient()
Configures the webclient used for the test |
void |
execute()
|
String |
getAutoRefresh()
Returns true if the client should automatically follow page refresh requests. |
String |
getBasePath()
|
String |
getBrowser()
Gets the configured browser |
Context |
getContext()
Gets the context for the current webtest |
String |
getDefaultPropertyType()
|
int |
getEasyAjaxDelay()
Experimental. |
String |
getErrorProperty()
|
String |
getExternalProperty(String name)
|
String |
getFailureProperty()
|
List |
getHeaderList()
|
String |
getHost()
|
List |
getOptionList()
|
Map |
getParameterDictionary()
|
int |
getPort()
|
String |
getProtocol()
|
String |
getResultFile()
|
protected int |
getResultFolderIndex(File _resultDir)
Get the index to use as prefix for the dedicated result folder of this test |
File |
getResultpath()
This is the configured general result dir. |
String |
getSavePrefix()
|
File |
getSummaryFile()
Gets the file where the summary should be written. |
int |
getTimeout()
Gets the timeout in seconds |
String |
getUrlForPage(String page)
Completes a URL based on configuration values by expanding where needed from a base URL (protocol and optionally host:port). |
boolean |
getUseInsecureSSL()
Indicate if insecure SSL should be used, ie that certificates should not be validated and therefore outdated or self-signed certificates accepted. |
String |
getUserAgent()
Gets the User-Agent header to be sent. |
File |
getWebTestResultDir()
Gets the directory where all artifacts of this specific test should be saved. |
void |
init()
Get's called from Ant once the project and target references have been set but before the properties are configured |
boolean |
isEasyAjax()
|
boolean |
isHaltOnError()
|
boolean |
isHaltOnFailure()
|
boolean |
isRespectVisibility()
Experimental: indicates if WebTest tries to work only on displayed elements. |
boolean |
isSaveResponse()
|
boolean |
isShowHtmlParserOutput()
|
void |
setAutoRefresh(String str)
Determines if the client should automatically follow page refresh requests. |
void |
setBasepath(String newBasePath)
Defines the constant base path used to construct request URLs, e.g. |
void |
setBrowser(String browser)
Configures the browser that should be simulated in the test |
void |
setContext(Context context)
Defines the context. |
void |
setDefaultPropertyType(String type)
|
void |
setEasyAjax(boolean b)
Experimental. |
void |
setEasyAjaxDelay(int delay)
Experimental. |
void |
setErrorProperty(String errorProperty)
|
void |
setFailureProperty(String failureProperty)
|
void |
setHaltonerror(boolean haltOnError)
|
void |
setHaltonfailure(boolean haltOnFailure)
|
void |
setHost(String newHost)
|
void |
setPort(int newPort)
|
void |
setPropertyHandler(IPropertyHandler propertyHandler)
|
void |
setProtocol(String newProtocol)
|
void |
setRespectVisibility(boolean b)
Experimental: indicates if WebTest should try to work only on displayed elements. |
void |
setResultfile(String resultFile)
|
void |
setResultFolderIndex(int index)
Sets the index of the result folder. |
void |
setResultpath(File newResultPath)
|
void |
setSavePrefix(String savePrefix)
|
void |
setSaveresponse(boolean newSaveResponse)
|
void |
setShowhtmlparseroutput(boolean showParserOutput)
|
void |
setSummary(boolean newSummary)
|
void |
setTimeout(int timeout)
Sets the timeout |
protected void |
setupWebClient()
|
void |
setUseInsecureSSL(boolean insecureSSL)
Defines if insecure SSL should be used, ie that certificates should not be validated and therefore outdated or self-signed certificates accepted. |
| Methods inherited from class org.apache.tools.ant.Task |
|---|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType |
| Methods inherited from class org.apache.tools.ant.ProjectComponent |
|---|
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PORT_HTTP
public static final int PORT_HTTPS
public static final int DEFAULT_PORT
public static final String DEFAULT_HOST
public static final String PROTOCOL_HTTP
public static final String PROTOCOL_HTTPS
public static final String PROTOCOL_FILE
protected static final int DEFAULT_TIMEOUT
| Constructor Detail |
|---|
public Configuration()
public Configuration(WebtestTask testSpec)
| Method Detail |
|---|
public void init()
init in class Task
public void execute()
throws BuildException
execute in class TaskBuildException
protected void setupWebClient()
throws IOException
IOExceptionprotected File computeSubFolder(File _resultDir)
_resultDir - the "main" result dir
public void setResultFolderIndex(int index)
index - the indexprotected int getResultFolderIndex(File _resultDir)
_resultDir - the base result directory
public File getSummaryFile()
null if no resultfile was specifiedpublic void addHeader(Header header)
header - public List getHeaderList()
public void addOption(Option option)
option - public List getOptionList()
public String getBasePath()
public String getUserAgent()
null if none has been configuredpublic String getHost()
public int getPort()
public String getProtocol()
public File getResultpath()
public File getWebTestResultDir()
getResultpath() but this may change in the future.
public String getSavePrefix()
public String getUrlForPage(String page)
page - the maybe relative target URL
public boolean isSaveResponse()
public void setSavePrefix(String savePrefix)
public void setBasepath(String newBasePath)
newBasePath - the new valuepublic void setHost(String newHost)
public void setPort(int newPort)
public void setProtocol(String newProtocol)
public void setResultpath(File newResultPath)
public void setSaveresponse(boolean newSaveResponse)
public void setSummary(boolean newSummary)
public void setHaltonerror(boolean haltOnError)
public void setHaltonfailure(boolean haltOnFailure)
public void setErrorProperty(String errorProperty)
public void setFailureProperty(String failureProperty)
public String getFailureProperty()
public String getErrorProperty()
public String getDefaultPropertyType()
public void setDefaultPropertyType(String type)
public void setShowhtmlparseroutput(boolean showParserOutput)
public boolean isShowHtmlParserOutput()
public boolean isHaltOnFailure()
public boolean isHaltOnError()
public Map getParameterDictionary()
public String getResultFile()
public void setResultfile(String resultFile)
public void setPropertyHandler(IPropertyHandler propertyHandler)
public String getExternalProperty(String name)
public String getAutoRefresh()
public void setAutoRefresh(String str)
str - the new refresh valuepublic void setContext(Context context)
execute()
is called
context - the contextpublic Context getContext()
public com.gargoylesoftware.htmlunit.WebClient createWebClient()
protected void configurePageCreator(com.gargoylesoftware.htmlunit.WebClient webClient)
public int getTimeout()
DEFAULT_TIMEOUT).public void setTimeout(int timeout)
timeout - the new value (in seconds), set 0 for no timeoutpublic void setEasyAjax(boolean b)
b - the new valuepublic boolean isEasyAjax()
public void setEasyAjaxDelay(int delay)
setEasyAjax(boolean)
delay - the new valuepublic int getEasyAjaxDelay()
public void setUseInsecureSSL(boolean insecureSSL)
insecureSSL - the new valuepublic boolean getUseInsecureSSL()
false)public void setRespectVisibility(boolean b)
public boolean isRespectVisibility()
falsepublic void setBrowser(String browser)
browser - the browser name like "Firefox3" or "FF3"public String getBrowser()
null if nothing has been configured
|
Copyright © 2001-2007 Canoo Engineering AG, Basel. All rights reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||