use of org.sonar.server.computation.task.projectanalysis.component.Component in project sonarqube by SonarSource.
the class PersistMeasuresStepTest method setupViewsComponents.
private void setupViewsComponents() {
Component view = ViewsComponent.builder(VIEW, ROOT_REF).setUuid("root-uuid").addChildren(ViewsComponent.builder(SUBVIEW, INTERMEDIATE_1_REF).setUuid("intermediate1-uuid").addChildren(ViewsComponent.builder(SUBVIEW, INTERMEDIATE_2_REF).setUuid("intermediate2-uuid").addChildren(ViewsComponent.builder(PROJECT_VIEW, LEAF_REF).setUuid("leaf-uuid").build()).build()).build()).build();
treeRootHolder.setRoot(view);
setupDbIds();
}
use of org.sonar.server.computation.task.projectanalysis.component.Component in project sonarqube by SonarSource.
the class PurgeDatastoresStepTest method call_purge_method_of_the_purge_task_for_view.
@Test
public void call_purge_method_of_the_purge_task_for_view() {
Component project = ViewsComponent.builder(Component.Type.VIEW, PROJECT_KEY).setUuid(PROJECT_UUID).build();
verify_call_purge_method_of_the_purge_task(project);
}
use of org.sonar.server.computation.task.projectanalysis.component.Component in project sonarqube by SonarSource.
the class PurgeDatastoresStepTest method call_purge_method_of_the_purge_task_for_project.
@Test
public void call_purge_method_of_the_purge_task_for_project() {
Component project = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid(PROJECT_UUID).setKey(PROJECT_KEY).build();
verify_call_purge_method_of_the_purge_task(project);
}
use of org.sonar.server.computation.task.projectanalysis.component.Component in project sonarqube by SonarSource.
the class PurgeDatastoresStepTest method do_not_call_purge_method_of_the_purge_task_for_other_views_components.
@Test
@UseDataProvider("nonRootViewsComponentTypes")
public void do_not_call_purge_method_of_the_purge_task_for_other_views_components(Component.Type type) {
Component component = ViewsComponent.builder(type, PROJECT_KEY).setUuid(PROJECT_UUID).build();
verify_do_not_call_purge_method_of_the_purge_task(component);
}
use of org.sonar.server.computation.task.projectanalysis.component.Component in project sonarqube by SonarSource.
the class ViewsComputeMeasureVariationsStepTest method set_variation.
@Test
public void set_variation() {
// View
SnapshotDto period1Snapshot = newAnalysis(view);
dbClient.snapshotDao().insert(session, period1Snapshot);
dbClient.measureDao().insert(session, newMeasureDto(ISSUES_METRIC.getId(), VIEW_UUID, period1Snapshot.getUuid(), 60d));
// SubView
ComponentDto subviewDto = ComponentTesting.newSubView(view, "dir", "key");
dbClient.componentDao().insert(session, subviewDto);
dbClient.measureDao().insert(session, newMeasureDto(ISSUES_METRIC.getId(), subviewDto.uuid(), period1Snapshot.getUuid(), 10d));
session.commit();
periodsHolder.setPeriod(newPeriod(period1Snapshot));
Component subview = ViewsComponent.builder(Component.Type.SUBVIEW, 2).setUuid(subviewDto.uuid()).build();
Component view = ViewsComponent.builder(Component.Type.VIEW, 1).setUuid(VIEW_UUID).addChildren(subview).build();
treeRootHolder.setRoot(view);
addRawMeasure(view, ISSUES_METRIC, Measure.newMeasureBuilder().create(80, null));
addRawMeasure(subview, ISSUES_METRIC, Measure.newMeasureBuilder().create(20, null));
underTest.execute();
assertThat(measureRepository.getRawMeasure(view, ISSUES_METRIC).get().getVariation()).isEqualTo(20d);
assertThat(measureRepository.getRawMeasure(subview, ISSUES_METRIC).get().getVariation()).isEqualTo(10d);
}
Aggregations