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'
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")
}
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')
// prevents instantiation
}
- public static void loadOrchestratorSettings(Settings settings) {
+ public static void loadOrchestratorRuleSettings(Settings settings) {
String url = settings.getString("orchestrator.configUrl");
if (isEmpty(url)) {
return;
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);
}
}
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)) {
((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) {
/**
* Background thread that checks if a stop request
- * is sent, usually by Orchestrator
+ * is sent, usually by OrchestratorRule
*/
public interface StopRequestWatcher {
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"),
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";
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'
}
*/
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;
}
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();