Search in sources :

Example 1 with QualityProfiles

use of org.sonar.scanner.rule.QualityProfiles in project sonarqube by SonarSource.

the class QualityProfileProviderTest method testProvide.

@Test
public void testProvide() {
    when(loader.load("project")).thenReturn(response);
    QualityProfiles qps = qualityProfileProvider.provide(loader, props);
    assertResponse(qps);
    verify(loader).load("project");
    verifyNoMoreInteractions(loader);
}
Also used : QualityProfiles(org.sonar.scanner.rule.QualityProfiles) Test(org.junit.Test)

Example 2 with QualityProfiles

use of org.sonar.scanner.rule.QualityProfiles in project sonarqube by SonarSource.

the class QualityProfilesProvider method provide.

@Bean("QualityProfiles")
public QualityProfiles provide(QualityProfileLoader loader, ScannerProperties props) {
    Profiler profiler = Profiler.create(LOG).startInfo(LOG_MSG);
    QualityProfiles profiles = new QualityProfiles(loader.load(props.getProjectKey()));
    profiler.stopInfo();
    return profiles;
}
Also used : QualityProfiles(org.sonar.scanner.rule.QualityProfiles) Profiler(org.sonar.api.utils.log.Profiler) Bean(org.springframework.context.annotation.Bean)

Example 3 with QualityProfiles

use of org.sonar.scanner.rule.QualityProfiles in project sonarqube by SonarSource.

the class QualityProfileProviderTest method testProfileProp.

@Test
public void testProfileProp() {
    when(loader.load("project")).thenReturn(response);
    QualityProfiles qps = qualityProfileProvider.provide(loader, props);
    assertResponse(qps);
    verify(loader).load("project");
    verifyNoMoreInteractions(loader);
}
Also used : QualityProfiles(org.sonar.scanner.rule.QualityProfiles) Test(org.junit.Test)

Aggregations

QualityProfiles (org.sonar.scanner.rule.QualityProfiles)3 Test (org.junit.Test)2 Profiler (org.sonar.api.utils.log.Profiler)1 Bean (org.springframework.context.annotation.Bean)1