]> source.dussan.org Git - sonarqube.git/commitdiff
Fix timeout issue and speed up UT on my box
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 30 Sep 2014 15:45:29 +0000 (17:45 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Mon, 6 Oct 2014 15:59:10 +0000 (17:59 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/utils/HttpDownloader.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/HttpDownloaderTest.java

index 02bdd7138db970990aff306bad1066a1962d9de7..406bcf43455c03647de34b571135b9b731eac35f 100644 (file)
@@ -185,7 +185,7 @@ public class HttpDownloader extends UriReader.SchemeProcessor implements BatchCo
       List<String> descriptions = Lists.newArrayList();
       for (Proxy proxy : proxies) {
         if (proxy.type() != Proxy.Type.DIRECT) {
-          descriptions.add("proxy: " + proxy.address());
+          descriptions.add(proxy.type() + " proxy: " + proxy.address());
         }
       }
 
index f899251fdabe3a01b445dbbf617ea248228e156e..993f7f385325b2dafed80440d9d34fc1171c54a3 100644 (file)
@@ -219,7 +219,7 @@ public class HttpDownloaderTest {
   public void shouldGetProxySynthesis() throws URISyntaxException {
     ProxySelector proxySelector = mock(ProxySelector.class);
     when(proxySelector.select(any(URI.class))).thenReturn(Arrays.<Proxy>asList(new FakeProxy()));
-    assertThat(HttpDownloader.BaseHttpDownloader.getProxySynthesis(new URI("http://an_url"), proxySelector)).isEqualTo("proxy: http://proxy_url:4040");
+    assertThat(HttpDownloader.BaseHttpDownloader.getProxySynthesis(new URI("http://an_url"), proxySelector)).isEqualTo("HTTP proxy: /123.45.67.89:4040");
   }
 
   @Test
@@ -236,6 +236,6 @@ public class HttpDownloaderTest {
 
 class FakeProxy extends Proxy {
   public FakeProxy() {
-    super(Type.HTTP, new InetSocketAddress("http://proxy_url", 4040));
+    super(Type.HTTP, new InetSocketAddress("123.45.67.89", 4040));
   }
 }