Skip to content

Commit

Permalink
!! Bump sonar-orchestrator version
Browse files Browse the repository at this point in the history
  • Loading branch information
fourls committed Jul 5, 2023
1 parent f083aca commit 7f930aa
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 81 deletions.
28 changes: 11 additions & 17 deletions dependencies-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"dependencies" : [ {
"groupId" : "ch.qos.logback",
"artifactId" : "logback-classic",
"version" : "1.2.0",
"version" : "1.2.9",
"scope" : "test",
"type" : "jar"
}, {
"groupId" : "ch.qos.logback",
"artifactId" : "logback-core",
"version" : "1.2.0",
"version" : "1.2.9",
"scope" : "test",
"type" : "jar"
}, {
Expand Down Expand Up @@ -128,7 +128,7 @@
}, {
"groupId" : "commons-codec",
"artifactId" : "commons-codec",
"version" : "1.11",
"version" : "1.13",
"scope" : "test",
"type" : "jar"
}, {
Expand All @@ -149,12 +149,6 @@
"version" : "1.3.2",
"scope" : "compile",
"type" : "jar"
}, {
"groupId" : "junit",
"artifactId" : "junit",
"version" : "4.12",
"scope" : "test",
"type" : "jar"
}, {
"groupId" : "net.bytebuddy",
"artifactId" : "byte-buddy-agent",
Expand Down Expand Up @@ -258,16 +252,10 @@
"version" : "3.12.0",
"scope" : "compile",
"type" : "jar"
}, {
"groupId" : "org.hamcrest",
"artifactId" : "hamcrest-core",
"version" : "1.3",
"scope" : "test",
"type" : "jar"
}, {
"groupId" : "org.jacoco",
"artifactId" : "org.jacoco.agent",
"version" : "0.8.4",
"version" : "0.8.10",
"scope" : "test",
"type" : "jar",
"classifier" : "runtime"
Expand Down Expand Up @@ -391,10 +379,16 @@
"version" : "1.25.0.1003",
"scope" : "compile",
"type" : "jar"
}, {
"groupId" : "org.sonarsource.orchestrator",
"artifactId" : "sonar-orchestrator-junit5",
"version" : "4.0.0.404",
"scope" : "test",
"type" : "jar"
}, {
"groupId" : "org.sonarsource.orchestrator",
"artifactId" : "sonar-orchestrator",
"version" : "3.40.0.183",
"version" : "4.0.0.404",
"scope" : "test",
"type" : "jar"
}, {
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<sonarQubeMinVersion>7.9</sonarQubeMinVersion>
<sonar.version>7.9</sonar.version>
<sonar-analyzers-commons.version>1.25.0.1003</sonar-analyzers-commons.version>
<sonar-orchestrator.version>3.40.0.183</sonar-orchestrator.version>
<sonar-orchestrator.version>4.0.0.404</sonar-orchestrator.version>
<antlr-runtime.version>3.5.3</antlr-runtime.version>
<commons-text.version>1.10.0</commons-text.version>
<pmd.version>6.18.0</pmd.version>
Expand Down Expand Up @@ -266,6 +266,12 @@
<version>${sonar-orchestrator.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator-junit5</artifactId>
<version>${sonar-orchestrator.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
12 changes: 4 additions & 8 deletions src/it/java/org/sonar/plugins/delphi/DelphiCpdExecutorIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import static org.sonar.plugins.delphi.IntegrationTestSuite.createScanner;
import static org.sonar.plugins.delphi.IntegrationTestSuite.getProjectMeasureAsDouble;

import com.sonar.orchestrator.junit5.OrchestratorExtension;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.sonar.plugins.delphi.extension.OrchestratorExtension;

class DelphiCpdExecutorIT {
private static final String SIMPLE_PROJECT_KEY = "delphi-cpd-simple-test";
Expand All @@ -36,25 +36,21 @@ class DelphiCpdExecutorIT {

@Test
void testShouldDetectDuplicates() {
ORCHESTRATOR.getOrchestrator().executeBuild(createScanner("cpd-simple", SIMPLE_PROJECT_KEY));
ORCHESTRATOR.executeBuild(createScanner("cpd-simple", SIMPLE_PROJECT_KEY));
assertThat(getProjectMeasureAsDouble("duplicated_lines", SIMPLE_PROJECT_KEY)).isEqualTo(26.0);
assertThat(getProjectMeasureAsDouble("duplicated_blocks", SIMPLE_PROJECT_KEY)).isEqualTo(2.0);
}

@Test
void testShouldDetectDuplicatesByNormalizingLiterals() {
ORCHESTRATOR
.getOrchestrator()
.executeBuild(createScanner("cpd-literals", LITERALS_PROJECT_KEY));
ORCHESTRATOR.executeBuild(createScanner("cpd-literals", LITERALS_PROJECT_KEY));
assertThat(getProjectMeasureAsDouble("duplicated_lines", LITERALS_PROJECT_KEY)).isEqualTo(26.0);
assertThat(getProjectMeasureAsDouble("duplicated_blocks", LITERALS_PROJECT_KEY)).isEqualTo(2.0);
}

@Test
void testShouldDetectDuplicatesByIgnoringWhitespace() {
ORCHESTRATOR
.getOrchestrator()
.executeBuild(createScanner("cpd-whitespace", WHITESPACE_PROJECT_KEY));
ORCHESTRATOR.executeBuild(createScanner("cpd-whitespace", WHITESPACE_PROJECT_KEY));
assertThat(getProjectMeasureAsDouble("duplicated_lines", WHITESPACE_PROJECT_KEY))
.isEqualTo(33.0);
assertThat(getProjectMeasureAsDouble("duplicated_blocks", WHITESPACE_PROJECT_KEY))
Expand Down
13 changes: 10 additions & 3 deletions src/it/java/org/sonar/plugins/delphi/IntegrationTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
import org.sonar.plugins.delphi.extension.OrchestratorExtension;
import com.sonar.orchestrator.junit5.OrchestratorExtension;
import org.sonar.plugins.delphi.utils.DelphiUtils;
import org.sonarqube.ws.Measures.ComponentWsResponse;
import org.sonarqube.ws.Measures.Measure;
Expand All @@ -42,8 +42,15 @@ class IntegrationTestSuite {
private static final String PROJECTS_PATH = "src/it/projects/";
private static final String BDS_PATH =
DelphiUtils.getResource("/org/sonar/plugins/delphi/bds").getAbsolutePath();
private static final FileLocation PLUGIN_LOCATION =
FileLocation.byWildcardMavenFilename(new File("target"), "sonar-delphi-plugin-*.jar");

@RegisterExtension static final OrchestratorExtension ORCHESTRATOR = new OrchestratorExtension();

@RegisterExtension static final OrchestratorExtension ORCHESTRATOR = OrchestratorExtension.builderEnv()
.useDefaultAdminCredentialsForBuilds(true)
.setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE"))
.addPlugin(PLUGIN_LOCATION)
.build();

private IntegrationTestSuite() {
// Hide public constructor
Expand All @@ -53,7 +60,7 @@ private static WsClient newWsClient() {
return WsClientFactories.getDefault()
.newClient(
HttpConnector.newBuilder()
.url(ORCHESTRATOR.getOrchestrator().getServer().getUrl())
.url(ORCHESTRATOR.getServer().getUrl())
.build());
}

Expand Down

This file was deleted.

0 comments on commit 7f930aa

Please sign in to comment.