@Test
  public void testUseSystemProperties() throws Exception {
    System.setProperty("http.proxyHost", "foo.blah.nonexisting.dns.name");
    servletRunner = new ServletRunner();

    Properties servletProps = new Properties();
    servletProps.setProperty(ProxyServlet.P_LOG, "true");
    servletProps.setProperty(ProxyServlet.P_USESYSTEMPROPERTIES, "true");
    // Must use a non-local URL because localhost is in http.nonProxyHosts by default.
    targetBaseUri = "http://www.google.com";
    servletProps.setProperty(ProxyServlet.P_TARGET_URI, targetBaseUri);
    servletRunner.registerServlet(servletPath + "/*", servletName, servletProps);

    sc = servletRunner.newClient();
    sc.getClientProperties().setAutoRedirect(false);//don't want httpunit itself to redirect

    GetMethodWebRequest req = makeGetMethodRequest(sourceBaseUri);
    try {
      execAssert(req);
      fail("UnknownHostException expected.");
    } catch (UnknownHostException e) {
      // Expected assuming that our proxy host defined above does not exist.
    } finally {
      System.clearProperty("http.proxyHost");
    }
  }
If we're proxying a remote service that tries to set cookies, we need to make sure the cookies are not captured
by the httpclient in the ProxyServlet, otherwise later requests from ALL users will all access the remote proxy
with the same cookie as the first user
src/test/java/org/mitre/dsmiley/httpproxy/ProxyServletTest.java