@Test public void test() { SonarRuntime sonarRuntime = SonarRuntimeImpl.forSonarQube(Version.create(7, 3), SonarQubeSide.SERVER); SonarWayProfile definition = new SonarWayProfile(sonarRuntime); Context context = new Context(); definition.define(context); BuiltInQualityProfile profile = context.profile("web", "Sonar way"); Assertions.assertThat(profile.name()).isEqualTo("Sonar way"); Assertions.assertThat(profile.language()).isEqualTo(HtmlConstants.LANGUAGE_KEY); Assertions.assertThat(profile.rules().size()).isGreaterThan(10); }
@Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(NAME, HtmlConstants.LANGUAGE_KEY); BuiltInQualityProfileJsonLoader.load(profile, REPOSITORY_KEY, JSON_PROFILE_PATH, RESOURCE_BASE_PATH, sonarRuntime); profile.done(); }
SonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(NAME, HtmlConstants.LANGUAGE_KEY); BuiltInQualityProfileJsonLoader.load(profile, REPOSITORY_KEY, JSON_PROFILE_PATH, RESOURCE_BASE_PATH, sonarRuntime); profile.done(); } }
SonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(NAME, HtmlConstants.LANGUAGE_KEY); BuiltInQualityProfileJsonLoader.load(profile, REPOSITORY_KEY, JSON_PROFILE_PATH, RESOURCE_BASE_PATH, sonarRuntime); profile.done(); } SonarWayProfile(SonarRuntime sonarRuntime); }
SonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(NAME, HtmlConstants.LANGUAGE_KEY); BuiltInQualityProfileJsonLoader.load(profile, REPOSITORY_KEY, JSON_PROFILE_PATH, RESOURCE_BASE_PATH, sonarRuntime); profile.done(); } SonarWayProfile(SonarRuntime sonarRuntime); @Override void define(Context context); }
SonarWayProfile implements BuiltInQualityProfilesDefinition { @Override public void define(Context context) { NewBuiltInQualityProfile profile = context.createBuiltInQualityProfile(NAME, HtmlConstants.LANGUAGE_KEY); BuiltInQualityProfileJsonLoader.load(profile, REPOSITORY_KEY, JSON_PROFILE_PATH, RESOURCE_BASE_PATH, sonarRuntime); profile.done(); } SonarWayProfile(SonarRuntime sonarRuntime); @Override void define(Context context); static final String JSON_PROFILE_PATH; }