]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
Add unit test
authorSimon Brandhof <simon.brandhof@gmail.com>
Sat, 6 Apr 2013 17:34:06 +0000 (19:34 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Sat, 6 Apr 2013 17:34:06 +0000 (19:34 +0200)
sonar-runner-impl/pom.xml
sonar-runner-impl/src/main/java/org/sonar/runner/impl/ServerConnection.java

index 77aca5de4c62d75270df1aefefd98e4e59c5aeab..688bb812a4dbe0451daef65a531a094fb3983f18 100644 (file)
       <artifactId>mockito-all</artifactId>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.mortbay.jetty</groupId>
+      <artifactId>jetty</artifactId>
+      <version>6.1.25</version>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
index ec3510af33c4cff1d283c0db90c2e4d093cd2dd3..3985bff6513c3e88b7d8dc27d9f54a4d8393b153 100644 (file)
@@ -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();