Package org.sonar.api.config

Examples of org.sonar.api.config.Settings


    verify(context, times(33)).saveMeasure((File) anyObject(), any(Measure.class));
  }
 
  @Test
  public void shouldReportCorrectCoverageForAllTypesOfCoverage() {
    Settings settings = new Settings();
    settings.setProperty(CxxCoverageSensor.REPORT_PATH_KEY, "coverage-reports/cobertura/coverage-result-cobertura.xml");
    settings.setProperty(CxxCoverageSensor.IT_REPORT_PATH_KEY, "coverage-reports/cobertura/coverage-result-cobertura.xml");
    settings.setProperty(CxxCoverageSensor.OVERALL_REPORT_PATH_KEY, "coverage-reports/cobertura/coverage-result-cobertura.xml");
   
    sensor = new CxxCoverageSensor(settings, fs);

    sensor.analyse(project, context);
    verify(context, times(99)).saveMeasure((File) anyObject(), any(Measure.class));
View Full Code Here


    verify(context, times(99)).saveMeasure((File) anyObject(), any(Measure.class));
  }

  @Test
  public void shouldReportNoCoverageSaved() {
    sensor = new CxxCoverageSensor(new Settings(), fs);
    when(context.getResource((File) anyObject())).thenReturn(null);
    sensor.analyse(project, context);
    verify(context, times(0)).saveMeasure((File) anyObject(), any(Measure.class));
  }
View Full Code Here

    verify(context, times(0)).saveMeasure((File) anyObject(), any(Measure.class));
  }

  @Test
  public void shouldNotCrashWhenProcessingReportsContainingBigNumberOfHits() {
    Settings settings = new Settings();
    settings.setProperty(CxxCoverageSensor.REPORT_PATH_KEY, "coverage-reports/cobertura/specific-cases/cobertura-bignumberofhits.xml");
    sensor = new CxxCoverageSensor(settings, fs);

    sensor.analyse(project, context);
 
View Full Code Here

    sensor.analyse(project, context);
 
 
  @Test
  public void shouldReportNoCoverageWhenInvalidFilesEmpty() {
    Settings settings = new Settings();
    settings.setProperty(CxxCoverageSensor.REPORT_PATH_KEY, "coverage-reports/cobertura/specific-cases/coverage-result-cobertura-empty.xml");
    sensor = new CxxCoverageSensor(settings, fs);

    sensor.analyse(project, context);
   
    verify(context, times(0)).saveMeasure((File) anyObject(), any(Measure.class));
View Full Code Here

  private Settings settings;
  private ModuleFileSystem fs;

  @Before
  public void init() {
    settings = new Settings();
    fs = TestUtils.mockFileSystem();
    sensor = new CxxReportSensorImpl(settings, fs);
    try {
      baseDir = new File(getClass().getResource("/org/sonar/plugins/cxx/reports-project/").toURI());
    } catch (java.net.URISyntaxException e) {
View Full Code Here

    verify(context, times(0)).saveMeasure((File) anyObject(), any(Measure.class));
  }
 
  @Test
  public void shouldReportNoCoverageWhenInvalidFilesInvalid() {
    Settings settings = new Settings();
    settings.setProperty(CxxCoverageSensor.REPORT_PATH_KEY, "coverage-reports/cobertura/specific-cases/coverage-result-invalid.xml");
    sensor = new CxxCoverageSensor(settings, fs);

    sensor.analyse(project, context);
   
    verify(context, times(0)).saveMeasure((File) anyObject(), any(Measure.class));
View Full Code Here

    assertFound(reports);
  }

  @Test
  public void getReports_shouldFindNothingIfNotThere() {
    List<File> reports = sensor.getReports(new Settings(), baseDir.getPath(),
        "", INVALID_REPORT_PATH);
    assertNotFound(reports);
  }
View Full Code Here

public class CxxSourceImporterTest {
  @Test
  public void testSourceImporter() {
    SensorContext context = mock(SensorContext.class);
    Project project = mockProject();
    Settings config = new Settings(new PropertyDefinitions(CxxPlugin.class));
    config.setProperty(CoreProperties.CORE_IMPORT_SOURCES_PROPERTY, true);
    CxxSourceImporter importer = new CxxSourceImporter(TestUtils.mockCxxLanguage());
    importer.shouldExecuteOnProject(project); // thats necessary: it gets the importer
                                              // into desired shape. Bad.

    importer.analyse(project, context);
View Full Code Here

  @Test
  public void createVcRulesTest() {
    CxxCompilerVcRuleRepository rulerep = new CxxCompilerVcRuleRepository(
        mock(ServerFileSystem.class),
        new XMLRuleParser(), new Settings());
    assertThat(rulerep.createRules()).hasSize(693);
  }
View Full Code Here

  @Test
  public void createGccRulesTest() {
    CxxCompilerGccRuleRepository rulerep = new CxxCompilerGccRuleRepository(
        mock(ServerFileSystem.class),
        new XMLRuleParser(), new Settings());
    assertThat(rulerep.createRules()).hasSize(160);
  }
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.