Package org.sonar.api.config

Examples of org.sonar.api.config.Settings


    verify(context, times(0)).saveMeasure(eq(CoreMetrics.TESTS), any(Double.class));
  }

  @Test(expected = org.sonar.api.utils.SonarException.class)
  public void shouldThrowWhenGivenInvalidTime() {
    Settings config = new Settings();
    config.setProperty(CxxXunitSensor.REPORT_PATH_KEY, "xunit-reports/invalid-time-xunit-report.xml");
    sensor = new CxxXunitSensor(config, fs, TestUtils.mockCxxLanguage());

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


  @Test(expected = java.net.MalformedURLException.class)
  public void transformReport_shouldThrowWhenGivenNotExistingStyleSheet()
      throws java.io.IOException, javax.xml.transform.TransformerException
  {
    Settings config = new Settings();
    config.setProperty(CxxXunitSensor.XSLT_URL_KEY, "whatever");

    sensor = new CxxXunitSensor(config, fs, TestUtils.mockCxxLanguage());

    sensor.transformReport(cppunitReport());
  }
View Full Code Here

  @Test
  public void transformReport_shouldTransformCppunitReport()
      throws java.io.IOException, javax.xml.transform.TransformerException
  {
    Settings config = new Settings();
    config.setProperty(CxxXunitSensor.XSLT_URL_KEY, "cppunit-1.x-to-junit-1.0.xsl");

    sensor = new CxxXunitSensor(config, fs, TestUtils.mockCxxLanguage());
    File reportBefore = cppunitReport();

    File reportAfter = sensor.transformReport(reportBefore);
View Full Code Here

    }
    return result;
  }

  public static CxxLanguage mockCxxLanguage() {
    return new CxxLanguage(new Settings());
  }
View Full Code Here

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

    project = TestUtils.mockProject();
    fs = TestUtils.mockFileSystem();
    issuable = TestUtils.mockIssuable();
    perspectives = TestUtils.mockPerspectives(issuable);
    profile = mock(RulesProfile.class);
    settings = new Settings();
    sensor = new CxxCppCheckSensor(perspectives, settings, fs, profile);
    context = mock(SensorContext.class);
    File resourceMock = mock(File.class);
    when(context.getResource((File) anyObject())).thenReturn(resourceMock);
  }
View Full Code Here

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

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

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

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

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

    sensor.analyse(project, context);
    verify(context, times(33)).saveMeasure((File) anyObject(), any(Measure.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.