use of org.sonar.api.batch.bootstrap.ProjectBuilder in project sonarqube by SonarSource.
the class ProjectBuildersExecutor method execute.
public void execute(ProjectReactor reactor) {
if (projectBuilders.length > 0) {
Profiler profiler = Profiler.create(LOG).startInfo("Execute project builders");
ProjectBuilderContext context = new ProjectBuilderContext(reactor);
for (ProjectBuilder projectBuilder : projectBuilders) {
try {
projectBuilder.build(context);
} catch (Exception e) {
throw MessageException.of("Failed to execute project builder: " + getDescription(projectBuilder), e);
}
}
profiler.stopInfo();
}
}
use of org.sonar.api.batch.bootstrap.ProjectBuilder in project sonarqube by SonarSource.
the class ProjectBuildersExecutorTest method testProjectBuilderFailsWithToString.
@Test
public void testProjectBuilderFailsWithToString() {
ProjectBuilder builder = mock(ProjectBuilder.class);
doThrow(new IllegalStateException()).when(builder).build(any(Context.class));
ProjectBuilder[] projectBuilders = { builder };
exception.expectMessage("Failed to execute project builder: Mock for ProjectBuilder");
exception.expect(MessageException.class);
new ProjectBuildersExecutor(projectBuilders).execute(reactor);
}
Aggregations