use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class ProjectBindingManagerTest method setUp.
@Before
public void setUp() throws InvalidBindingException {
SonarLintConsole console = mock(SonarLintConsole.class);
Project project = mock(Project.class);
engineManager = mock(SonarLintEngineManager.class);
SonarLintProjectNotifications notifications = mock(SonarLintProjectNotifications.class);
standaloneEngine = mock(StandaloneSonarLintEngine.class);
connectedEngine = mock(ConnectedSonarLintEngine.class);
settings = new SonarLintProjectSettings();
globalSettings = new SonarLintGlobalSettings();
when(engineManager.getStandaloneEngine()).thenReturn(standaloneEngine);
when(engineManager.getConnectedEngine(any(SonarLintProjectNotifications.class), anyString(), anyString())).thenReturn(connectedEngine);
when(project.getBasePath()).thenReturn("");
projectBindingManager = new ProjectBindingManager(project, engineManager, settings, globalSettings, notifications, console);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class SonarLintEngineManagerTest method setUp.
@Before
public void setUp() {
globalSettings = new SonarLintGlobalSettings();
engineFactory = mock(SonarLintEngineFactory.class);
notifications = mock(SonarLintProjectNotifications.class);
connectedEngine = mock(ConnectedSonarLintEngine.class);
standaloneEngine = mock(StandaloneSonarLintEngine.class);
when(engineFactory.createEngine(anyString())).thenReturn(connectedEngine);
when(engineFactory.createEngine()).thenReturn(standaloneEngine);
manager = new SonarLintEngineManager(globalSettings, engineFactory);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class AutoTriggerStatusPanel method subscribeToEvents.
private void subscribeToEvents() {
MessageBusConnection busConnection = project.getMessageBus().connect(project);
busConnection.subscribe(GlobalConfigurationListener.TOPIC, new GlobalConfigurationListener.Adapter() {
@Override
public void applied(SonarLintGlobalSettings settings) {
switchCards();
}
});
busConnection.subscribe(ProjectConfigurationListener.TOPIC, s -> switchCards());
busConnection.subscribe(PowerSaveMode.TOPIC, this::switchCards);
busConnection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerAdapter() {
@Override
public void selectionChanged(@NotNull FileEditorManagerEvent event) {
switchCards();
}
});
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class EditorOpenTriggerTest method start.
@Before
public void start() {
MockitoAnnotations.initMocks(this);
SonarLintTestUtils.mockMessageBus(project);
globalSettings = new SonarLintGlobalSettings();
globalSettings.setAutoTrigger(true);
editorTrigger = new EditorOpenTrigger(project, submitter, globalSettings);
}
use of org.sonarlint.intellij.config.global.SonarLintGlobalSettings in project sonarlint-intellij by SonarSource.
the class SonarLintCheckinHandlerFactoryTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
SonarLintGlobalSettings settings = new SonarLintGlobalSettings();
when(panel.getVirtualFiles()).thenReturn(Collections.singletonList(file));
when(panel.getProject()).thenReturn(project);
sonarLintCheckinHandlerFactory = new SonarLintCheckinHandlerFactory(settings);
}
Aggregations