Search in sources :

Example 1 with BuildBreaker

use of org.sonar.api.batch.BuildBreaker in project sonarqube by SonarSource.

the class ScannerExtensionDictionnaryTest method buildStatusCheckersAreExecutedAfterOtherPostJobs.

@Test
public void buildStatusCheckersAreExecutedAfterOtherPostJobs() {
    BuildBreaker checker = new BuildBreaker() {

        public void executeOn(Project project, SensorContext context) {
        }
    };
    ScannerExtensionDictionnary selector = newSelector(new FakePostJob(), checker, new FakePostJob());
    List extensions = Lists.newArrayList(selector.select(PostJob.class, null, true, null));
    assertThat(extensions).hasSize(3);
    assertThat(extensions.get(2)).isEqualTo(checker);
}
Also used : SensorContext(org.sonar.api.batch.SensorContext) DefaultSensorContext(org.sonar.scanner.sensor.DefaultSensorContext) CheckProject(org.sonar.api.batch.CheckProject) Project(org.sonar.api.resources.Project) BuildBreaker(org.sonar.api.batch.BuildBreaker) List(java.util.List) PostJob(org.sonar.api.batch.PostJob) Test(org.junit.Test)

Aggregations

List (java.util.List)1 Test (org.junit.Test)1 BuildBreaker (org.sonar.api.batch.BuildBreaker)1 CheckProject (org.sonar.api.batch.CheckProject)1 PostJob (org.sonar.api.batch.PostJob)1 SensorContext (org.sonar.api.batch.SensorContext)1 Project (org.sonar.api.resources.Project)1 DefaultSensorContext (org.sonar.scanner.sensor.DefaultSensorContext)1