Eclipse中的代理服务器测试失败 [英] Failed web service unit tests behind a proxy in Eclipse
本文介绍了Eclipse中的代理服务器测试失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
我找到了解决方案:显然可以在Eclipse中的运行/调试设置中配置代理。要执行此操作:
- 右键单击单元测试类
- 调试为 - 调试配置
- 转到标签参数
-
将代理配置添加到VM参数:
-
-Dhttp.proxyHost = proxy.host.com
-
-Dhttp.proxyPort = 8080
-
-Dhttp.nonProxyHosts = [用管道字符分隔的主机列表]
-
如果您在密码保护代理后面,您必须添加:
-
-Dhttp.proxyUser = someUserName
-
-Dhttp.proxyPassword = somePassword
I have a problem executing unit tests in Eclipse behind a proxy, as the classes used by the unit tests call some web services, which are behind a proxy. In Tomcat I can of course specify a proxy to be used, but when I run unit tests directly from Eclipse, the proxy configuration of Eclipse seems to be ignored. How can I configure my unit tests or Eclipse to use a proxy in this case?
解决方案
I found the solution: apparently one can configure the proxy in run/debug settings in Eclipse. To do this:
- right click on the unit test class
- debug as - debug configurations
- go to tab "Arguments"
add proxy configuration to "VM arguments":
-Dhttp.proxyHost=proxy.host.com
-Dhttp.proxyPort=8080
-Dhttp.nonProxyHosts=[list of hosts separated with pipe character]
If you are behind a password protected proxy, you have to add:
-Dhttp.proxyUser=someUserName
-Dhttp.proxyPassword=somePassword
这篇关于Eclipse中的代理服务器测试失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文