diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-07-20 23:53:26 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2015-07-20 23:53:26 +0200 |
commit | 2e38406b37a89770bd4817a2e31b1d7fb4e0bbb2 (patch) | |
tree | f4430af7f8f7dc90c2d55600fe78425474e0c1cf /server | |
parent | 670a6f9def17dca3ab131a1930fc2dcec5dc438f (diff) | |
download | sonarqube-2e38406b37a89770bd4817a2e31b1d7fb4e0bbb2.tar.gz sonarqube-2e38406b37a89770bd4817a2e31b1d7fb4e0bbb2.zip |
Remove unused db classes Snapshot and ResourceModel
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueComputationTest.java | 245 |
1 files changed, 0 insertions, 245 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueComputationTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueComputationTest.java deleted file mode 100644 index 47b933a4ffc..00000000000 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueComputationTest.java +++ /dev/null @@ -1,245 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * SonarQube is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -///* -// * SonarQube, open source software quality management tool. -// * Copyright (C) 2008-2014 SonarSource -// * mailto:contact AT sonarsource DOT com -// * -// * SonarQube is free software; you can redistribute it and/or -// * modify it under the terms of the GNU Lesser General Public -// * License as published by the Free Software Foundation; either -// * version 3 of the License, or (at your option) any later version. -// * -// * SonarQube is distributed in the hope that it will be useful, -// * but WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * Lesser General Public License for more details. -// * -// * You should have received a copy of the GNU Lesser General Public License -// * along with this program; if not, write to the Free Software Foundation, -// * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// */ -//package org.sonar.server.computation.issue; -// -//import com.google.common.collect.ImmutableSet; -//import com.google.common.collect.Iterators; -//import java.io.IOException; -//import java.util.Arrays; -//import org.junit.After; -//import org.junit.Before; -//import org.junit.Rule; -//import org.junit.Test; -//import org.junit.rules.TemporaryFolder; -//import org.sonar.api.CoreProperties; -//import org.sonar.api.config.Settings; -//import org.sonar.api.issue.Issue; -//import org.sonar.core.issue.DefaultIssue; -//import org.sonar.api.rule.RuleKey; -//import org.sonar.api.utils.System2; -//import org.sonar.api.utils.log.LogTester; -//import org.sonar.batch.protocol.output.BatchReport; -//import org.sonar.db.rule.RuleDto; -//import org.sonar.server.computation.batch.BatchReportReaderRule; -//import org.sonar.server.computation.component.ProjectSettingsRepository; -//import org.sonar.server.user.index.UserDoc; -//import org.sonar.server.user.index.UserIndex; -// -//import static org.assertj.core.api.Assertions.assertThat; -//import static org.mockito.Mockito.mock; -//import static org.mockito.Mockito.verifyZeroInteractions; -//import static org.mockito.Mockito.when; -// -//public class IssueComputationTest { -// -// private static final RuleKey RULE_KEY = RuleKey.of("squid", "R1"); -// private static final String PROJECT_KEY = "PROJECT_KEY"; -// -// @Rule -// public TemporaryFolder temp = new TemporaryFolder(); -// @Rule -// public LogTester logTester = new LogTester(); -// @Rule -// public BatchReportReaderRule reportReader = new BatchReportReaderRule(); -// -// IssueComputation sut; -// -// // inputs -// RuleCache ruleCache = mock(RuleCache.class); -// SourceAuthorsHolder lineCache = mock(SourceAuthorsHolder.class); -// ScmAccountToUser scmAccountToUser = mock(ScmAccountToUser.class); -// RuleDto rule = new RuleDto().setRepositoryKey(RULE_KEY.repository()).setRuleKey(RULE_KEY.rule()); -// BatchReport.Issue.Builder inputIssue = BatchReport.Issue.newBuilder() -// .setUuid("ISSUE_A") -// .setRuleRepository(RULE_KEY.repository()) -// .setRuleKey(RULE_KEY.rule()) -// .setStatus(Issue.STATUS_OPEN); -// Settings projectSettings; -// ProjectSettingsRepository projectSettingsRepository = mock(ProjectSettingsRepository.class); -// UserIndex userIndex = mock(UserIndex.class); -// -// // output -// DeprecatedIssueCache outputIssues; -// -// @Before -// public void setUp() throws IOException { -// when(ruleCache.get(RULE_KEY)).thenReturn(rule); -// outputIssues = new DeprecatedIssueCache(temp.newFile(), System2.INSTANCE); -// projectSettings = new Settings(); -// when(projectSettingsRepository.getProjectSettings(PROJECT_KEY)).thenReturn(projectSettings); -// sut = new IssueComputation(ruleCache, lineCache, scmAccountToUser, outputIssues, userIndex, projectSettingsRepository, reportReader); -// } -// -// @After -// public void after() { -// sut.afterReportProcessing(); -// } -// -// @Test -// public void store_issues_on_disk() { -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).key()).isEqualTo("ISSUE_A"); -// } -// -// @Test -// public void copy_rule_tags_on_new_issues() { -// inputIssue.setIsNew(true); -// rule.setTags(ImmutableSet.of("bug", "performance")); -// rule.setSystemTags(ImmutableSet.of("blocker")); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).tags()).containsOnly("blocker", "bug", "performance"); -// } -// -// @Test -// public void do_not_copy_rule_tags_on_existing_issues() { -// inputIssue.setIsNew(false); -// rule.setTags(ImmutableSet.of("bug", "performance")); -// rule.setSystemTags(ImmutableSet.of("blocker")); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).tags()).isEmpty(); -// } -// -// @Test -// public void guess_author_of_new_issues() { -// inputIssue.setIsNew(true); -// inputIssue.setLine(3); -// when(lineCache.lineAuthor(3)).thenReturn("charlie"); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).authorLogin()).isEqualTo("charlie"); -// } -// -// @Test -// public void do_not_fail_if_missing_author_for_new_issues() { -// inputIssue.setIsNew(true); -// inputIssue.setLine(3); -// when(lineCache.lineAuthor(3)).thenReturn(null); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).authorLogin()).isNull(); -// } -// -// @Test -// public void do_not_guess_author_of_existing_issues() { -// inputIssue.setIsNew(false); -// inputIssue.setLine(3); -// when(lineCache.lineAuthor(3)).thenReturn("charlie"); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).authorLogin()).isNull(); -// } -// -// @Test -// public void auto_assign_new_issues() { -// inputIssue.setIsNew(true); -// inputIssue.setAuthorLogin("charlie"); -// when(scmAccountToUser.getNullable("charlie")).thenReturn("char.lie"); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).assignee()).isEqualTo("char.lie"); -// } -// -// @Test -// public void do_not_auto_assign_existing_issues() { -// inputIssue.setIsNew(false); -// inputIssue.setAuthorLogin("charlie"); -// when(scmAccountToUser.getNullable("charlie")).thenReturn("char.lie"); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).assignee()).isNull(); -// } -// -// @Test -// public void do_not_override_author_and_assignee_set_by_old_batch_plugins() { -// inputIssue.setIsNew(true); -// -// // these fields were provided during project analysis, for instance -// // by developer cockpit or issue-assign plugins -// inputIssue.setAuthorLogin("charlie"); -// inputIssue.setAssignee("cabu"); -// -// process(); -// -// // keep the values, without trying to update them -// DefaultIssue cachedIssue = Iterators.getOnlyElement(outputIssues.traverse()); -// assertThat(cachedIssue.assignee()).isEqualTo("cabu"); -// assertThat(cachedIssue.authorLogin()).isEqualTo("charlie"); -// verifyZeroInteractions(scmAccountToUser); -// } -// -// @Test -// public void assign_default_assignee_when_available() { -// inputIssue.setIsNew(true); -// String wolinski = "wolinski"; -// projectSettings.setProperty(CoreProperties.DEFAULT_ISSUE_ASSIGNEE, wolinski); -// when(userIndex.getNullableByLogin(wolinski)).thenReturn(new UserDoc()); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).assignee()).isEqualTo(wolinski); -// assertThat(logTester.logs()).doesNotContain(String.format("the %s property was set with an unknown login: %s", CoreProperties.DEFAULT_ISSUE_ASSIGNEE, wolinski)); -// } -// -// @Test -// public void do_not_assign_default_assignee_when_not_found_in_index() { -// inputIssue.setIsNew(true); -// String wolinski = "wolinski"; -// projectSettings.setProperty(CoreProperties.DEFAULT_ISSUE_ASSIGNEE, wolinski); -// when(userIndex.getNullableByLogin(wolinski)).thenReturn(null); -// -// process(); -// -// assertThat(Iterators.getOnlyElement(outputIssues.traverse()).assignee()).isNull(); -// assertThat(logTester.logs()).contains(String.format("the %s property was set with an unknown login: %s", CoreProperties.DEFAULT_ISSUE_ASSIGNEE, wolinski)); -// } -// -// private void process() { -// sut.processComponentIssues(Arrays.asList(inputIssue.build()), "FILE_A", 1, PROJECT_KEY, "PROJECT_UUID"); -// } -//} |