Package org.sonar.api.utils

Examples of org.sonar.api.utils.ValidationMessages


    assertThat(rule.getParameter("message")).isEqualTo("with special characters < > &");
  }

  @Test
  public void importProfileWithUnknownRuleParameter() {
    ValidationMessages validation = ValidationMessages.create();
    RulesProfile profile = parse("importProfileWithUnknownRuleParameter.xml", validation);

    assertThat(validation.getWarnings()).hasSize(1);
    ActiveRule rule = profile.getActiveRule("checkstyle", "IllegalRegexp");
    assertThat(rule.getParameter("unknown")).isNull();
  }
View Full Code Here


      public Rule answer(InvocationOnMock iom) throws Throwable {
        return Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1]);
      }
    });

    ValidationMessages messages = ValidationMessages.create();
    RulesProfile profile = new AnnotationProfileParser(ruleFinder).parse("squid", "Foo way", "java", Lists.<Class> newArrayList(FakeRule.class), messages);

    assertThat(profile.getName(), is("Foo way"));
    assertThat(profile.getLanguage(), is("java"));
    assertThat(profile.getActiveRule("squid", "fake").getSeverity(), is(RulePriority.BLOCKER));
    assertThat(messages.hasErrors(), is(false));
  }
View Full Code Here

      public Rule answer(InvocationOnMock iom) throws Throwable {
        return Rule.create((String) iom.getArguments()[0], (String) iom.getArguments()[1], (String) iom.getArguments()[1]);
      }
    });

    ValidationMessages messages = ValidationMessages.create();
    RulesProfile profile = new AnnotationProfileParser(ruleFinder).parse("squid", "Foo way", "java", Lists.<Class> newArrayList(FakeRule.class, RuleOnOtherProfile.class), messages);

    assertNotNull(profile.getActiveRule("squid", "fake"));
    assertNull(profile.getActiveRule("squid", "other"));
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.utils.ValidationMessages

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.