use of com.sonar.orchestrator.build.MavenBuild in project sonarqube by SonarSource.
the class DuplicationTest method hugeJavaFile.
/**
* SONAR-3060
*/
@Test
public void hugeJavaFile() {
MavenBuild build = MavenBuild.create(FileLocation.of("projects/huge-file/pom.xml").getFile()).setEnvironmentVariable("MAVEN_OPTS", "-Xmx1024m").setProperty("sonar.sourceEncoding", "UTF-8").setCleanSonarGoals();
orchestrator.executeBuild(build);
Map<String, Double> measure = getMeasures("com.sonarsource.it.samples:huge-file:src/main/java/huge/HugeFile.java");
assertThat(measure.get("duplicated_lines")).isGreaterThan(50000.0);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonarqube by SonarSource.
the class UpgradeTest method scanProject.
private void scanProject() {
MavenBuild build = MavenBuild.create(new File("projects/struts-1.3.9-diet/pom.xml")).setCleanSonarGoals().setProperty("sonar.exclusions", "**/pom.xml").setProperty("sonar.dynamicAnalysis", "false").setProperty("sonar.scm.disabled", "true").setProperty("sonar.cpd.cross_project", "true");
orchestrator.executeBuild(build);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonarqube by SonarSource.
the class ExtensionLifecycleTest method testInstantiationStrategyAndLifecycleOfBatchExtensions.
@Test
public void testInstantiationStrategyAndLifecycleOfBatchExtensions() {
MavenBuild build = MavenBuild.create(ItUtils.projectPom("analysis/extension-lifecycle")).setCleanSonarGoals().setProperty("extension.lifecycle", "true").setProperty("sonar.dynamicAnalysis", "false");
// Build fails if the extensions provided in the extension-lifecycle-plugin are not correctly
// managed.
orchestrator.executeBuild(build);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class SquidTest method init.
@BeforeClass
public static void init() {
orchestrator.resetData();
MavenBuild build = MavenBuild.create(TestUtils.projectPom("squid")).setCleanPackageSonarGoals().setProperty("sonar.scm.disabled", "true").setProperty("sonar.profile", "squid");
orchestrator.executeBuild(build);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class UnitTestsTest method tests_without_main_code.
@Test
public void tests_without_main_code() {
MavenBuild build = MavenBuild.create().setPom(TestUtils.projectPom("tests-without-main-code")).setGoals("clean test-compile surefire:test", "sonar:sonar");
orchestrator.executeBuild(build);
Map<String, Measure> measures = getMeasures("com.sonarsource.it.samples:tests-without-main-code", "tests", "test_errors", "test_failures", "skipped_tests", "test_execution_time", "test_success_density");
assertThat(parseInt(measures.get("tests").getValue())).isEqualTo(1);
assertThat(parseInt(measures.get("test_errors").getValue())).isEqualTo(0);
assertThat(parseInt(measures.get("test_failures").getValue())).isEqualTo(0);
assertThat(parseInt(measures.get("skipped_tests").getValue())).isEqualTo(1);
assertThat(parseInt(measures.get("test_execution_time").getValue())).isGreaterThan(0);
assertThat(parseDouble(measures.get("test_success_density").getValue())).isEqualTo(100.0);
}
Aggregations