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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • scheduleAtFixedRate (Timer)
  • getSharedPreferences (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Join (org.hibernate.mapping)
  • Top 17 Free Sublime Text Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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