Java Code Examples for org.sonar.api.server.profile.BuiltInQualityProfilesDefinition

The following examples show how to use org.sonar.api.server.profile.BuiltInQualityProfilesDefinition. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: sonar-clojure   Source File: KibitRulesTest.java    License: MIT License 5 votes vote down vote up
@Test
public void testIfSonarwayProfileIsCreatedWithAllEastwoodRules() {
    BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("clj", "Sonar way");
    List<BuiltInQualityProfilesDefinition.BuiltInActiveRule> rules = profile.rules();
    List<String> ruleKeys = new ArrayList<>();
    ruleKeys.addAll(asList("kibit"));

    ruleKeys.stream().forEach(kibitRule -> assertTrue(ruleKeys.contains(kibitRule)));
}
 
Example 2
Source Project: sonar-clojure   Source File: ClojureSonarWayProfileTest.java    License: MIT License 5 votes vote down vote up
@Before
public void setUp() {
    context = new BuiltInQualityProfilesDefinition.Context();
    clojureSonarWayProfile = new ClojureSonarWayProfile();
    clojureSonarWayProfile.define(context);
    BuiltInQualityProfilesDefinition.BuiltInQualityProfile profile = context.profile("clj", "Sonar way");
    List<BuiltInQualityProfilesDefinition.BuiltInActiveRule> rules = profile.rules();
    this.profileRules = rules.stream().map(r -> r.ruleKey()).collect(Collectors.toList());

}
 
Example 3
Source Project: sonar-clojure   Source File: KibitRulesTest.java    License: MIT License 4 votes vote down vote up
@Before
public void setUp() {
    context = new BuiltInQualityProfilesDefinition.Context();
    clojureSonarWayProfile = new ClojureSonarWayProfile();
    clojureSonarWayProfile.define(context);
}
 
Example 4
Source Project: AEM-Rules-for-SonarQube   Source File: HtlProfileTest.java    License: Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() {
    profile = new HtlProfile();
    this.context = new BuiltInQualityProfilesDefinition.Context();

}