【发布时间】:2015-08-31 18:59:54
【问题描述】:
在测试中,我尝试以编程方式更改 Eclipse 代理设置,而不直接影响 System 属性。
我目前的尝试是这样的:
httpProxyData.setHost(host)
httpProxyData.setPort(port)
httpProxyData.setUserid(userId)
httpProxyData.setPassword(password)
proxyService.setProxyData((IProxyData[]) [
httpProxyData
])
我的代理服务设置如下:
proxyService.setProxiesEnabled(true)
proxyService.setSystemProxiesEnabled(false)
当proxyService.setProxyData 执行时,System.getproperty("http.proxyHost") 立即更改为host。
IProxyService API 声明 System 属性不会受到影响。我希望System 属性仅受我在稍后或更早时间设置System.setProperty(..., ...) 的影响。
我是不是做错了什么?
【问题讨论】:
标签: java eclipse proxy eclipse-plugin