From: Simon Brandhof Date: Sat, 6 Apr 2013 17:34:06 +0000 (+0200) Subject: Add unit test X-Git-Tag: 2.5-rc1~166 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5322f84d9d3eafa31effdd561c77c7db5b02b04d;p=sonar-scanner-cli.git Add unit test --- diff --git a/sonar-runner-impl/pom.xml b/sonar-runner-impl/pom.xml index 77aca5d..688bb81 100644 --- a/sonar-runner-impl/pom.xml +++ b/sonar-runner-impl/pom.xml @@ -43,6 +43,12 @@ mockito-all test + + org.mortbay.jetty + jetty + 6.1.25 + test + diff --git a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/ServerConnection.java b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/ServerConnection.java index ec3510a..3985bff 100644 --- a/sonar-runner-impl/src/main/java/org/sonar/runner/impl/ServerConnection.java +++ b/sonar-runner-impl/src/main/java/org/sonar/runner/impl/ServerConnection.java @@ -62,9 +62,7 @@ class ServerConnection { FileOutputStream output = null; String fullUrl = serverUrl + path; try { - if (Logs.isDebugEnabled()) { - Logs.debug("Download " + fullUrl + " to " + toFile.getAbsolutePath()); - } + Logs.debug("Download " + fullUrl + " to " + toFile.getAbsolutePath()); HttpURLConnection connection = newHttpConnection(new URL(fullUrl)); int statusCode = connection.getResponseCode(); if (statusCode != HttpURLConnection.HTTP_OK) { @@ -136,7 +134,6 @@ class ServerConnection { if (contentType == null) { return null; } - Matcher m = CHARSET_PATTERN.matcher(contentType); if (m.find()) { return m.group(1).trim().toUpperCase();