Package org.sonar.api.config

Examples of org.sonar.api.config.Settings


  private Settings config;

  @Before
  public void setup() {
    config = new Settings();
  }
View Full Code Here


  private Issuable issuable;
  private ResourcePerspectives perspectives;

  private CxxCompilerSensor createSensor(String parser)
  {
      Settings settings = new Settings();
      settings.setProperty("sonar.cxx.compiler.parser", parser);
      return new CxxCompilerSensor(perspectives, settings, TestUtils.mockFileSystem(), profile);
  }
View Full Code Here

  @Before
  public void setUp() {
    project = TestUtils.mockProject();
    issuable = TestUtils.mockIssuable();
    perspectives = TestUtils.mockPerspectives(issuable);
    sensor = new CxxRatsSensor(perspectives, new Settings(), TestUtils.mockFileSystem(), mock(RulesProfile.class));
    context = mock(SensorContext.class);
    File resourceMock = mock(File.class);
    when(context.getResource((File) anyObject())).thenReturn(resourceMock);
  }
View Full Code Here

public class CxxRatsRuleRepositoryTest {
  @Test
  public void createRulesTest() {
    CxxRatsRuleRepository rulerep = new CxxRatsRuleRepository(
        mock(ServerFileSystem.class), new XMLRuleParser(), new Settings());
    assertThat(rulerep.createRules()).hasSize(301);
  }
View Full Code Here

  @Test
  public void createRulesTest() {
    CxxPCLintRuleRepository rulerep = new CxxPCLintRuleRepository(
        mock(ServerFileSystem.class),
        new XMLRuleParser(), new Settings());
    assertEquals(1443, rulerep.createRules().size());
  }
View Full Code Here

    when(context.getResource((File) anyObject())).thenReturn(resourceMock);
  }

  @Test
  public void shouldReportCorrectViolations() {
    Settings settings = new Settings();
    settings.setProperty(CxxPCLintSensor.REPORT_PATH_KEY, "pclint-reports/pclint-result-SAMPLE.xml");
    CxxPCLintSensor sensor = new CxxPCLintSensor(perspectives, settings, fs, profile);
    sensor.analyse(project, context);
    verify(issuable, times(15)).addIssue(any(Issue.class));
  }
View Full Code Here

    verify(issuable, times(15)).addIssue(any(Issue.class));
  }

  @Test
  public void shouldReportCorrectMisra2004Violations() {
    Settings settings = new Settings();
    settings.setProperty(CxxPCLintSensor.REPORT_PATH_KEY, "pclint-reports/pclint-result-MISRA2004-SAMPLE.xml");
    CxxPCLintSensor sensor = new CxxPCLintSensor(perspectives, settings, fs, profile);
    sensor.analyse(project, context);
    verify(issuable, times(29)).addIssue(any(Issue.class));
  }
View Full Code Here

    verify(issuable, times(29)).addIssue(any(Issue.class));
  }

  @Test(expected=SonarException.class)
  public void shouldThrowExceptionWhenMisra2004DescIsWrong() {
    Settings settings = new Settings();
    settings.setProperty(CxxPCLintSensor.REPORT_PATH_KEY, "pclint-reports/incorrect-pclint-MISRA2004-desc.xml");
    CxxPCLintSensor sensor = new CxxPCLintSensor(perspectives, settings, fs, profile);
    sensor.analyse(project, context);
  }
View Full Code Here

    sensor.analyse(project, context);
  }

  @Test(expected=SonarException.class)
  public void shouldThrowExceptionWhenMisra2004RuleDoNotExist() {
    Settings settings = new Settings();
    settings.setProperty(CxxPCLintSensor.REPORT_PATH_KEY, "pclint-reports/incorrect-pclint-MISRA2004-rule-do-not-exist.xml");
    CxxPCLintSensor sensor = new CxxPCLintSensor(perspectives, settings, fs, profile);
    sensor.analyse(project, context);
  }
View Full Code Here

    sensor.analyse(project, context);
  }

  @Test
  public void shouldNotRemapMisra1998Rules() {
    Settings settings = new Settings();
    settings.setProperty(CxxPCLintSensor.REPORT_PATH_KEY, "pclint-reports/pclint-result-MISRA1998-SAMPLE.xml");
    CxxPCLintSensor sensor = new CxxPCLintSensor(perspectives, settings, fs, profile);
    sensor.analyse(project, context);
    verify(issuable, times(1)).addIssue(any(Issue.class));
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.config.Settings

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.