use of org.sonarlint.intellij.config.project.SonarLintProjectSettings in project sonarlint-intellij by SonarSource.
the class SonarLintConsoleTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
settings = new SonarLintProjectSettings();
console = new SonarLintConsole(project, consoleView, settings);
}
use of org.sonarlint.intellij.config.project.SonarLintProjectSettings in project sonarlint-intellij by SonarSource.
the class UpdateCheckerTest method before.
@Before
public void before() throws InvalidBindingException {
MockitoAnnotations.initMocks(this);
settings = new SonarLintProjectSettings();
settings.setProjectKey("key");
settings.setServerId("serverId");
server = createServer();
super.register(app, SonarApplication.class, mock(SonarApplication.class));
super.register(app, GlobalLogOutput.class, new GlobalLogOutput(mock(ProjectManager.class)));
when(bindingManager.getSonarQubeServer()).thenReturn(server);
when(bindingManager.getConnectedEngine()).thenReturn(engine);
updateChecker = new UpdateChecker(project, bindingManager, settings, notifications);
}
use of org.sonarlint.intellij.config.project.SonarLintProjectSettings 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.project.SonarLintProjectSettings in project sonarlint-intellij by SonarSource.
the class ServerIssueUpdaterTest method prepare.
@Before
public void prepare() throws IOException {
MockitoAnnotations.initMocks(this);
super.register(app, SonarApplication.class, mock(SonarApplication.class));
projectBaseDir = temp.newFolder().toPath();
when(indicator.isModal()).thenReturn(false);
when(project.getBasePath()).thenReturn(FileUtil.toSystemIndependentName(projectBaseDir.toString()));
settings = new SonarLintProjectSettings();
settings.setProjectKey(PROJECT_KEY);
updater = new ServerIssueUpdater(project, issueManager, settings, bindingManager, console);
}
use of org.sonarlint.intellij.config.project.SonarLintProjectSettings in project sonarlint-intellij by SonarSource.
the class SonarQubeServerMgmtPanel method unbindRemovedServers.
private void unbindRemovedServers() {
if (deletedServerIds.isEmpty()) {
return;
}
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
for (Project p : openProjects) {
SonarLintProjectSettings projectSettings = SonarLintUtils.get(p, SonarLintProjectSettings.class);
if (projectSettings.getServerId() != null && deletedServerIds.contains(projectSettings.getServerId())) {
projectSettings.setBindingEnabled(false);
projectSettings.setServerId(null);
projectSettings.setProjectKey(null);
}
}
}
Aggregations