Search in sources :

Example 1 with ScannerExtensionDictionnary

use of org.sonar.scanner.bootstrap.ScannerExtensionDictionnary in project sonarqube by SonarSource.

the class SensorsExecutorTest method setUp.

@Before
public void setUp() throws IOException {
    context = mock(SensorContext.class);
    ScannerExtensionDictionnary selector = mock(ScannerExtensionDictionnary.class);
    when(selector.selectSensors(any(DefaultInputModule.class), eq(false))).thenReturn(Collections.singleton(perModuleSensor));
    when(selector.selectSensors(any(DefaultInputModule.class), eq(true))).thenReturn(Collections.singleton(globalSensor));
    DefaultInputModule rootModule = TestInputFileBuilder.newDefaultInputModule("root", temp.newFolder());
    rootModuleExecutor = new SensorsExecutor(selector, rootModule, mock(EventBus.class), strategy);
    DefaultInputModule subModule = TestInputFileBuilder.newDefaultInputModule("sub", temp.newFolder());
    rootModule.definition().addSubProject(subModule.definition());
    subModuleExecutor = new SensorsExecutor(selector, subModule, mock(EventBus.class), strategy);
}
Also used : SensorContext(org.sonar.api.batch.SensorContext) ScannerExtensionDictionnary(org.sonar.scanner.bootstrap.ScannerExtensionDictionnary) DefaultInputModule(org.sonar.api.batch.fs.internal.DefaultInputModule)

Aggregations

SensorContext (org.sonar.api.batch.SensorContext)1 DefaultInputModule (org.sonar.api.batch.fs.internal.DefaultInputModule)1 ScannerExtensionDictionnary (org.sonar.scanner.bootstrap.ScannerExtensionDictionnary)1