new ProxyHandler("invalid.proxy.test", 8080, setProxy, IProxyData.HTTP_PROXY_TYPE) {
@Override
protected void handleProxyChange() throws CoreException {
try {
HttpProxyConfiguration configuration = CloudFoundryClientFactory
.getProxy(new URL(VALID_V1_HTTP_URL));
assertNotNull(configuration);
assertTrue(configuration.getProxyHost().equals("invalid.proxy.test"));
assertTrue(configuration.getProxyPort() == (8080));
// verify it is null for https, since proxy lookup should
// match the specified
// protocol in the given URL (i.e. HTTP proxy -> HTTP URL,
// HTTPS proxy -> HTTPS URL)
configuration = CloudFoundryClientFactory.getProxy(new URL(VALID_V1_HTTPS_URL));
// Need to add this code in case the server has a proxy set
// for either HTTP or HTTPS
if (configuration != null) {
assertTrue(!configuration.getProxyHost().equals("invalid.proxy.text"));
}
}
catch (MalformedURLException e) {
throw CloudErrorUtil.toCoreException(e);