Search in sources :

Example 1 with Project

use of org.sonar.api.ce.posttask.Project in project sonarqube by SonarSource.

the class PostProjectAnalysisTaskImpl method finished.

@Override
public void finished(ProjectAnalysis analysis) {
    CeTask ceTask = analysis.getCeTask();
    Project project = analysis.getProject();
    QualityGate qualityGate = analysis.getQualityGate();
    LOG.info("POSTASKPLUGIN: finished() CeTask[{}][{}] Project[{}] Date[{}] QualityGate[{}]", ceTask.getStatus(), ceTask.getId(), project.getKey(), analysis.getDate().getTime(), qualityGate == null ? null : qualityGate.getStatus());
}
Also used : Project(org.sonar.api.ce.posttask.Project) CeTask(org.sonar.api.ce.posttask.CeTask) QualityGate(org.sonar.api.ce.posttask.QualityGate)

Example 2 with Project

use of org.sonar.api.ce.posttask.Project in project sonarqube by SonarSource.

the class PostProjectAnalysisTasksExecutorTest method project_uuid_key_and_name_come_from_CeTask.

@Test
public void project_uuid_key_and_name_come_from_CeTask() {
    underTest.finished(true);
    verify(postProjectAnalysisTask).finished(projectAnalysisArgumentCaptor.capture());
    Project project = projectAnalysisArgumentCaptor.getValue().getProject();
    assertThat(project.getUuid()).isEqualTo(ceTask.getComponentUuid());
    assertThat(project.getKey()).isEqualTo(ceTask.getComponentKey());
    assertThat(project.getName()).isEqualTo(ceTask.getComponentName());
}
Also used : Project(org.sonar.api.ce.posttask.Project) Test(org.junit.Test)

Aggregations

Project (org.sonar.api.ce.posttask.Project)2 Test (org.junit.Test)1 CeTask (org.sonar.api.ce.posttask.CeTask)1 QualityGate (org.sonar.api.ce.posttask.QualityGate)1