use of org.sonar.api.batch.fs.internal.SensorStrategy in project sonarqube by SonarSource.
the class DefaultInputFileTest method prepare.
@Before
public void prepare() throws IOException {
baseDir = temp.newFolder().toPath();
sensorStrategy = new SensorStrategy();
indexedFile = new DefaultIndexedFile(baseDir.resolve(PROJECT_RELATIVE_PATH), "ABCDE", PROJECT_RELATIVE_PATH, MODULE_RELATIVE_PATH, InputFile.Type.TEST, "php", 0, sensorStrategy);
}
use of org.sonar.api.batch.fs.internal.SensorStrategy in project sonarqube by SonarSource.
the class ModuleInputComponentStoreTest method should_find_module_components_with_non_global_strategy.
@Test
public void should_find_module_components_with_non_global_strategy() {
InputComponentStore inputComponentStore = mock(InputComponentStore.class);
SensorStrategy strategy = new SensorStrategy();
InputModule module = mock(InputModule.class);
when(module.key()).thenReturn("foo");
ModuleInputComponentStore store = new ModuleInputComponentStore(module, inputComponentStore, strategy);
strategy.setGlobal(false);
store.inputFiles();
verify(inputComponentStore).filesByModule("foo");
String relativePath = "somepath";
store.inputFile(relativePath);
verify(inputComponentStore).getFile(any(String.class), eq(relativePath));
store.languages();
verify(inputComponentStore).languages(any(String.class));
}
use of org.sonar.api.batch.fs.internal.SensorStrategy in project sonarqube by SonarSource.
the class ModuleInputComponentStoreTest method should_find_all_components_with_global_strategy.
@Test
public void should_find_all_components_with_global_strategy() {
InputComponentStore inputComponentStore = mock(InputComponentStore.class);
SensorStrategy strategy = new SensorStrategy();
ModuleInputComponentStore store = new ModuleInputComponentStore(mock(InputModule.class), inputComponentStore, strategy);
strategy.setGlobal(true);
store.inputFiles();
verify(inputComponentStore).inputFiles();
String relativePath = "somepath";
store.inputFile(relativePath);
verify(inputComponentStore).inputFile(relativePath);
store.languages();
verify(inputComponentStore).languages();
}
Aggregations