Tabnine Logo
AnnotationProfileParser.parse
Code IndexAdd Tabnine to your IDE (free)

How to use
parse
method
in
org.sonar.api.profiles.AnnotationProfileParser

Best Java code snippets using org.sonar.api.profiles.AnnotationProfileParser.parse (Showing top 5 results out of 315)

origin: SonarSource/sonarqube

@Test
public void shouldParseAnnotatedClasses() {
 RuleFinder ruleFinder = mock(RuleFinder.class);
 when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer(new Answer<Rule>() {
  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()).isEqualTo("Foo way");
 assertThat(profile.getLanguage()).isEqualTo("java");
 assertThat(profile.getActiveRule("squid", "fake").getSeverity()).isEqualTo(RulePriority.BLOCKER);
 assertThat(messages.hasErrors()).isFalse();
}
origin: SonarSource/sonarqube

 @Test
 public void shouldParseOnlyWantedProfile() {
  RuleFinder ruleFinder = mock(RuleFinder.class);
  when(ruleFinder.findByKey(anyString(), anyString())).thenAnswer(new Answer<Rule>() {
   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);

  assertThat(profile.getActiveRule("squid", "fake")).isNotNull();
  assertThat(profile.getActiveRule("squid", "other")).isNull();
 }
}
origin: org.codehaus.sonar-plugins.xml/sonar-xml-plugin

 @Override
 public RulesProfile createProfile(ValidationMessages validation) {
  return annotationProfileParser.parse(
    CheckRepository.REPOSITORY_KEY,
    CheckRepository.SONAR_WAY_PROFILE_NAME,
    Xml.KEY,
    CheckRepository.getCheckClasses(),
    validation);
 }
}
origin: org.codehaus.sonar-plugins.dotnet.csharp/sonar-csharp-squid-plugin

@Override
public RulesProfile createProfile(ValidationMessages validation) {
 return annotationProfileParser.parse(CSharpSquidConstants.REPOSITORY_KEY, CSharpConstants.CSHARP_WAY_PROFILE, CSharpConstants.LANGUAGE_KEY,
   CheckList.getChecks(), validation);
}
origin: octo-technology/sonar-objective-c

@Override
public RulesProfile createProfile(ValidationMessages validation) {
  return annotationProfileParser.parse(CheckList.REPOSITORY_KEY, CheckList.SONAR_WAY_PROFILE, ObjectiveC.KEY, CheckList.getChecks(), validation);
}
org.sonar.api.profilesAnnotationProfileParserparse

Popular methods of AnnotationProfileParser

  • addRule
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSharedPreferences (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • notifyDataSetChanged (ArrayAdapter)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now