【问题标题】:Using JWebUnit behind a proxy在代理后面使用 JWebUnit
【发布时间】:2012-03-22 08:41:13
【问题描述】:

我正在使用 JWebUnit 在本地运行的应用程序(本地主机)上运行测试,但我的应用程序的某些部分要求用户重定向到外部站点,做一些事情然后回来(重定向到本地主机)。

由于我在代理后面,我尝试使用 TestContext.setProxyAuthorization() 但是 JWebUnit 无法在本地访问应用程序(TestContext 没有类似 nonProxyHosts 的东西)并且如果我不使用 TestContext.setProxyAuthorization() , JWebUnit 无法访问远程站点。

我该怎么办?

【问题讨论】:

    标签: java proxy jwebunit


    【解决方案1】:
    you can use the following within your setup method.  I have used this myself and it works
    you may need to add a password key and a value too
    
     System.setProperty("proxyHost", "AUT ip");
     System.setProperty("proxyPort", "AUT port 8080");
     System.setProperty("proxySet", "true");
     System.setProperty("http.nonProxyHosts", "webserverfor AUT");`enter code here`
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-08-06
    • 2015-10-04
    • 2013-02-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-10
    • 2012-12-24
    相关资源
    最近更新 更多