March 2003
Intermediate to advanced
288 pages
7h 4m
English
You want to test a remote web site, but your development machines are behind a firewall.
Set the proxySet, proxyHost,
and proxyPort
system properties.
HttpUnit uses java.net.HttpURLConnection, which
checks the proxySet
system property to determine if
it should operate through a proxy server. If this property is set,
the proxyHost
and
proxyPort
properties specify the server name and
port.
You can set these properties in your unit test method using this code:
System.getProperties( ).put("proxySet", "true");
System.getProperties( ).put("proxyHost", "myProxyHostName");
System.getProperties( ).put("proxyPort", "10000");Recipe 3.6 shows how to set system properties using Ant.
Read now
Unlock full access