use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaTest method shouldDetectCommentedOutCode.
/**
* Since 2.13 commented-out code lines not saved as measure for Java - see SONAR-3093
*/
@Test
public void shouldDetectCommentedOutCode() {
MavenBuild build = MavenBuild.create().setPom(TestUtils.projectPom("commented-out-java-code")).setCleanSonarGoals().setProperty("sonar.dynamicAnalysis", "false");
orchestrator.executeBuild(build);
assertThat(getMeasureAsInteger("com.sonarsource.it.samples:commented-out-java-code", "ncloc")).isEqualTo(7);
assertThat(getMeasureAsInteger("com.sonarsource.it.samples:commented-out-java-code", "commented_out_code_lines")).isNull();
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaRulingTest method apache_commons_beanutils.
@Test
public void apache_commons_beanutils() throws Exception {
String projectName = "commons-beanutils";
MavenBuild build = test_project("commons-beanutils:commons-beanutils", projectName);
executeBuildWithCommonProperties(build, projectName);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class SemanticTest method test_project.
private static void test_project(String projectKey, @Nullable String path, String projectName) throws IOException {
prepareProject(projectKey, projectName);
String pomLocation = "../../sources/" + (path != null ? path + "/" : "") + projectName + "/pom.xml";
MavenBuild mavenBuild = MavenBuild.create().setPom(FileLocation.of(pomLocation).getFile()).setCleanPackageSonarGoals().addArgument("-DskipTests");
executeBuildWithCommonProperties(mavenBuild, projectName);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class SuppressWarningTest method suppressWarnings_nosonar.
/**
* SONARJAVA-19
*/
@Test
public void suppressWarnings_nosonar() throws Exception {
MavenBuild build = MavenBuild.create(TestUtils.projectPom("suppress-warnings")).setCleanSonarGoals().setProperty("sonar.java.binaries", "target").setProperty("sonar.profile", "suppress-warnings");
ORCHESTRATOR.executeBuild(build);
assertThat(parseInt(getMeasure("org.example:example", "violations").getValue())).isEqualTo(4);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaClasspathTest method mavenOnDitProject.
private static void mavenOnDitProject(String goal) {
MavenBuild build = MavenBuild.create(TestUtils.projectPom("dit-check")).setGoals(goal).setProperty("sonar.profile", "dit-check").setProperty("sonar.dynamicAnalysis", "false");
ORCHESTRATOR.executeBuild(build);
}
Aggregations