Search in sources :

Example 1 with PostJob

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

the class PostJobsExecutor method execute.

private void execute(SensorContext context, Collection<PostJob> postJobs) {
    logPostJobs(postJobs);
    Project project = new Project(module.definition());
    for (PostJob postJob : postJobs) {
        LOG.info("Executing post-job {}", ScannerUtils.describe(postJob));
        eventBus.fireEvent(new PostJobExecutionEvent(postJob, true));
        postJob.executeOn(project, context);
        eventBus.fireEvent(new PostJobExecutionEvent(postJob, false));
    }
}
Also used : Project(org.sonar.api.resources.Project) PostJob(org.sonar.api.batch.PostJob)

Example 2 with PostJob

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

the class PhasesSumUpTimeProfilerTest method postJobPhase.

private void postJobPhase(PhasesSumUpTimeProfiler profiler) {
    PostJob postJob = new FakePostJob();
    // Start of sensor phase
    profiler.onPostJobsPhase(postJobsEvent(true));
    // Start of a Sensor
    profiler.onPostJobExecution(postJobEvent(postJob, true));
    clock.sleep(30);
    // End of a Sensor
    profiler.onPostJobExecution(postJobEvent(postJob, false));
    // End of sensor phase
    profiler.onPostJobsPhase(postJobsEvent(false));
}
Also used : PostJob(org.sonar.api.batch.PostJob)

Aggregations

PostJob (org.sonar.api.batch.PostJob)2 Project (org.sonar.api.resources.Project)1