use of org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer in project sonarlint-core by SonarSource.
the class StandaloneIssueMediumTests method declare_module_should_create_a_module_container_with_loaded_extensions.
@Test
void declare_module_should_create_a_module_container_with_loaded_extensions() throws Exception {
sonarlint.declareModule(new ClientModuleInfo("key", aClientFileSystemWith(new OnDiskTestClientInputFile(Paths.get("main.py"), "main.py", false, StandardCharsets.UTF_8, null)))).get();
ComponentContainer moduleContainer = sonarlint.getAnalysisEngine().getModuleRegistry().getContainerFor("key");
assertThat(moduleContainer).isNotNull();
assertThat(moduleContainer.getComponentsByType(SonarLintModuleFileSystem.class)).isNotEmpty();
}
use of org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer in project sonarlint-core by SonarSource.
the class ConnectedIssueMediumTests method stop_module_should_stop_the_module_container.
@Test
void stop_module_should_stop_the_module_container() throws Exception {
sonarlint.declareModule(new ClientModuleInfo("key", aClientFileSystemWith(new OnDiskTestClientInputFile(Paths.get("main.py"), "main.py", false, StandardCharsets.UTF_8, null)))).get();
ComponentContainer moduleContainer = sonarlint.getAnalysisEngine().getModuleRegistry().getContainerFor("key");
sonarlint.stopModule("key").get();
assertThat(moduleContainer.getPicoContainer().getLifecycleState().isStarted()).isFalse();
}
use of org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer in project sonarlint-core by SonarSource.
the class ConnectedIssueMediumTests method declare_module_should_create_a_module_container_with_loaded_extensions.
@Test
void declare_module_should_create_a_module_container_with_loaded_extensions() throws Exception {
sonarlint.declareModule(new ClientModuleInfo("key", aClientFileSystemWith(new OnDiskTestClientInputFile(Paths.get("main.py"), "main.py", false, StandardCharsets.UTF_8, null)))).get();
ComponentContainer moduleContainer = sonarlint.getAnalysisEngine().getModuleRegistry().getContainerFor("key");
assertThat(moduleContainer).isNotNull();
assertThat(moduleContainer.getComponentsByType(SonarLintModuleFileSystem.class)).isNotEmpty();
}
use of org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer in project sonarlint-core by SonarSource.
the class StandaloneIssueMediumTests method stop_module_should_stop_the_module_container.
@Test
void stop_module_should_stop_the_module_container() throws Exception {
sonarlint.declareModule(new ClientModuleInfo("key", aClientFileSystemWith(new OnDiskTestClientInputFile(Paths.get("main.py"), "main.py", false, StandardCharsets.UTF_8, null)))).get();
ComponentContainer moduleContainer = sonarlint.getAnalysisEngine().getModuleRegistry().getContainerFor("key");
sonarlint.stopModule("key").get();
assertThat(moduleContainer.getPicoContainer().getLifecycleState().isStarted()).isFalse();
}
Aggregations