use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaTest method shouldFailIfInvalidJavaPackage.
/**
* SONARJAVA-444
*/
@Test
public void shouldFailIfInvalidJavaPackage() {
MavenBuild build = MavenBuild.create().setPom(TestUtils.projectPom("invalid-java-package")).setCleanSonarGoals();
BuildResult buildResult = orchestrator.executeBuildQuietly(build);
assertThat(buildResult.getLastStatus()).isEqualTo(0);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaTest method filtered_issues.
/**
* SONARJAVA-1615
*/
@Test
public void filtered_issues() throws Exception {
MavenBuild build = MavenBuild.create(TestUtils.projectPom("filtered-issues")).setCleanPackageSonarGoals().setProperty("sonar.profile", "filtered-issues");
orchestrator.executeBuild(build);
assertThat(getMeasureAsInteger("org.example:example", "violations")).isEqualTo(2);
IssueClient issueClient = orchestrator.getServer().wsClient().issueClient();
List<Issue> issues = issueClient.find(IssueQuery.create().components("org.example:example:src/main/java/EclispeI18NFiltered.java")).list();
assertThat(issues).hasSize(2);
for (Issue issue : issues) {
assertThat(issue.ruleKey()).matches(value -> "squid:S1444".equals(value) || "squid:ClassVariableVisibilityCheck".equals(value));
assertThat(issue.line()).isEqualTo(17);
}
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class Struts139Test method analyzeProject.
@BeforeClass
public static void analyzeProject() {
orchestrator.resetData();
MavenBuild build = MavenBuild.create(TestUtils.projectPom("struts-1.3.9-lite"));
build.setGoals("org.jacoco:jacoco-maven-plugin:prepare-agent clean verify");
MavenBuild analysis = MavenBuild.create(TestUtils.projectPom("struts-1.3.9-lite")).setProperty("sonar.scm.disabled", "true").setProperty("sonar.exclusions", "**/pom.xml").setGoals("sonar:sonar");
orchestrator.executeBuilds(build, analysis);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaRulingTest method sonarqube_server.
@Test
public void sonarqube_server() throws Exception {
// sonarqube-6.5/server/sonar-server (v.6.5)
String projectName = "sonar-server";
MavenBuild build = test_project("org.sonarsource.sonarqube:sonar-server", "sonarqube-6.5/server", projectName);
executeBuildWithCommonProperties(build, projectName);
}
use of com.sonar.orchestrator.build.MavenBuild in project sonar-java by SonarSource.
the class JavaRulingTest method guava.
@Test
public void guava() throws Exception {
String projectName = "guava";
MavenBuild build = test_project("com.google.guava:guava", projectName);
executeBuildWithCommonProperties(build, projectName);
}
Aggregations