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);
}
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);
}
Aggregations