]> source.dussan.org Git - sonarqube.git/commitdiff
Upgrade to JUnit 4.12
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 9 Dec 2014 22:16:18 +0000 (23:16 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 9 Dec 2014 22:16:18 +0000 (23:16 +0100)
pom.xml
server/sonar-process-monitor/src/test/java/org/sonar/process/monitor/MonitorTest.java
server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java
server/sonar-search/src/test/java/org/sonar/search/SearchServerTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/AnalysisReportTaskLauncherTest.java
sonar-plugin-api/src/test/java/org/sonar/api/utils/HttpDownloaderTest.java

diff --git a/pom.xml b/pom.xml
index 4a34c9ecafdb59d509259a619dacf2a4187f2773..c771d9285ace3d3f44edeced688504e59929e4ab 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
-        <version>4.11</version>
+        <version>4.12</version>
       </dependency>
       <dependency>
         <groupId>xmlunit</groupId>
       <dependency>
         <groupId>org.reflections</groupId>
         <artifactId>reflections</artifactId>
-        <version>0.9.9-RC1</version>
+        <version>0.9.9</version>
       </dependency>
       <dependency>
         <groupId>com.google.code.gson</groupId>
index 7734843c3d89740245d814b00407a3586ebd084f..289b371c46cd2e05652b63b4d608ee0988fc790d 100644 (file)
@@ -74,7 +74,7 @@ public class MonitorTest {
    * Safeguard
    */
   @Rule
-  public Timeout globalTimeout = new Timeout(30000);
+  public Timeout globalTimeout = Timeout.seconds(30);
 
   /**
    * Temporary directory is used to interact with monitored processes, which write in it.
index 9560c3c7f38b7144ed653b88b4372d4b05194cb7..e24f51b62e14e2db3eed80bd57e82629f290ca6e 100644 (file)
@@ -22,7 +22,9 @@ package org.sonar.process;
 import org.apache.commons.io.FileUtils;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.DisableOnDebug;
 import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestRule;
 import org.junit.rules.Timeout;
 import org.sonar.process.Lifecycle.State;
 import org.sonar.process.test.StandardProcess;
@@ -42,7 +44,7 @@ public class ProcessEntryPointTest {
    * Safeguard
    */
   @Rule
-  public Timeout timeout = new Timeout(10000);
+  public TestRule timeout = new DisableOnDebug(Timeout.seconds(10));
 
   @Rule
   public TemporaryFolder temp = new TemporaryFolder();
index 969137e97abdab9595cba38b222df2cc3d284e12..f2be9704667eb99cfe5cd5f2ecf6f4207637546d 100644 (file)
@@ -29,7 +29,9 @@ import org.elasticsearch.common.transport.InetSocketTransportAddress;
 import org.junit.After;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.DisableOnDebug;
 import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestRule;
 import org.junit.rules.Timeout;
 import org.sonar.process.NetworkUtils;
 import org.sonar.process.ProcessConstants;
@@ -48,7 +50,7 @@ public class SearchServerTest {
   Client client;
 
   @Rule
-  public Timeout timeout = new Timeout(60000);
+  public TestRule timeout = new DisableOnDebug(Timeout.seconds(60));
 
   @Rule
   public TemporaryFolder temp = new TemporaryFolder();
index 4d32dac4ca44f9a7255d37e81a7be8680ba02b03..9e79a7288ddc51f5ade97bf8e1e31cc0f40697d5 100644 (file)
@@ -24,6 +24,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.DisableOnDebug;
+import org.junit.rules.TestRule;
 import org.junit.rules.Timeout;
 import org.sonar.api.platform.Server;
 
@@ -34,7 +36,7 @@ import static org.mockito.Mockito.*;
 public class AnalysisReportTaskLauncherTest {
 
   @Rule
-  public Timeout timeout = new Timeout(5000);
+  public TestRule timeout = new DisableOnDebug(Timeout.seconds(5));
 
   private AnalysisReportTaskLauncher sut;
   private ComputationService service;
index fa9d2edc866f84ec3876dc47e07bb2a31f2e9fee..3c7cbf1acecca565b54a346f0b35c0c56afe2bf4 100644 (file)
@@ -26,8 +26,10 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.DisableOnDebug;
 import org.junit.rules.ExpectedException;
 import org.junit.rules.TemporaryFolder;
+import org.junit.rules.TestRule;
 import org.junit.rules.Timeout;
 import org.simpleframework.http.Request;
 import org.simpleframework.http.Response;
@@ -64,7 +66,7 @@ public class HttpDownloaderTest {
   public ExpectedException thrown = ExpectedException.none();
 
   @Rule
-  public Timeout timeout = new Timeout(2000);
+  public TestRule timeout = new DisableOnDebug(Timeout.seconds(2));
 
   private static SocketConnection socketConnection;
   private static String baseUrl;