Search in sources :

Example 1 with AnalysisMode

use of org.sonar.api.batch.AnalysisMode in project sonarqube by SonarSource.

the class DefaultPostJobContextTest method prepare.

@Before
public void prepare() {
    issueCache = mock(IssueCache.class);
    componentStore = new InputComponentStore(new PathResolver());
    settings = new MapSettings();
    analysisMode = mock(AnalysisMode.class);
    context = new DefaultPostJobContext(settings, issueCache, componentStore, analysisMode);
}
Also used : MapSettings(org.sonar.api.config.MapSettings) InputComponentStore(org.sonar.scanner.scan.filesystem.InputComponentStore) PathResolver(org.sonar.api.scan.filesystem.PathResolver) AnalysisMode(org.sonar.api.batch.AnalysisMode) IssueCache(org.sonar.scanner.issue.IssueCache) Before(org.junit.Before)

Example 2 with AnalysisMode

use of org.sonar.api.batch.AnalysisMode in project sonarqube by SonarSource.

the class DefaultSensorContextTest method prepare.

@Before
public void prepare() throws Exception {
    activeRules = new ActiveRulesBuilder().build();
    fs = new DefaultFileSystem(temp.newFolder().toPath());
    MetricFinder metricFinder = mock(MetricFinder.class);
    when(metricFinder.<Integer>findByKey(CoreMetrics.NCLOC_KEY)).thenReturn(CoreMetrics.NCLOC);
    when(metricFinder.<String>findByKey(CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION_KEY)).thenReturn(CoreMetrics.FUNCTION_COMPLEXITY_DISTRIBUTION);
    settings = new MapSettings();
    sensorStorage = mock(SensorStorage.class);
    analysisMode = mock(AnalysisMode.class);
    runtime = SonarRuntimeImpl.forSonarQube(Version.parse("5.5"), SonarQubeSide.SCANNER);
    adaptor = new DefaultSensorContext(mock(InputModule.class), settings, fs, activeRules, analysisMode, sensorStorage, runtime);
}
Also used : ActiveRulesBuilder(org.sonar.api.batch.rule.internal.ActiveRulesBuilder) MapSettings(org.sonar.api.config.MapSettings) MetricFinder(org.sonar.api.batch.measure.MetricFinder) AnalysisMode(org.sonar.api.batch.AnalysisMode) DefaultFileSystem(org.sonar.api.batch.fs.internal.DefaultFileSystem) SensorStorage(org.sonar.api.batch.sensor.internal.SensorStorage) Before(org.junit.Before)

Aggregations

Before (org.junit.Before)2 AnalysisMode (org.sonar.api.batch.AnalysisMode)2 MapSettings (org.sonar.api.config.MapSettings)2 DefaultFileSystem (org.sonar.api.batch.fs.internal.DefaultFileSystem)1 MetricFinder (org.sonar.api.batch.measure.MetricFinder)1 ActiveRulesBuilder (org.sonar.api.batch.rule.internal.ActiveRulesBuilder)1 SensorStorage (org.sonar.api.batch.sensor.internal.SensorStorage)1 PathResolver (org.sonar.api.scan.filesystem.PathResolver)1 IssueCache (org.sonar.scanner.issue.IssueCache)1 InputComponentStore (org.sonar.scanner.scan.filesystem.InputComponentStore)1