use of org.sonar.api.utils.ValidationMessages in project sonarqube by SonarSource.
the class XMLProfileParserTest method importProfileWithRuleParameters.
@Test
public void importProfileWithRuleParameters() {
ValidationMessages validation = ValidationMessages.create();
RulesProfile profile = parse("importProfileWithRuleParameters.xml", validation);
assertThat(validation.hasErrors()).isFalse();
assertThat(validation.hasWarnings()).isFalse();
ActiveRule rule = profile.getActiveRule("checkstyle", "IllegalRegexp");
assertThat(rule.getParameter("format")).isEqualTo("foo");
assertThat(rule.getParameter("message")).isEqualTo("with special characters < > &");
}
use of org.sonar.api.utils.ValidationMessages in project sonarqube by SonarSource.
the class XMLProfileParserTest method nameAndLanguageShouldBeMandatory.
@Test
public void nameAndLanguageShouldBeMandatory() {
ValidationMessages validation = ValidationMessages.create();
parse("nameAndLanguageShouldBeMandatory.xml", validation);
assertThat(validation.getErrors()).hasSize(2);
assertThat(validation.getErrors().get(0)).contains("");
}
Aggregations