]> source.dussan.org Git - sonarqube.git/commitdiff
Dead code
authorDavid Gageot <david@gageot.net>
Tue, 12 May 2015 08:33:55 +0000 (10:33 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 12 May 2015 12:33:40 +0000 (14:33 +0200)
server/sonar-server/src/test/java/org/sonar/server/tester/ServerTester.java
sonar-batch/src/main/java/org/sonar/batch/mediumtest/BatchMediumTester.java
sonar-batch/src/test/java/org/sonar/batch/mediumtest/Benchmark.java
sonar-batch/src/test/java/org/sonar/batch/mediumtest/preview/EmptyFileTest.java
sonar-batch/src/test/java/org/sonar/batch/mediumtest/preview/IncrementalModeMediumTest.java
sonar-batch/src/test/java/org/sonar/batch/mediumtest/scm/ScmMediumTest.java

index 0015c8fb34ee0fef64bdf9fb37bbdc114321f547..b7c43a31c056a6bddd023ebcd9a05460f8482264 100644 (file)
@@ -19,7 +19,6 @@
  */
 package org.sonar.server.tester;
 
-import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Lists;
 import org.apache.commons.io.FileUtils;
@@ -159,18 +158,6 @@ public class ServerTester extends ExternalResource {
     return this;
   }
 
-  public ServerTester addPluginJar(File jar) {
-    Preconditions.checkArgument(jar.exists() && jar.isFile(), "Plugin JAR file does not exist: " + jar.getAbsolutePath());
-    try {
-      File pluginsDir = new File(homeDir, "extensions/plugins");
-      FileUtils.forceMkdir(pluginsDir);
-      FileUtils.copyFileToDirectory(jar, pluginsDir);
-      return this;
-    } catch (Exception e) {
-      throw new IllegalStateException("Fail to copy plugin JAR file: " + jar.getAbsolutePath(), e);
-    }
-  }
-
   /**
    * Set a property available for startup. Must be called before {@link #start()}. Does not affect
    * Elasticsearch server.
@@ -222,18 +209,6 @@ public class ServerTester extends ExternalResource {
     }
   }
 
-  private void checkInSafeMode() {
-    if (platform == null || !platform.isInSafeMode()) {
-      throw new IllegalStateException("Not in safe mode");
-    }
-  }
-
-  private void checkNotInSafeMode() {
-    if (platform != null && platform.isInSafeMode()) {
-      throw new IllegalStateException("Already in safe mode");
-    }
-  }
-
   public static class Xoo implements Language {
 
     public static final String KEY = "xoo";
index 743c1e887bce71db919b68a9175d842e23ef48ef..9f92432a026f6856f91200359d8876220ef721db 100644 (file)
@@ -145,14 +145,6 @@ public class BatchMediumTester {
       serverLineHashes.byKey.put(fileKey, lineHashes);
       return this;
     }
-
-    public BatchMediumTesterBuilder registerMetrics(List<Metric> metrics) {
-      for (Metric<?> m : metrics) {
-        registerMetric(m);
-      }
-      return this;
-    }
-
   }
 
   public void start() {
index 49d0ff34f35ce1c4e609d59d4949db45424ec353..d77a811e46d9da0e06ac14857cd9ed23d097acea 100644 (file)
@@ -34,12 +34,6 @@ public class Benchmark extends ErrorCollector {
     }
   }
 
-  public void expectBetween(String label, long val, long min, long max) {
-    if (ENABLED) {
-      checkThat(label, val, Matchers.allOf(Matchers.greaterThan(min), Matchers.lessThan(max)));
-    }
-  }
-
   public void expectLessThanOrEqualTo(String label, long val, long max) {
     if (ENABLED) {
       checkThat(label, val, Matchers.lessThan(max));
index ac5d983c1e9ceab461b8def6f326d58474866e44..385023ec1e3d4a65af1a2de81badeaf8110f26e7 100644 (file)
@@ -33,8 +33,6 @@ import org.sonar.batch.protocol.input.ActiveRule;
 import org.sonar.xoo.XooPlugin;
 
 import java.io.File;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -47,16 +45,6 @@ public class EmptyFileTest {
   @Rule
   public LogTester logTester = new LogTester();
 
-  private static SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
-
-  private static Long date(String date) {
-    try {
-      return sdf.parse(date).getTime();
-    } catch (ParseException e) {
-      throw new IllegalStateException(e);
-    }
-  }
-
   public BatchMediumTester tester = BatchMediumTester.builder()
     .bootstrapProperties(ImmutableMap.of(CoreProperties.ANALYSIS_MODE, CoreProperties.ANALYSIS_MODE_PREVIEW))
     .registerPlugin("xoo", new XooPlugin())
index 6bffe47ace29cc90c9127a94da75a9eba5999137..1f1539388f3d605502c579764b498ba463056257 100644 (file)
@@ -144,7 +144,6 @@ public class IncrementalModeMediumTest {
     int openIssues = 0;
     int resolvedIssue = 0;
     for (Issue issue : result.issues()) {
-      System.out.println(issue.key() + " " + issue.line() + " " + issue.status());
       if (issue.isNew()) {
         newIssues++;
       } else if (issue.resolution() != null) {
index 7b6d86c8f11df573fe243a32af31d741b47d0aec..24484442e70b56d2a02f3c8d9e2f017873b01704 100644 (file)
@@ -30,7 +30,6 @@ import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
 import org.sonar.batch.mediumtest.BatchMediumTester;
 import org.sonar.batch.mediumtest.BatchMediumTester.TaskBuilder;
-import org.sonar.batch.mediumtest.TaskResult;
 import org.sonar.batch.protocol.input.FileData;
 import org.sonar.batch.protocol.output.BatchReport;
 import org.sonar.batch.protocol.output.BatchReport.Changesets.Changeset;
@@ -74,7 +73,7 @@ public class ScmMediumTest {
 
     File baseDir = prepareProject();
 
-    TaskResult result = tester.newTask()
+    tester.newTask()
       .properties(ImmutableMap.<String, String>builder()
         .put("sonar.task", "scan")
         .put("sonar.projectBaseDir", baseDir.getAbsolutePath())
@@ -126,7 +125,7 @@ public class ScmMediumTest {
     // Clear file content
     FileUtils.write(new File(baseDir, "src/sample.xoo"), "");
 
-    TaskResult result = tester.newTask()
+    tester.newTask()
       .properties(ImmutableMap.<String, String>builder()
         .put("sonar.task", "scan")
         .put("sonar.projectBaseDir", baseDir.getAbsolutePath())
@@ -142,7 +141,6 @@ public class ScmMediumTest {
     BatchReport.Changesets changesets = getChangesets(baseDir, 0);
 
     assertThat(changesets).isNull();
-
   }
 
   @Test
@@ -277,7 +275,7 @@ public class ScmMediumTest {
 
     File baseDir = prepareProject();
 
-    TaskResult result = tester.newTask()
+    tester.newTask()
       .properties(ImmutableMap.<String, String>builder()
         .put("sonar.task", "scan")
         .put("sonar.projectBaseDir", baseDir.getAbsolutePath())