@Test public void test() { SonarScannerJavaPropertiesRulesDefinition rulesDefinition = new SonarScannerJavaPropertiesRulesDefinition(); RulesDefinition.Context context = new RulesDefinition.Context(); rulesDefinition.define(context); RulesDefinition.Repository repository = context.repository("sonarscanner"); assertThat(repository.name()).isEqualTo("SonarQube Scanner"); assertThat(repository.language()).isEqualTo("jproperties"); assertThat(repository.rules()).hasSize(1); RulesDefinition.Rule deprecatedPropertiesRule = repository.rule(SonarScannerDeprecatedPropertiesCheck.class.getAnnotation(Rule.class).key()); assertThat(deprecatedPropertiesRule).isNotNull(); assertThat(deprecatedPropertiesRule.name()).isEqualTo(SonarScannerDeprecatedPropertiesCheck.class.getAnnotation(Rule.class).name()); }
@Override public void define(Context context) { NewRepository repository = context .createRepository(SONAR_SCANNER_REPOSITORY_KEY, JavaPropertiesLanguage.KEY) .setName(SONAR_SCANNER_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, JavaPropertiesLanguage.KEY).addRuleClasses(false, getChecks()); repository.done(); }
SonarScannerJavaPropertiesRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(SONAR_SCANNER_REPOSITORY_KEY, JavaPropertiesLanguage.KEY) .setName(SONAR_SCANNER_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, JavaPropertiesLanguage.KEY).addRuleClasses(false, getChecks()); repository.done(); } }
SonarScannerJavaPropertiesRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(SONAR_SCANNER_REPOSITORY_KEY, JavaPropertiesLanguage.KEY) .setName(SONAR_SCANNER_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, JavaPropertiesLanguage.KEY).addRuleClasses(false, getChecks()); repository.done(); }  }
SonarScannerJavaPropertiesRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(SONAR_SCANNER_REPOSITORY_KEY, JavaPropertiesLanguage.KEY) .setName(SONAR_SCANNER_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, JavaPropertiesLanguage.KEY).addRuleClasses(false, getChecks()); repository.done(); }  @Override void define(Context context); @SuppressWarnings("rawtypes") static Collection<Class> getChecks(); }
SonarScannerJavaPropertiesRulesDefinition implements RulesDefinition { @Override public void define(Context context) { NewRepository repository = context .createRepository(SONAR_SCANNER_REPOSITORY_KEY, JavaPropertiesLanguage.KEY) .setName(SONAR_SCANNER_REPOSITORY_NAME); new AnnotationBasedRulesDefinition(repository, JavaPropertiesLanguage.KEY).addRuleClasses(false, getChecks()); repository.done(); }  @Override void define(Context context); @SuppressWarnings("rawtypes") static Collection<Class> getChecks(); static final String SONAR_SCANNER_REPOSITORY_KEY; }