com.meterware.httpunit

Class ClientProperties

public class ClientProperties extends Object

A class which represents the properties of a web client.

Author: Russell Gold

Method Summary
StringgetApplicationCodeName()
StringgetApplicationName()
StringgetApplicationVersion()
intgetAvailableScreenWidth()
intgetAvailHeight()
static ClientPropertiesgetDefaultProperties()
Returns the current defaults for newly created web clients.
StringgetPlatform()
StringgetUserAgent()
Returns the user agent identification.
booleanisAcceptCookies()
Returns true if the client should accept and transmit cookies.
booleanisAcceptGzip()
Returns true if the client will accept GZIP encoding of responses.
booleanisAutoRedirect()
Returns true if the client should automatically follow page redirect requests (status 3xx).
booleanisAutoRefresh()
Returns true if the client should automatically follow page refresh requests.
booleanisIframeSupported()
voidsetAcceptCookies(boolean acceptCookies)
Specifies whether the client should accept and send cookies.
voidsetAcceptGzip(boolean acceptGzip)
Specifies whether the client will accept GZIP encoded responses.
voidsetApplicationCodeName(String applicationCodeName)
voidsetApplicationID(String applicationName, String applicationCodeName, String applicationVersion)
Specifies the ID information for a client.
voidsetApplicationName(String applicationName)
voidsetApplicationVersion(String applicationVersion)
voidsetAutoRedirect(boolean autoRedirect)
Determines whether the client should automatically follow page redirect requests (status 3xx).
voidsetAutoRefresh(boolean autoRefresh)
Specifies whether the client should automatically follow page refresh requests.
voidsetAvailableScreenSize(int width, int height)
A shortcut for setting both availableScreenWidth and availableScreenHeight at one time.
voidsetAvailableScreenWidth(int availWidth)
voidsetAvailHeight(int availHeight)
voidsetDnsListener(DNSListener dnsListener)
Specifies a listener for DNS requests from the client.
voidsetIframeSupported(boolean iframeSupported)
voidsetPlatform(String platform)
voidsetUserAgent(String userAgent)

Method Detail

getApplicationCodeName

public String getApplicationCodeName()

getApplicationName

public String getApplicationName()

getApplicationVersion

public String getApplicationVersion()

getAvailableScreenWidth

public int getAvailableScreenWidth()

getAvailHeight

public int getAvailHeight()

getDefaultProperties

public static ClientProperties getDefaultProperties()
Returns the current defaults for newly created web clients.

getPlatform

public String getPlatform()

getUserAgent

public String getUserAgent()
Returns the user agent identification. Unless this has been set explicitly, it will default to the application code name followed by a slash and the application version.

isAcceptCookies

public boolean isAcceptCookies()
Returns true if the client should accept and transmit cookies. The default is to accept them.

isAcceptGzip

public boolean isAcceptGzip()
Returns true if the client will accept GZIP encoding of responses. The default is to accept GZIP encoding.

isAutoRedirect

public boolean isAutoRedirect()
Returns true if the client should automatically follow page redirect requests (status 3xx). By default, this is true.

isAutoRefresh

public boolean isAutoRefresh()
Returns true if the client should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page.

isIframeSupported

public boolean isIframeSupported()

setAcceptCookies

public void setAcceptCookies(boolean acceptCookies)
Specifies whether the client should accept and send cookies.

setAcceptGzip

public void setAcceptGzip(boolean acceptGzip)
Specifies whether the client will accept GZIP encoded responses. The default is true.

setApplicationCodeName

public void setApplicationCodeName(String applicationCodeName)

setApplicationID

public void setApplicationID(String applicationName, String applicationCodeName, String applicationVersion)
Specifies the ID information for a client.

setApplicationName

public void setApplicationName(String applicationName)

setApplicationVersion

public void setApplicationVersion(String applicationVersion)

setAutoRedirect

public void setAutoRedirect(boolean autoRedirect)
Determines whether the client should automatically follow page redirect requests (status 3xx). By default, this is true in order to simulate normal browser operation.

setAutoRefresh

public void setAutoRefresh(boolean autoRefresh)
Specifies whether the client should automatically follow page refresh requests. By default, this is false, so that programs can verify the redirect page presented to users before the browser switches to the new page. Setting this to true can cause an infinite loop on pages that refresh themselves.

setAvailableScreenSize

public void setAvailableScreenSize(int width, int height)
A shortcut for setting both availableScreenWidth and availableScreenHeight at one time.

setAvailableScreenWidth

public void setAvailableScreenWidth(int availWidth)

setAvailHeight

public void setAvailHeight(int availHeight)

setDnsListener

public void setDnsListener(DNSListener dnsListener)
Specifies a listener for DNS requests from the client.

setIframeSupported

public void setIframeSupported(boolean iframeSupported)

setPlatform

public void setPlatform(String platform)

setUserAgent

public void setUserAgent(String userAgent)