]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20328 Upgrade sonar-orchestrator version and update affected tests from breakin...
authorDimitris Kavvathas <dimitris.kavvathas@sonarsource.com>
Wed, 6 Sep 2023 13:44:34 +0000 (15:44 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 7 Sep 2023 20:02:56 +0000 (20:02 +0000)
build.gradle
server/sonar-db-dao/build.gradle
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/OrchestratorSettingsUtils.java
server/sonar-db-dao/src/testFixtures/java/org/sonar/db/TestDbImpl.java
server/sonar-main/src/main/java/org/sonar/application/StopRequestWatcher.java
server/sonar-process/src/main/java/org/sonar/process/ProcessProperties.java
server/sonar-webserver-auth/src/main/java/org/sonar/server/authentication/DefaultAdminCredentialsVerifierFilter.java
sonar-ws-generator/build.gradle
sonar-ws-generator/src/main/java/org/sonarqube/wsgenerator/ApiDefinitionDownloader.java

index 8bdca52f07c1bff313f2893de3e6af9593ee7857..84165244face606edd0a74e1c0a4d046018a9418 100644 (file)
@@ -404,7 +404,7 @@ subprojects {
       dependency 'org.reflections:reflections:0.10.2'
       dependency 'org.simpleframework:simple:5.1.6'
       dependency 'org.sonarsource.git.blame:git-files-blame:1.0.2.275'
-      dependency 'org.sonarsource.orchestrator:sonar-orchestrator:3.42.0.312'
+      dependency 'org.sonarsource.orchestrator:sonar-orchestrator-junit4:4.1.0.495'
       dependency 'org.sonarsource.update-center:sonar-update-center-common:1.30.0.1030'
       dependency("org.springframework:spring-context:${springVersion}") {
         exclude 'commons-logging:commons-logging'
@@ -664,7 +664,7 @@ subprojects {
       bbtRuntimeOnly 'org.postgresql:postgresql'
       bbtRuntimeOnly project(':plugins:sonar-xoo-plugin')
 
-      bbtImplementation 'org.sonarsource.orchestrator:sonar-orchestrator'
+      bbtImplementation 'org.sonarsource.orchestrator:sonar-orchestrator-junit4'
       bbtImplementation project(":sonar-testing-harness")
       bbtImplementation project(":private:it-common")
     }
index c312242405ba7882b3e0b565d378b6cf63be0dd5..d179a2dadbf127e7b2ae208c5b78a136d9f235fe 100644 (file)
@@ -27,7 +27,7 @@ dependencies {
   testImplementation 'org.assertj:assertj-core'
   testImplementation 'org.assertj:assertj-guava'
   testImplementation 'org.mockito:mockito-core'
-  testImplementation 'org.sonarsource.orchestrator:sonar-orchestrator'
+  testImplementation 'org.sonarsource.orchestrator:sonar-orchestrator-junit4'
   testImplementation 'org.sonarsource.api.plugin:sonar-plugin-api-test-fixtures'
   testImplementation project(':sonar-testing-harness')
   testImplementation project(':sonar-plugin-api-impl')
index 5acb7e9d1d7c29d886817f9772460745b78c5952..ed4720ae1d8c3214da377aba9ea787a35feb3f99 100644 (file)
@@ -37,7 +37,7 @@ public class OrchestratorSettingsUtils {
     // prevents instantiation
   }
 
-  public static void loadOrchestratorSettings(Settings settings) {
+  public static void loadOrchestratorRuleSettings(Settings settings) {
     String url = settings.getString("orchestrator.configUrl");
     if (isEmpty(url)) {
       return;
@@ -68,7 +68,7 @@ public class OrchestratorSettingsUtils {
         settings.setProperty(entry.getKey(), interpolatedValue);
       }
     } catch (Exception e) {
-      throw new IllegalStateException("Cannot load Orchestrator properties from:" + url, e);
+      throw new IllegalStateException("Cannot load OrchestratorRule properties from:" + url, e);
     } finally {
       IOUtils.closeQuietly(input);
     }
index 2811be884e1366107299a13843babf631f9211b8..874c7d265562fd33cbce755114bfa6cc33db5f80 100644 (file)
@@ -56,7 +56,7 @@ class TestDbImpl extends CoreTestDb {
   }
 
   private void init(@Nullable String schemaPath, MyBatisConfExtension[] confExtensions) {
-    Consumer<Settings> loadOrchestratorSettings = OrchestratorSettingsUtils::loadOrchestratorSettings;
+    Consumer<Settings> loadOrchestratorRuleSettings = OrchestratorSettingsUtils::loadOrchestratorRuleSettings;
     Function<Settings, Database> databaseCreator = settings -> {
       String dialect = settings.getString("sonar.jdbc.dialect");
       if (dialect != null && !"h2".equals(dialect)) {
@@ -77,7 +77,7 @@ class TestDbImpl extends CoreTestDb {
       ((SQDatabase) database).executeScript(schemaPath);
     };
     BiConsumer<Database, Boolean> createMyBatis = (db, created) -> myBatis = newMyBatis(db, confExtensions);
-    init(loadOrchestratorSettings, databaseCreator, schemaPathExecutor, createMyBatis);
+    init(loadOrchestratorRuleSettings, databaseCreator, schemaPathExecutor, createMyBatis);
   }
 
   private static MyBatis newMyBatis(Database db, MyBatisConfExtension[] extensions) {
index 8789698caa5e6b4c0905b8bb528438910bdf7d32..67dd869514967480f8e2ab369c5d9e024e963ee9 100644 (file)
@@ -21,7 +21,7 @@ package org.sonar.application;
 
 /**
  * Background thread that checks if a stop request
- * is sent, usually by Orchestrator
+ * is sent, usually by OrchestratorRule
  */
 public interface StopRequestWatcher {
 
index ab1c4f5e7e71312b2c3ea8b50a338a6dfd6b85ee..54b1786dc350ae73756307c81ab15809abd0946e 100644 (file)
@@ -180,7 +180,7 @@ public class ProcessProperties {
     SONAR_UPDATECENTER_ACTIVATE("sonar.updatecenter.activate", "true"),
 
     /**
-     * Used by Orchestrator to ask for shutdown of monitor process
+     * Used by OrchestratorRule to ask for shutdown of monitor process
      */
     ENABLE_STOP_COMMAND("sonar.enableStopCommand"),
 
index 49d3906e2a52856b866e49036a6f81dcb2ab9f00..8e09d24f0d291db42f14455cb247772710d21637 100644 (file)
@@ -35,7 +35,7 @@ import static org.sonar.server.authentication.AuthenticationRedirection.redirect
 public class DefaultAdminCredentialsVerifierFilter extends HttpFilter {
   private static final String RESET_PASSWORD_PATH = "/account/reset_password";
   private static final String CHANGE_ADMIN_PASSWORD_PATH = "/admin/change_admin_password";
-  // This property is used by Orchestrator to disable this force redirect. It should never be used in production, which
+  // This property is used by OrchestratorRule to disable this force redirect. It should never be used in production, which
   // is why this is not defined in org.sonar.process.ProcessProperties.
   private static final String SONAR_FORCE_REDIRECT_DEFAULT_ADMIN_CREDENTIALS = "sonar.forceRedirectOnDefaultAdminCredentials";
 
index a57236825a88b0c41a8f7a2ad0d7b49e95b5a493..df3d2ac2ef2cba96a05592188760256fb1e87459 100644 (file)
@@ -13,7 +13,7 @@ dependencies {
   api 'commons-collections:commons-collections:3.2.2'
   api 'org.apache.velocity:velocity:1.7'
   api 'org.slf4j:log4j-over-slf4j'
-  api 'org.sonarsource.orchestrator:sonar-orchestrator'
+  api 'org.sonarsource.orchestrator:sonar-orchestrator-junit4'
 
   compileOnlyApi 'com.google.code.findbugs:jsr305'
 }
index f448bc3540c6dde85a23995d6150c19d4baf7582..db1bae60ee14c6a27f4e2a104f584c2fdf4f5baf 100644 (file)
@@ -19,8 +19,8 @@
  */
 package org.sonarqube.wsgenerator;
 
-import com.sonar.orchestrator.Orchestrator;
-import com.sonar.orchestrator.OrchestratorBuilder;
+import com.sonar.orchestrator.junit4.OrchestratorRule;
+import com.sonar.orchestrator.junit4.OrchestratorRuleBuilder;
 import com.sonar.orchestrator.http.HttpCall;
 import com.sonar.orchestrator.http.HttpResponse;
 import com.sonar.orchestrator.locator.FileLocation;
@@ -35,12 +35,12 @@ public class ApiDefinitionDownloader {
   }
 
   public static String downloadApiDefinition() {
-    OrchestratorBuilder builder = Orchestrator.builderEnv()
+    OrchestratorRuleBuilder builder = OrchestratorRule.builderEnv()
       .defaultForceAuthentication();
     builder.setEdition(COMMUNITY);
     builder.setZipFile(FileLocation.byWildcardMavenFilename(new File("../sonar-application/build/distributions"), "sonar-application-*.zip").getFile())
       .setOrchestratorProperty("orchestrator.workspaceDir", "build");
-    Orchestrator orchestrator = builder.setServerProperty("sonar.forceAuthentication", "false")
+    OrchestratorRule orchestrator = builder.setServerProperty("sonar.forceAuthentication", "false")
       .build();
 
     orchestrator.start();