use of org.sonarlint.intellij.ui.SonarLintConsole in project sonarlint-intellij by SonarSource.
the class SonarCleanConsoleActionTest method testAction.
@Test
public void testAction() {
AnActionEvent event = mock(AnActionEvent.class);
SonarLintConsole console = mock(SonarLintConsole.class);
when(event.getProject()).thenReturn(project);
super.register(project, SonarLintConsole.class, console);
SonarCleanConsoleAction clean = new SonarCleanConsoleAction(null, null, null);
clean.actionPerformed(event);
verify(console).clear();
}
use of org.sonarlint.intellij.ui.SonarLintConsole 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.ui.SonarLintConsole in project sonarlint-intellij by SonarSource.
the class GlobalLogOutputTest method should_not_fail_if_remove_nonexisting_console.
@Test
public void should_not_fail_if_remove_nonexisting_console() {
SonarLintConsole console = mock(SonarLintConsole.class);
output.removeConsole(console);
output.log("msg", LogOutput.Level.WARN);
}
use of org.sonarlint.intellij.ui.SonarLintConsole in project sonarlint-intellij by SonarSource.
the class ServerUpdateTask method analyzeOpenFiles.
private static void analyzeOpenFiles(Project project) {
if (!project.isDisposed()) {
SonarLintConsole console = SonarLintConsole.get(project);
console.info("Clearing all issues because binding was updated");
IssueManager store = SonarLintUtils.get(project, IssueManager.class);
store.clear();
SonarLintSubmitter submitter = SonarLintUtils.get(project, SonarLintSubmitter.class);
submitter.submitOpenFilesAuto(TriggerType.BINDING_UPDATE);
}
}
use of org.sonarlint.intellij.ui.SonarLintConsole in project sonarlint-intellij by SonarSource.
the class GlobalLogOutputTest method should_log_to_registered_consoles.
@Test
public void should_log_to_registered_consoles() {
SonarLintConsole console = mock(SonarLintConsole.class);
output.addConsole(console);
output.log("warn", LogOutput.Level.WARN);
verify(console).info("warn");
output.log("info", LogOutput.Level.INFO);
verify(console).info("info");
output.log("debug", LogOutput.Level.DEBUG);
verify(console).debug("debug");
output.log("error", LogOutput.Level.ERROR);
verify(console).error("error");
output.log("trace", LogOutput.Level.TRACE);
verify(console).debug("trace");
}
Aggregations