Package org.sonar.api.config

Examples of org.sonar.api.config.PropertyDefinitions


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.
View Full Code Here


  }

  @Test
  public void shouldNotDeleteHistoricalDataOfDirectories() {
    PurgeDao purgeDao = mock(PurgeDao.class);
    Settings settings = new Settings(new PropertyDefinitions(DbCleanerProperties.all()));
    settings.setProperty(DbCleanerConstants.PROPERTY_CLEAN_DIRECTORY, "false");
    DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, resourceDao, settings, mock(DefaultPeriodCleaner.class), mock(PurgeProfiler.class));

    task.purge(1L);
View Full Code Here

  }

  @Test
  public void shouldDeleteHistoricalDataOfDirectoriesByDefault() {
    PurgeDao purgeDao = mock(PurgeDao.class);
    Settings settings = new Settings(new PropertyDefinitions(DbCleanerProperties.all()));
    DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, resourceDao, settings, mock(DefaultPeriodCleaner.class), mock(PurgeProfiler.class));

    task.purge(1L);

    verify(purgeDao).purge(argThat(new ArgumentMatcher<PurgeConfiguration>() {
View Full Code Here

  @Test
  public void shouldDumpProfiling() {
    PurgeConfiguration conf = new PurgeConfiguration(1L, new String[0], 30);
    PurgeDao purgeDao = mock(PurgeDao.class);
    when(purgeDao.purge(conf)).thenThrow(new RuntimeException());
    Settings settings = new Settings(new PropertyDefinitions(DbCleanerProperties.all()));
    settings.setProperty(CoreProperties.PROFILING_LOG_PROPERTY, true);
    PurgeProfiler profiler = mock(PurgeProfiler.class);

    DefaultPurgeTask task = new DefaultPurgeTask(purgeDao, resourceDao, settings, mock(DefaultPeriodCleaner.class), profiler);
    task.purge(1L);
View Full Code Here

  @Before
  public void setUp() {
    IndexFactory indexFactory = mock(IndexFactory.class);
    sonarEngine = new JavaCpdEngine(indexFactory, null, null);
    sonarBridgeEngine = new DefaultCpdEngine(indexFactory, new CpdMappings(), null, null, mock(BlockCache.class));
    settings = new Settings(new PropertyDefinitions(CpdPlugin.class));

    DefaultFileSystem fs = new DefaultFileSystem();
    sensor = new CpdSensor(sonarEngine, sonarBridgeEngine, settings, fs);
  }
View Full Code Here

  private CoverageMeasurementFilter filter;

  @Before
  public void createFilter() {
    settings = new Settings(new PropertyDefinitions(ExclusionProperties.all()));
    filter = new CoverageMeasurementFilter(settings, new CoverageDecorator(), new LineCoverageDecorator(), new BranchCoverageDecorator());
  }
View Full Code Here

  @Before
  public void prepare() {
    projectRef = new ProjectReferentials();
    mode = mock(AnalysisMode.class);
    bootstrapProps = new GlobalSettings(new BootstrapProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), new GlobalReferentials(), mode);
  }
View Full Code Here

  @Test
  public void should_load_project_props() {
    project.setProperty("project.prop", "project");

    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, new PropertyDefinitions(), projectRef, mode);

    assertThat(batchSettings.getString("project.prop")).isEqualTo("project");
  }
View Full Code Here

  @Test
  public void should_load_project_root_settings() {
    projectRef.addSettings("struts", ImmutableMap.of("sonar.cpd.cross", "true", "sonar.java.coveragePlugin", "jacoco"));

    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, new PropertyDefinitions(), projectRef, mode);

    assertThat(batchSettings.getString("sonar.java.coveragePlugin")).isEqualTo("jacoco");
  }
View Full Code Here

  public void should_load_project_root_settings_on_branch() {
    project.setProperty(CoreProperties.PROJECT_BRANCH_PROPERTY, "mybranch");

    projectRef.addSettings("struts:mybranch", ImmutableMap.of("sonar.cpd.cross", "true", "sonar.java.coveragePlugin", "jacoco"));

    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, new PropertyDefinitions(), projectRef, mode);

    assertThat(batchSettings.getString("sonar.java.coveragePlugin")).isEqualTo("jacoco");
  }
View Full Code Here

TOP

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

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.