use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class LocalFileExclusions method subscribeToSettingsChanges.
private void subscribeToSettingsChanges(Project project) {
MessageBusConnection busConnection = project.getMessageBus().connect(project);
busConnection.subscribe(GlobalConfigurationListener.TOPIC, new GlobalConfigurationListener.Adapter() {
@Override
public void applied(SonarLintGlobalSettings newSettings) {
loadGlobalExclusions(newSettings);
}
});
busConnection.subscribe(ProjectConfigurationListener.TOPIC, this::loadProjectExclusions);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class EditorChangeTriggerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
SonarLintTestUtils.mockMessageBus(project);
when(editorFactory.getEventMulticaster()).thenReturn(mock(EditorEventMulticaster.class));
globalSettings = new SonarLintGlobalSettings();
globalSettings.setAutoTrigger(true);
listener = new EditorChangeTrigger(project, globalSettings, submitter, editorFactory, utils, docManager, 500);
listener.initComponent();
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class SonarLintCheckinHandlerTest method prepare.
@Before
public void prepare() {
globalSettings = new SonarLintGlobalSettings();
future = new CompletableFuture<>();
super.register(project, SonarLintSubmitter.class, submitter);
super.register(project, AnalysisResultIssues.class, analysisResultIssues);
super.register(project, IssueManager.class, issueManager);
when(checkinProjectPanel.getVirtualFiles()).thenReturn(Collections.singleton(file));
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class SonarLintSubmitterTest method start.
@Before
public void start() throws InvalidBindingException {
when(bindingManager.getFacade()).thenReturn(facade);
when(facade.getExcluded(anyCollection(), any(Predicate.class))).thenReturn(Collections.emptySet());
globalSettings = new SonarLintGlobalSettings();
globalSettings.setAutoTrigger(true);
super.register(module, VirtualFileTestPredicate.class, testPredicate);
submitter = new SonarLintSubmitter(project, console, fileEditorManager, sonarLintJobManager, globalSettings, utils, exclusions, bindingManager);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class GlobalConfigurationListenerTest method testApplied.
@Test
public void testApplied() {
List<SonarQubeServer> servers = new LinkedList<>();
AtomicBoolean bool = new AtomicBoolean(false);
GlobalConfigurationListener listener = new GlobalConfigurationListener.Adapter() {
@Override
public void applied(SonarLintGlobalSettings settings) {
servers.addAll(settings.getSonarQubeServers());
bool.set(settings.isAutoTrigger());
}
};
project.getMessageBus().connect().subscribe(GlobalConfigurationListener.TOPIC, listener);
SonarLintGlobalSettings settings = new SonarLintGlobalSettings();
settings.setSonarQubeServers(testList);
settings.setAutoTrigger(true);
project.getMessageBus().syncPublisher(GlobalConfigurationListener.TOPIC).applied(settings);
assertThat(servers).isEqualTo(testList);
assertThat(bool.get()).isTrue();
}
Aggregations