aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2015-07-07 11:04:36 +0200
committerDavid Gageot <david@gageot.net>2015-07-07 11:36:26 +0200
commitf0390ff8452ea1aecf060e70d27e21e1c04629a7 (patch)
treede04b6e5d166c3f6f892fa8d74508a8552d2fe49
parent0159164dba722d784ecd98fb94b80ff63a50649b (diff)
downloadsonarqube-f0390ff8452ea1aecf060e70d27e21e1c04629a7.tar.gz
sonarqube-f0390ff8452ea1aecf060e70d27e21e1c04629a7.zip
FIX Redundant throws clause
-rw-r--r--it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java2
-rw-r--r--it/it-tests/src/test/java/qualitygate/QualityGateTest.java2
-rw-r--r--server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java18
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java12
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java34
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java12
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java42
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java16
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java16
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java24
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java8
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java28
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java14
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java26
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java12
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java6
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java4
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java4
-rw-r--r--sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java2
-rw-r--r--sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java2
97 files changed, 307 insertions, 307 deletions
diff --git a/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java b/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
index 582cb58fd0b..70467aeb4d8 100644
--- a/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
+++ b/it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
@@ -43,7 +43,7 @@ public class QualityGateNotificationTest {
.build();
@Before
- public void cleanUp() throws Exception {
+ public void cleanUp() {
orchestrator.resetData();
}
diff --git a/it/it-tests/src/test/java/qualitygate/QualityGateTest.java b/it/it-tests/src/test/java/qualitygate/QualityGateTest.java
index e13f8bb07d5..5f975e93a21 100644
--- a/it/it-tests/src/test/java/qualitygate/QualityGateTest.java
+++ b/it/it-tests/src/test/java/qualitygate/QualityGateTest.java
@@ -38,7 +38,7 @@ public class QualityGateTest {
.build();
@Before
- public void cleanUp() throws Exception {
+ public void cleanUp() {
orchestrator.resetData();
provisionnedProjectId = Long.parseLong(orchestrator.getServer().adminWsClient().projectClient().create(NewProject.create().key(PROJECT_KEY).name("Sample")).id());
}
diff --git a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
index d37f29b87ce..86663dde0d4 100644
--- a/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
+++ b/server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
@@ -60,7 +60,7 @@ public class SourceDbBenchmarkTest {
scrollRows();
}
- private void scrollRows() throws Exception {
+ private void scrollRows() {
LOGGER.info("Scroll table FILE_SOURCES");
AtomicLong counter = new AtomicLong();
ProgressTask progress = new ProgressTask(LOGGER, "source file", counter);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java
index d464a499447..b84d328453d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java
@@ -40,7 +40,7 @@ public class ActivityResultSetIteratorTest {
public DbTester dbTester = DbTester.create(System2.INSTANCE);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java
index 6c992f9219b..009d79afd9a 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class BatchWsModuleTest {
@Test
- public void verify_count_of_added_components() throws Exception {
+ public void verify_count_of_added_components() {
ComponentContainer container = new ComponentContainer();
new BatchWsModule().configure(container);
assertThat(container.size()).isEqualTo(10);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
index 88d39c64ace..597e5a68a69 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
@@ -498,7 +498,7 @@ public class ComponentDaoTest {
}
@Test
- public void select_ghost_projects() throws Exception {
+ public void select_ghost_projects() {
db.prepareDbUnit(getClass(), "select_ghost_projects.xml");
List<ComponentDto> result = sut.selectGhostProjects(session, null, new SearchOptions());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java
index 935104f93cb..9a9e266b62b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java
@@ -58,12 +58,12 @@ public class ComputationServiceTest {
ComputationService sut;
@Before
- public void setUp() throws IOException {
+ public void setUp() {
sut = new ComputationService(new ReportQueue.Item(dto, new File("Do_not_care")), steps, activityManager, system);
}
@Test
- public void process_new_project() throws Exception {
+ public void process_new_project() {
logTester.setLevel(LoggerLevel.INFO);
when(steps.instances()).thenReturn(Arrays.asList(projectStep1, projectStep2));
@@ -85,7 +85,7 @@ public class ComputationServiceTest {
}
@Test
- public void debug_logs() throws Exception {
+ public void debug_logs() {
when(steps.instances()).thenReturn(Collections.<ComputationStep>emptyList());
logTester.setLevel(LoggerLevel.DEBUG);
@@ -95,7 +95,7 @@ public class ComputationServiceTest {
}
@Test
- public void fail_if_step_throws_error() throws Exception {
+ public void fail_if_step_throws_error() {
String errorMessage = "Failed to unzip";
when(steps.instances()).thenReturn(ImmutableList.of(projectStep1));
doThrow(new IllegalStateException(errorMessage)).when(projectStep1).execute();
@@ -111,7 +111,7 @@ public class ComputationServiceTest {
}
@Test
- public void step_error() throws Exception {
+ public void step_error() {
when(steps.instances()).thenReturn(Arrays.asList(projectStep1));
doThrow(new IllegalStateException("pb")).when(projectStep1).execute();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java
index 137eb422086..ffd733514de 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java
@@ -80,7 +80,7 @@ public class ReportQueueTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
session.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java
index a10fd58206d..f580fd25d79 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java
@@ -49,7 +49,7 @@ public class ActivityManagerTest {
ActivityManager underTest;
@Before
- public void setup() throws Exception {
+ public void setup() {
dbTester.truncateTables();
DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao());
@@ -57,7 +57,7 @@ public class ActivityManagerTest {
}
@Test
- public void process_existing_project() throws Exception {
+ public void process_existing_project() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
underTest.saveActivity(reportDto);
@@ -72,7 +72,7 @@ public class ActivityManagerTest {
}
@Test
- public void process_new_project() throws Exception {
+ public void process_new_project() {
underTest.saveActivity(reportDto);
// execute only the steps supporting the project qualifier
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java
index f09ed4bf395..ebcf74bcb35 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java
@@ -62,7 +62,7 @@ public class BatchReportReaderImplTest {
private FileStructure fileStructure;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
BatchReportDirectoryHolder holder = new ImmutableBatchReportDirectoryHolder(tempFolder.newDir());
underTest = new BatchReportReaderImpl(holder);
writer = new BatchReportWriter(holder.getDirectory());
@@ -257,7 +257,7 @@ public class BatchReportReaderImplTest {
}
@Test
- public void verify_readTests() throws IOException {
+ public void verify_readTests() {
writer.writeTests(COMPONENT_REF, of(TEST_1, TEST_2));
CloseableIterator<BatchReport.Test> res = underTest.readTests(COMPONENT_REF);
@@ -271,7 +271,7 @@ public class BatchReportReaderImplTest {
}
@Test
- public void verify_readCoverageDetails() throws IOException {
+ public void verify_readCoverageDetails() {
writer.writeCoverageDetails(COMPONENT_REF, of(COVERAGE_DETAIL_1, COVERAGE_DETAIL_2));
CloseableIterator<BatchReport.CoverageDetail> res = underTest.readCoverageDetails(COMPONENT_REF);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java
index 4a1807b62f7..e71f43b906c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java
@@ -68,21 +68,21 @@ public class ComponentImplTest {
}
@Test
- public void get_name_from_batch_component() throws Exception {
+ public void get_name_from_batch_component() {
String name = "project";
ComponentImpl component = new ComponentImpl(BatchReport.Component.newBuilder().setName(name).build(), EMPTY_CHILD_LIST);
assertThat(component.getName()).isEqualTo(name);
}
@Test
- public void get_version_from_batch_component() throws Exception {
+ public void get_version_from_batch_component() {
String version = "1.0";
ComponentImpl component = new ComponentImpl(BatchReport.Component.newBuilder().setVersion(version).build(), EMPTY_CHILD_LIST);
assertThat(component.getVersion()).isEqualTo(version);
}
@Test
- public void getFileAttributes_throws_ISE_if_BatchComponent_does_not_have_type_FILE() throws Exception {
+ public void getFileAttributes_throws_ISE_if_BatchComponent_does_not_have_type_FILE() {
for (ComponentType componentType : from(asList(ComponentType.values())).filter(not(equalTo(ComponentType.FILE)))) {
ComponentImpl component = new ComponentImpl(BatchReport.Component.newBuilder().setType(componentType).build(), EMPTY_CHILD_LIST);
try {
@@ -95,14 +95,14 @@ public class ComponentImplTest {
}
@Test
- public void isUnitTest_returns_true_if_IsTest_is_set_in_BatchComponent() throws Exception {
+ public void isUnitTest_returns_true_if_IsTest_is_set_in_BatchComponent() {
ComponentImpl component = new ComponentImpl(BatchReport.Component.newBuilder().setType(ComponentType.FILE).setIsTest(true).build(), EMPTY_CHILD_LIST);
assertThat(component.getFileAttributes().isUnitTest()).isTrue();
}
@Test
- public void isUnitTest_returns_value_of_language_of_BatchComponent() throws Exception {
+ public void isUnitTest_returns_value_of_language_of_BatchComponent() {
String languageKey = "some language key";
ComponentImpl component = new ComponentImpl(BatchReport.Component.newBuilder().setType(ComponentType.FILE).setLanguage(languageKey).build(), EMPTY_CHILD_LIST);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java
index f7f8f5f3675..d2f1550826f 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java
@@ -29,57 +29,57 @@ import static org.sonar.server.computation.component.Component.Type.PROJECT;
public class ComponentTest {
@Test
- public void verify_type_is_deeper_than_when_comparing_to_itself() throws Exception {
+ public void verify_type_is_deeper_than_when_comparing_to_itself() {
for (Component.Type type : Component.Type.values()) {
assertThat(type.isDeeperThan(type)).isFalse();
}
}
@Test
- public void FILE_type_is_deeper_than_all_other_types() throws Exception {
+ public void FILE_type_is_deeper_than_all_other_types() {
assertThat(Component.Type.FILE.isDeeperThan(DIRECTORY)).isTrue();
assertThat(Component.Type.FILE.isDeeperThan(MODULE)).isTrue();
assertThat(Component.Type.FILE.isDeeperThan(PROJECT)).isTrue();
}
@Test
- public void DIRECTORY_type_is_deeper_than_MODULE_and_PROJECT() throws Exception {
+ public void DIRECTORY_type_is_deeper_than_MODULE_and_PROJECT() {
assertThat(Component.Type.DIRECTORY.isDeeperThan(MODULE)).isTrue();
assertThat(Component.Type.DIRECTORY.isDeeperThan(PROJECT)).isTrue();
}
@Test
- public void MODULE_type_is_deeper_than_PROJECT() throws Exception {
+ public void MODULE_type_is_deeper_than_PROJECT() {
assertThat(Component.Type.MODULE.isDeeperThan(PROJECT)).isTrue();
}
@Test
- public void FILE_type_is_higher_than_no_other_types() throws Exception {
+ public void FILE_type_is_higher_than_no_other_types() {
assertThat(Component.Type.FILE.isHigherThan(DIRECTORY)).isFalse();
assertThat(Component.Type.FILE.isHigherThan(MODULE)).isFalse();
assertThat(Component.Type.FILE.isHigherThan(PROJECT)).isFalse();
}
@Test
- public void DIRECTORY_type_is_higher_than_FILE() throws Exception {
+ public void DIRECTORY_type_is_higher_than_FILE() {
assertThat(Component.Type.DIRECTORY.isHigherThan(FILE)).isTrue();
}
@Test
- public void MODULE_type_is_higher_than_FILE_AND_DIRECTORY() throws Exception {
+ public void MODULE_type_is_higher_than_FILE_AND_DIRECTORY() {
assertThat(Component.Type.MODULE.isHigherThan(FILE)).isTrue();
assertThat(Component.Type.MODULE.isHigherThan(DIRECTORY)).isTrue();
}
@Test
- public void PROJECT_type_is_higher_than_all_other_types() throws Exception {
+ public void PROJECT_type_is_higher_than_all_other_types() {
assertThat(Component.Type.PROJECT.isHigherThan(FILE)).isTrue();
assertThat(Component.Type.PROJECT.isHigherThan(DIRECTORY)).isTrue();
assertThat(Component.Type.PROJECT.isHigherThan(MODULE)).isTrue();
}
@Test
- public void any_type_is_not_higher_than_itself() throws Exception {
+ public void any_type_is_not_higher_than_itself() {
assertThat(Component.Type.FILE.isHigherThan(FILE)).isFalse();
assertThat(Component.Type.DIRECTORY.isHigherThan(DIRECTORY)).isFalse();
assertThat(Component.Type.MODULE.isHigherThan(MODULE)).isFalse();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java
index c614a8bf6dc..692ccac4dc3 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java
@@ -34,7 +34,7 @@ public class DbIdsRepositoryTest {
Component component = DumbComponent.DUMB_PROJECT;
@Test
- public void add_and_get_component_id() throws Exception {
+ public void add_and_get_component_id() {
DbIdsRepository cache = new DbIdsRepository();
cache.setComponentId(component, 10L);
@@ -42,7 +42,7 @@ public class DbIdsRepositoryTest {
}
@Test
- public void fail_to_get_component_id_on_unknown_ref() throws Exception {
+ public void fail_to_get_component_id_on_unknown_ref() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Component ref '" + component.getRef() + "' has no component id");
@@ -50,7 +50,7 @@ public class DbIdsRepositoryTest {
}
@Test
- public void fail_if_component_id_already_set() throws Exception {
+ public void fail_if_component_id_already_set() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Component ref '" + component.getRef() + "' has already a component id");
@@ -60,7 +60,7 @@ public class DbIdsRepositoryTest {
}
@Test
- public void add_and_get_snapshot_id() throws Exception {
+ public void add_and_get_snapshot_id() {
DbIdsRepository cache = new DbIdsRepository();
cache.setSnapshotId(component, 100L);
@@ -68,7 +68,7 @@ public class DbIdsRepositoryTest {
}
@Test
- public void fail_to_get_snapshot_id_on_unknown_ref() throws Exception {
+ public void fail_to_get_snapshot_id_on_unknown_ref() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Component ref '" + component.getRef() + "' has no snapshot id");
@@ -76,7 +76,7 @@ public class DbIdsRepositoryTest {
}
@Test
- public void fail_if_snapshot_id_already_set() throws Exception {
+ public void fail_if_snapshot_id_already_set() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Component ref '" + component.getRef() + "' has already a snapshot id");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java
index 4927cbe63c9..c31e0bac01f 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java
@@ -66,12 +66,12 @@ public class ProjectSettingsRepositoryTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
session.close();
}
@Test
- public void get_project_settings_from_global_settings() throws Exception {
+ public void get_project_settings_from_global_settings() {
globalSettings.setProperty("key", "value");
Settings settings = sut.getProjectSettings(PROJECT_KEY);
@@ -80,7 +80,7 @@ public class ProjectSettingsRepositoryTest {
}
@Test
- public void get_project_settings_from_db() throws Exception {
+ public void get_project_settings_from_db() {
ComponentDto project = ComponentTesting.newProjectDto().setKey(PROJECT_KEY);
dbClient.componentDao().insert(session, project);
dbClient.propertiesDao().setProperty(new PropertyDto().setResourceId(project.getId()).setKey("key").setValue("value"), session);
@@ -92,7 +92,7 @@ public class ProjectSettingsRepositoryTest {
}
@Test
- public void call_twice_get_project_settings() throws Exception {
+ public void call_twice_get_project_settings() {
globalSettings.setProperty("key", "value");
Settings settings = sut.getProjectSettings(PROJECT_KEY);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java
index 52c8bdb3c0a..6f9447cfb82 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java
@@ -52,7 +52,7 @@ public class TreeRootHolderImplTest {
}
@Test
- public void get_by_ref() throws Exception {
+ public void get_by_ref() {
Component file = DumbComponent.builder(Component.Type.FILE, 4).build();
Component directory = DumbComponent.builder(Component.Type.DIRECTORY, 3).addChildren(file).build();
Component module = DumbComponent.builder(Component.Type.MODULE, 2).addChildren(directory).build();
@@ -66,13 +66,13 @@ public class TreeRootHolderImplTest {
}
@Test
- public void fail_to_get_by_ref_if_root_not_set() throws Exception {
+ public void fail_to_get_by_ref_if_root_not_set() {
thrown.expect(IllegalStateException.class);
treeRootHolder.getComponentByRef(project.getRef());
}
@Test
- public void fail_to_get_by_ref_if_ref_not_found() throws Exception {
+ public void fail_to_get_by_ref_if_ref_not_found() {
thrown.expect(IllegalArgumentException.class);
treeRootHolder.setRoot(project);
treeRootHolder.getComponentByRef(123);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java
index 0dea82943c0..496ca6fa6e6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java
@@ -62,7 +62,7 @@ public class CharacteristicTest {
}
@Test
- public void creating_a_new_characteristic_with_null_key_throws_a_NPE() throws Exception {
+ public void creating_a_new_characteristic_with_null_key_throws_a_NPE() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("key cannot be null");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java
index 09556a13363..f7386c021c1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java
@@ -43,7 +43,7 @@ public class DebtModelHolderImplTest {
DebtModelHolderImpl sut = new DebtModelHolderImpl();
@Test
- public void add_and_get_characteristics() throws Exception {
+ public void add_and_get_characteristics() {
sut.addCharacteristics(PORTABILITY, Arrays.asList(COMPILER_RELATED_PORTABILITY, HARDWARE_RELATED_PORTABILITY));
sut.addCharacteristics(MAINTAINABILITY, singletonList(READABILITY));
@@ -53,7 +53,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void add_characteristics_fail_with_NPE_if_root_characteristic_is_null() throws Exception {
+ public void add_characteristics_fail_with_NPE_if_root_characteristic_is_null() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("rootCharacteristic cannot be null");
@@ -61,7 +61,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void add_characteristics_fail_with_NPE_if_sub_characteristics_are_null() throws Exception {
+ public void add_characteristics_fail_with_NPE_if_sub_characteristics_are_null() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("subCharacteristics cannot be null");
@@ -69,7 +69,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void add_characteristics_fail_with_IAE_if_sub_characteristics_are_empty() throws Exception {
+ public void add_characteristics_fail_with_IAE_if_sub_characteristics_are_empty() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("subCharacteristics cannot be empty");
@@ -77,7 +77,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void get_root_characteristics() throws Exception {
+ public void get_root_characteristics() {
sut.addCharacteristics(PORTABILITY, Arrays.asList(COMPILER_RELATED_PORTABILITY, READABILITY));
sut.addCharacteristics(MAINTAINABILITY, singletonList(READABILITY));
@@ -85,7 +85,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void getCharacteristicById_throws_ISE_when_not_initialized() throws Exception {
+ public void getCharacteristicById_throws_ISE_when_not_initialized() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Characteristics have not been initialized yet");
@@ -93,7 +93,7 @@ public class DebtModelHolderImplTest {
}
@Test
- public void getRootCharacteristics_throws_ISE_when_not_initialized() throws Exception {
+ public void getRootCharacteristics_throws_ISE_when_not_initialized() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Characteristics have not been initialized yet");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java
index 683052e194e..27d7b0196ad 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java
@@ -63,7 +63,7 @@ public class AverageFormulaStepTest {
ComputeFormulaMeasuresStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
FormulaRepository formulaRepository = mock(FormulaRepository.class);
when(formulaRepository.getFormulas()).thenReturn(Lists.<Formula>newArrayList(
AverageFormula.Builder.newBuilder()
@@ -75,7 +75,7 @@ public class AverageFormulaStepTest {
}
@Test
- public void add_measures() throws Exception {
+ public void add_measures() {
DumbComponent project = builder(PROJECT, 1)
.addChildren(
builder(MODULE, 11)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java
index 2a3c0d88a3d..09aeaaecce6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java
@@ -53,7 +53,7 @@ public class AverageFormulaTest {
public ExpectedException thrown = ExpectedException.none();
@Test
- public void fail_with_NPE_when_building_formula_without_output_metric() throws Exception {
+ public void fail_with_NPE_when_building_formula_without_output_metric() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Output metric key cannot be null");
@@ -65,7 +65,7 @@ public class AverageFormulaTest {
}
@Test
- public void fail_with_NPE_when_building_formula_without_main_metric() throws Exception {
+ public void fail_with_NPE_when_building_formula_without_main_metric() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Main metric Key cannot be null");
@@ -77,7 +77,7 @@ public class AverageFormulaTest {
}
@Test
- public void fail_with_NPE_when_building_formula_without_by_metric() throws Exception {
+ public void fail_with_NPE_when_building_formula_without_by_metric() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("By metric Key cannot be null");
@@ -89,17 +89,17 @@ public class AverageFormulaTest {
}
@Test
- public void check_new_counter_class() throws Exception {
+ public void check_new_counter_class() {
assertThat(BASIC_AVERAGE_FORMULA.createNewCounter().getClass()).isEqualTo(AverageFormula.AverageCounter.class);
}
@Test
- public void check_output_metric_key_is_function_complexity_key() throws Exception {
+ public void check_output_metric_key_is_function_complexity_key() {
assertThat(BASIC_AVERAGE_FORMULA.getOutputMetricKey()).isEqualTo(FUNCTION_COMPLEXITY_KEY);
}
@Test
- public void create_measure_when_counter_is_aggregated_from_context() throws Exception {
+ public void create_measure_when_counter_is_aggregated_from_context() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10d);
addMeasure(FUNCTIONS_KEY, 2d);
@@ -109,7 +109,7 @@ public class AverageFormulaTest {
}
@Test
- public void create_measure_when_counter_is_aggregated_from_another_counter() throws Exception {
+ public void create_measure_when_counter_is_aggregated_from_another_counter() {
AverageFormula.AverageCounter anotherCounter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10d);
addMeasure(FUNCTIONS_KEY, 2d);
@@ -122,7 +122,7 @@ public class AverageFormulaTest {
}
@Test
- public void create_double_measure() throws Exception {
+ public void create_double_measure() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10d);
addMeasure(FUNCTIONS_KEY, 2d);
@@ -132,7 +132,7 @@ public class AverageFormulaTest {
}
@Test
- public void create_integer_measure() throws Exception {
+ public void create_integer_measure() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10);
addMeasure(FUNCTIONS_KEY, 2);
@@ -142,7 +142,7 @@ public class AverageFormulaTest {
}
@Test
- public void create_long_measure() throws Exception {
+ public void create_long_measure() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10L);
addMeasure(FUNCTIONS_KEY, 2L);
@@ -152,7 +152,7 @@ public class AverageFormulaTest {
}
@Test
- public void not_create_measure_when_aggregated_measure_has_no_value() throws Exception {
+ public void not_create_measure_when_aggregated_measure_has_no_value() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10L);
when(counterContext.getMeasure(FUNCTIONS_KEY)).thenReturn(Optional.of(Measure.newMeasureBuilder().createNoValue()));
@@ -162,7 +162,7 @@ public class AverageFormulaTest {
}
@Test
- public void fail_with_IAE_when_aggregate_from_component_and_context_with_not_numeric_measures() throws Exception {
+ public void fail_with_IAE_when_aggregate_from_component_and_context_with_not_numeric_measures() {
thrown.expect(IllegalArgumentException.class);
thrown.expectMessage("Measure of type 'STRING' are not supported");
@@ -175,7 +175,7 @@ public class AverageFormulaTest {
}
@Test
- public void no_measure_created_when_counter_has_no_value() throws Exception {
+ public void no_measure_created_when_counter_has_no_value() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
when(counterContext.getMeasure(anyString())).thenReturn(Optional.<Measure>absent());
counter.aggregate(counterContext);
@@ -184,7 +184,7 @@ public class AverageFormulaTest {
}
@Test
- public void not_create_measure_when_only_one_measure() throws Exception {
+ public void not_create_measure_when_only_one_measure() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10L);
when(counterContext.getMeasure(FUNCTIONS_KEY)).thenReturn(Optional.<Measure>absent());
@@ -194,7 +194,7 @@ public class AverageFormulaTest {
}
@Test
- public void not_create_measure_when_by_value_is_zero() throws Exception {
+ public void not_create_measure_when_by_value_is_zero() {
AverageFormula.AverageCounter counter = BASIC_AVERAGE_FORMULA.createNewCounter();
addMeasure(COMPLEXITY_IN_FUNCTIONS_KEY, 10d);
addMeasure(FUNCTIONS_KEY, 0d);
@@ -204,7 +204,7 @@ public class AverageFormulaTest {
}
@Test
- public void create_measure_from_fall_back_measure() throws Exception {
+ public void create_measure_from_fall_back_measure() {
AverageFormula sut = Builder.newBuilder()
.setOutputMetricKey(FUNCTION_COMPLEXITY_KEY)
.setMainMetricKey(COMPLEXITY_IN_FUNCTIONS_KEY)
@@ -222,7 +222,7 @@ public class AverageFormulaTest {
}
@Test
- public void not_use_fallback_measure_if_main_measure_exists() throws Exception {
+ public void not_use_fallback_measure_if_main_measure_exists() {
AverageFormula sut = Builder.newBuilder()
.setOutputMetricKey(FUNCTION_COMPLEXITY_KEY)
.setMainMetricKey(COMPLEXITY_IN_FUNCTIONS_KEY)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java
index ddba6cc3203..f5cec082065 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java
@@ -27,7 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class CoreFormulaRepositoryImplTest {
@Test
- public void check_formulas_are_not_empty() throws Exception {
+ public void check_formulas_are_not_empty() {
assertThat(new CoreFormulaRepositoryImpl().getFormulas()).isNotEmpty();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java
index 2ef3ef49731..a38efcf0cf6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java
@@ -59,14 +59,14 @@ public class DistributionFormulaStepTest {
ComputeFormulaMeasuresStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
FormulaRepository formulaRepository = mock(FormulaRepository.class);
when(formulaRepository.getFormulas()).thenReturn(Lists.<Formula>newArrayList(new DistributionFormula(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY)));
sut = new ComputeFormulaMeasuresStep(treeRootHolder, measureRepository, metricRepository, formulaRepository);
}
@Test
- public void add_measures() throws Exception {
+ public void add_measures() {
DumbComponent project = builder(PROJECT, 1)
.addChildren(
builder(MODULE, 11)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java
index b78038a3c95..09b9ec7a179 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java
@@ -43,12 +43,12 @@ public class DistributionFormulaTest {
CounterContext counterContext = mock(CounterContext.class);
@Test
- public void check_new_counter_class() throws Exception {
+ public void check_new_counter_class() {
assertThat(BASIC_DISTRIBUTION_FORMULA.createNewCounter().getClass()).isEqualTo(DistributionFormula.DistributionCounter.class);
}
@Test
- public void fail_with_NPE_when_creating_counter_with_null_metric() throws Exception {
+ public void fail_with_NPE_when_creating_counter_with_null_metric() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Metric key cannot be null");
@@ -56,12 +56,12 @@ public class DistributionFormulaTest {
}
@Test
- public void check_output_metric_key_is_function_complexity_distribution() throws Exception {
+ public void check_output_metric_key_is_function_complexity_distribution() {
assertThat(BASIC_DISTRIBUTION_FORMULA.getOutputMetricKey()).isEqualTo(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY);
}
@Test
- public void create_measure() throws Exception {
+ public void create_measure() {
DistributionFormula.DistributionCounter counter = BASIC_DISTRIBUTION_FORMULA.createNewCounter();
addMeasure(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY, "0=3;3=7;6=10");
counter.aggregate(counterContext);
@@ -70,7 +70,7 @@ public class DistributionFormulaTest {
}
@Test
- public void create_measure_when_counter_is_aggregating_from_another_counter() throws Exception {
+ public void create_measure_when_counter_is_aggregating_from_another_counter() {
DistributionFormula.DistributionCounter anotherCounter = BASIC_DISTRIBUTION_FORMULA.createNewCounter();
addMeasure(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY, "0=3;3=7;6=10");
anotherCounter.aggregate(counterContext);
@@ -82,7 +82,7 @@ public class DistributionFormulaTest {
}
@Test
- public void create_no_measure_when_no_value() throws Exception {
+ public void create_no_measure_when_no_value() {
DistributionFormula.DistributionCounter counter = BASIC_DISTRIBUTION_FORMULA.createNewCounter();
when(counterContext.getMeasure(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY)).thenReturn(Optional.<Measure>absent());
counter.aggregate(counterContext);
@@ -91,7 +91,7 @@ public class DistributionFormulaTest {
}
@Test
- public void not_create_measure_when_on_file() throws Exception {
+ public void not_create_measure_when_on_file() {
DistributionFormula.DistributionCounter counter = BASIC_DISTRIBUTION_FORMULA.createNewCounter();
addMeasure(FUNCTION_COMPLEXITY_DISTRIBUTION_KEY, "0=3;3=7;6=10");
counter.aggregate(counterContext);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java
index 40d23340cec..074bcc58ee8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java
@@ -59,14 +59,14 @@ public class SumFormulaStepTest {
ComputeFormulaMeasuresStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
FormulaRepository formulaRepository = mock(FormulaRepository.class);
when(formulaRepository.getFormulas()).thenReturn(Lists.<Formula>newArrayList(new SumFormula(LINES_KEY)));
sut = new ComputeFormulaMeasuresStep(treeRootHolder, measureRepository, metricRepository, formulaRepository);
}
@Test
- public void add_measures() throws Exception {
+ public void add_measures() {
DumbComponent project = builder(PROJECT, 1)
.addChildren(
builder(MODULE, 11)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java
index cb5de242e34..d12c4939b05 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java
@@ -43,12 +43,12 @@ public class SumFormulaTest {
CounterContext counterContext = mock(CounterContext.class);
@Test
- public void check_create_new_counter_class() throws Exception {
+ public void check_create_new_counter_class() {
assertThat(BASIC_SUM_FORMULA.createNewCounter().getClass()).isEqualTo(SumFormula.SumCounter.class);
}
@Test
- public void fail_with_NPE_when_creating_formula_with_null_metric() throws Exception {
+ public void fail_with_NPE_when_creating_formula_with_null_metric() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Metric key cannot be null");
@@ -56,12 +56,12 @@ public class SumFormulaTest {
}
@Test
- public void check_output_metric_key_is_lines() throws Exception {
+ public void check_output_metric_key_is_lines() {
assertThat(BASIC_SUM_FORMULA.getOutputMetricKey()).isEqualTo(LINES_KEY);
}
@Test
- public void create_measure() throws Exception {
+ public void create_measure() {
SumFormula.SumCounter counter = BASIC_SUM_FORMULA.createNewCounter();
addMeasure(LINES_KEY, 10);
counter.aggregate(counterContext);
@@ -70,7 +70,7 @@ public class SumFormulaTest {
}
@Test
- public void create_measure_when_counter_is_aggregating_from_another_counter() throws Exception {
+ public void create_measure_when_counter_is_aggregating_from_another_counter() {
SumFormula.SumCounter anotherCounter = BASIC_SUM_FORMULA.createNewCounter();
addMeasure(LINES_KEY, 10);
anotherCounter.aggregate(counterContext);
@@ -82,7 +82,7 @@ public class SumFormulaTest {
}
@Test
- public void not_create_measure_on_file() throws Exception {
+ public void not_create_measure_on_file() {
SumFormula.SumCounter counter = BASIC_SUM_FORMULA.createNewCounter();
addMeasure(LINES_KEY, 10);
counter.aggregate(counterContext);
@@ -91,7 +91,7 @@ public class SumFormulaTest {
}
@Test
- public void not_create_measure_when_value_is_zero() throws Exception {
+ public void not_create_measure_when_value_is_zero() {
SumFormula.SumCounter counter = BASIC_SUM_FORMULA.createNewCounter();
when(counterContext.getMeasure(LINES_KEY)).thenReturn(Optional.<Measure>absent());
counter.aggregate(counterContext);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java
index 3dd4d0e2d96..8769a2b635b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java
@@ -85,7 +85,7 @@ public class DebtAggregatorTest {
DebtAggregator underTest = new DebtAggregator(ruleRepository, debtModelHolder, metricRepository, measureRepository);
@Test
- public void sum_debt_of_unresolved_issues() throws Exception {
+ public void sum_debt_of_unresolved_issues() {
DefaultIssue unresolved1 = new DefaultIssue().setDebt(Duration.create(10)).setRuleKey(rule.getKey());
DefaultIssue unresolved2 = new DefaultIssue().setDebt(Duration.create(30)).setRuleKey(rule.getKey());
DefaultIssue unresolvedWithoutDebt = new DefaultIssue().setRuleKey(rule.getKey());
@@ -112,7 +112,7 @@ public class DebtAggregatorTest {
}
@Test
- public void aggregate_debt_of_children() throws Exception {
+ public void aggregate_debt_of_children() {
DefaultIssue fileIssue = new DefaultIssue().setDebt(Duration.create(10)).setRuleKey(rule.getKey());
DefaultIssue projectIssue = new DefaultIssue().setDebt(Duration.create(30)).setRuleKey(rule.getKey());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java
index db2bd4d1327..d596d765bb8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java
@@ -42,14 +42,14 @@ public class DebtCalculatorTest {
DebtCalculator underTest = new DebtCalculator(ruleRepository, new Durations(new Settings(), mock(I18n.class)));
@Test
- public void no_debt_if_function_is_not_defined() throws Exception {
+ public void no_debt_if_function_is_not_defined() {
DefaultIssue issue = new DefaultIssue().setRuleKey(rule.getKey());
assertThat(underTest.calculate(issue)).isNull();
}
@Test
- public void default_effort_to_fix_is_one_for_linear_function() throws Exception {
+ public void default_effort_to_fix_is_one_for_linear_function() {
int coefficient = 2;
rule.setFunction(new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.LINEAR, coefficient + "min", null));
@@ -57,7 +57,7 @@ public class DebtCalculatorTest {
}
@Test
- public void linear_function() throws Exception {
+ public void linear_function() {
double effortToFix = 3.0;
int coefficient = 2;
issue.setEffortToFix(effortToFix);
@@ -67,7 +67,7 @@ public class DebtCalculatorTest {
}
@Test
- public void constant_function() throws Exception {
+ public void constant_function() {
int constant = 2;
issue.setEffortToFix(null);
rule.setFunction(new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.CONSTANT_ISSUE, null, constant + "min"));
@@ -76,7 +76,7 @@ public class DebtCalculatorTest {
}
@Test(expected = IllegalArgumentException.class)
- public void effort_to_fix_must_not_be_set_with_constant_function() throws Exception {
+ public void effort_to_fix_must_not_be_set_with_constant_function() {
int constant = 2;
issue.setEffortToFix(3.0);
rule.setFunction(new DefaultDebtRemediationFunction(DebtRemediationFunction.Type.CONSTANT_ISSUE, null, constant + "min"));
@@ -85,7 +85,7 @@ public class DebtCalculatorTest {
}
@Test
- public void linear_with_offset_function() throws Exception {
+ public void linear_with_offset_function() {
double effortToFix = 3.0;
int coefficient = 2;
int offset = 5;
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java
index e1e846bb729..99fc8f47064 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java
@@ -51,12 +51,12 @@ public class DefaultAssigneeTest {
}
@Test
- public void no_default_assignee() throws Exception {
+ public void no_default_assignee() {
assertThat(underTest.getLogin()).isNull();
}
@Test
- public void default_assignee() throws Exception {
+ public void default_assignee() {
settings.setProperty(CoreProperties.DEFAULT_ISSUE_ASSIGNEE, "erik");
when(userIndex.getNullableByLogin("erik")).thenReturn(new UserDoc().setLogin("erik"));
@@ -64,7 +64,7 @@ public class DefaultAssigneeTest {
}
@Test
- public void configured_login_does_not_exist() throws Exception {
+ public void configured_login_does_not_exist() {
settings.setProperty(CoreProperties.DEFAULT_ISSUE_ASSIGNEE, "erik");
when(userIndex.getNullableByLogin("erik")).thenReturn(null);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java
index edc5a305279..0a7d0f59170 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java
@@ -50,7 +50,7 @@ public class IssueAssignerTest {
IssueAssigner underTest;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
esTester.truncateIndices();
underTest = new IssueAssigner(new SourceLineIndex(esTester.client()), reportReader, scmAccountToUser, defaultAssignee);
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java
index 4b957ccceac..681fca07e0b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java
@@ -108,7 +108,7 @@ public class IssueCounterTest {
IssueCounter sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
initMetrics();
measureRepository = new MeasureRepositoryImpl(null, reportReader, metricRepository);
@@ -116,7 +116,7 @@ public class IssueCounterTest {
}
@Test
- public void count_issues_by_status() throws Exception {
+ public void count_issues_by_status() {
periodsHolder.setPeriods();
// bottom-up traversal -> from files to project
@@ -157,7 +157,7 @@ public class IssueCounterTest {
}
@Test
- public void count_unresolved_issues_by_severity() throws Exception {
+ public void count_unresolved_issues_by_severity() {
periodsHolder.setPeriods();
// bottom-up traversal -> from files to project
@@ -189,7 +189,7 @@ public class IssueCounterTest {
}
@Test
- public void count_new_issues() throws Exception {
+ public void count_new_issues() {
Period period = newPeriod(3, 1500000000000L);
periodsHolder.setPeriods(period);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java
index f8f217394b9..221ff79c725 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java
@@ -99,7 +99,7 @@ public class NewDebtAggregatorTest {
}
@Test
- public void no_measures_if_no_periods() throws Exception {
+ public void no_measures_if_no_periods() {
periodsHolder.setPeriods();
DefaultIssue unresolved = new DefaultIssue().setDebt(Duration.create(10));
verifyZeroInteractions(calculator);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java
index f6afc136df4..2777c98d41e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java
@@ -62,7 +62,7 @@ public class NewDebtCalculatorTest {
}
@Test
- public void new_debt_if_issue_created_before_period() throws Exception {
+ public void new_debt_if_issue_created_before_period() {
// creation: 1d
// before period: increased to 2d
// after period: increased to 5d, decreased to 4d then increased to 10d
@@ -81,7 +81,7 @@ public class NewDebtCalculatorTest {
}
@Test
- public void new_debt_is_positive() throws Exception {
+ public void new_debt_is_positive() {
// creation: 1d
// before period: increased to 10d
// after period: decreased to 2d
@@ -98,7 +98,7 @@ public class NewDebtCalculatorTest {
}
@Test
- public void guess_initial_debt_when_first_change_is_after_period() throws Exception {
+ public void guess_initial_debt_when_first_change_is_after_period() {
// creation: 1d
// after period: increased to 2d, then to 5d
// -> new debt is 5d - 1d = 4d
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java
index 5084e420e1c..b4c723a3c2b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java
@@ -34,7 +34,7 @@ public class RuleRepositoryImplTest {
RuleRepositoryImpl underTest = new RuleRepositoryImpl(cacheLoader);
@Test
- public void getByKey() throws Exception {
+ public void getByKey() {
when(cacheLoader.load(XOO_X1)).thenReturn(new DumbRule(XOO_X1));
assertThat(underTest.getByKey(XOO_X1).getKey()).isEqualTo(XOO_X1);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java
index becc308bc91..4a41e6de7db 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java
@@ -41,7 +41,7 @@ public class RuleTagsCopierTest {
RuleTagsCopier underTest = new RuleTagsCopier(ruleRepository);
@Test
- public void copy_tags_if_new_rule() throws Exception {
+ public void copy_tags_if_new_rule() {
rule.setTags(Sets.newHashSet("bug", "performance"));
issue.setNew(true);
@@ -51,7 +51,7 @@ public class RuleTagsCopierTest {
}
@Test
- public void do_not_copy_tags_if_existing_rule() throws Exception {
+ public void do_not_copy_tags_if_existing_rule() {
rule.setTags(Sets.newHashSet("bug", "performance"));
issue.setNew(false).setTags(asList("misra"));
@@ -61,7 +61,7 @@ public class RuleTagsCopierTest {
}
@Test
- public void do_not_copy_tags_if_existing_rule_without_tags() throws Exception {
+ public void do_not_copy_tags_if_existing_rule_without_tags() {
rule.setTags(Sets.newHashSet("bug", "performance"));
issue.setNew(false).setTags(Collections.<String>emptyList());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java
index 73e636d295b..37cae21a731 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java
@@ -32,17 +32,17 @@ public class LanguageRepositoryImplTest {
private static final Language SOME_LANGUAGE = createLanguage(SOME_LANGUAGE_KEY, "_name");
@Test(expected = IllegalArgumentException.class)
- public void constructor_fails_is_language_have_the_same_key() throws Exception {
+ public void constructor_fails_is_language_have_the_same_key() {
new LanguageRepositoryImpl(createLanguage(SOME_LANGUAGE_KEY, " 1"), createLanguage(SOME_LANGUAGE_KEY, " 2"));
}
@Test
- public void find_on_empty_LanguageRepository_returns_absent() throws Exception {
+ public void find_on_empty_LanguageRepository_returns_absent() {
assertThat(new LanguageRepositoryImpl().find(ANY_KEY).isPresent()).isFalse();
}
@Test
- public void find_by_key_returns_the_same_object() throws Exception {
+ public void find_by_key_returns_the_same_object() {
LanguageRepositoryImpl languageRepository = new LanguageRepositoryImpl(SOME_LANGUAGE);
Optional<Language> language = languageRepository.find(SOME_LANGUAGE_KEY);
assertThat(language.isPresent()).isTrue();
@@ -50,7 +50,7 @@ public class LanguageRepositoryImplTest {
}
@Test
- public void find_by_other_key_returns_absent() throws Exception {
+ public void find_by_other_key_returns_absent() {
LanguageRepositoryImpl languageRepository = new LanguageRepositoryImpl(SOME_LANGUAGE);
Optional<Language> language = languageRepository.find(ANY_KEY);
assertThat(language.isPresent()).isFalse();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java
index 0bf59f52902..842961bfeb5 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java
@@ -32,21 +32,21 @@ public class MeasureKeyTest {
public ExpectedException thrown = ExpectedException.none();
@Test
- public void fail_with_NPE_when_metric_key_is_null() throws Exception {
+ public void fail_with_NPE_when_metric_key_is_null() {
thrown.expect(NullPointerException.class);
new MeasureKey(null, 1, 2);
}
@Test
- public void fail_with_IAE_when_rule_id_is_default_value() throws Exception {
+ public void fail_with_IAE_when_rule_id_is_default_value() {
thrown.expect(IllegalArgumentException.class);
new MeasureKey("metricKey", -6253, 2);
}
@Test
- public void fail_with_IAE_when_characteristic_id_is_default_value() throws Exception {
+ public void fail_with_IAE_when_characteristic_id_is_default_value() {
thrown.expect(IllegalArgumentException.class);
new MeasureKey("metricKey", 1, -6253);
@@ -86,7 +86,7 @@ public class MeasureKeyTest {
}
@Test
- public void to_string() throws Exception {
+ public void to_string() {
assertThat(new MeasureKey("metricKey", 1, 2).toString()).isEqualTo("MeasureKey{metricKey='metricKey', ruleId=1, characteristicId=2}");
assertThat(new MeasureKey("metricKey", 1, null).toString()).isEqualTo("MeasureKey{metricKey='metricKey', ruleId=1, characteristicId=-6253}");
assertThat(new MeasureKey("metricKey", null, 2).toString()).isEqualTo("MeasureKey{metricKey='metricKey', ruleId=-6253, characteristicId=2}");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java
index 6906e2a549b..77257c56e08 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java
@@ -101,7 +101,7 @@ public class MeasureRepositoryImplTest {
private DbSession dbSession;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(metric1.getKey()).thenReturn(METRIC_KEY_1);
when(metric1.getType()).thenReturn(Metric.MetricType.STRING);
when(metric2.getKey()).thenReturn(METRIC_KEY_2);
@@ -113,7 +113,7 @@ public class MeasureRepositoryImplTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
if (dbSession != null) {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java
index 337ee7732f6..424a7b90bb8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java
@@ -45,7 +45,7 @@ public class MetricRepositoryImplTest {
private MetricRepositoryImpl underTest = new MetricRepositoryImpl(dbClient);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java
index 570bab438c9..34ec82e1d88 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java
@@ -73,7 +73,7 @@ public class PeriodTest {
}
@Test
- public void verify_to_string() throws Exception {
+ public void verify_to_string() {
assertThat(new Period(1, CoreProperties.TIMEMACHINE_MODE_VERSION, "2.3", 1420034400000L, 10L).toString())
.isEqualTo("Period{index=1, mode=version, modeParameter=2.3, snapshotDate=1420034400000, snapshotId=10}");
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java
index 8af67b31c63..813419c1c2e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java
@@ -39,7 +39,7 @@ public class PeriodsHolderImplTest {
private PeriodsHolderImpl underTest = new PeriodsHolderImpl();
@Test
- public void get_periods() throws Exception {
+ public void get_periods() {
List<Period> periods = new ArrayList<>();
periods.add(createPeriod(1));
@@ -49,7 +49,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void get_periods_throws_illegal_state_exception_if_not_initialized() throws Exception {
+ public void get_periods_throws_illegal_state_exception_if_not_initialized() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Periods have not been initialized yet");
@@ -57,7 +57,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void setPeriods_throws_NPE_if_arg_is_null() throws Exception {
+ public void setPeriods_throws_NPE_if_arg_is_null() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("Periods cannot be null");
@@ -65,7 +65,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void setPeriods_throws_NPE_if_arg_contains_null() throws Exception {
+ public void setPeriods_throws_NPE_if_arg_contains_null() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("No null Period can be added to the holder");
@@ -75,7 +75,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void setPeriods_throws_NPE_if_arg_contains_null_among_others() throws Exception {
+ public void setPeriods_throws_NPE_if_arg_contains_null_among_others() {
thrown.expect(NullPointerException.class);
thrown.expectMessage("No null Period can be added to the holder");
@@ -101,7 +101,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void setPeriods_throws_ISE_if_already_initialized() throws Exception {
+ public void setPeriods_throws_ISE_if_already_initialized() {
thrown.expect(IllegalStateException.class);
thrown.expectMessage("Periods have already been initialized");
@@ -121,7 +121,7 @@ public class PeriodsHolderImplTest {
}
@Test
- public void update_periods_throws_unsupported_operation_exception() throws Exception {
+ public void update_periods_throws_unsupported_operation_exception() {
thrown.expect(UnsupportedOperationException.class);
underTest.setPeriods(ImmutableList.of(createPeriod(1)));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java
index c6f6ac2e3d7..b7d36e46434 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java
@@ -82,7 +82,7 @@ public class ApplyPermissionsStepTest extends BaseStepTest {
ApplyPermissionsStep step;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
esTester.truncateIndices();
@@ -103,12 +103,12 @@ public class ApplyPermissionsStepTest extends BaseStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
@Test
- public void grant_permission() throws Exception {
+ public void grant_permission() {
ComponentDto projectDto = ComponentTesting.newProjectDto(PROJECT_UUID).setKey(PROJECT_KEY);
dbClient.componentDao().insert(dbSession, projectDto);
@@ -136,7 +136,7 @@ public class ApplyPermissionsStepTest extends BaseStepTest {
}
@Test
- public void nothing_to_do() throws Exception {
+ public void nothing_to_do() {
long authorizationUpdatedAt = 1000L;
ComponentDto projectDto = ComponentTesting.newProjectDto(PROJECT_UUID).setKey(PROJECT_KEY).setAuthorizationUpdatedAt(authorizationUpdatedAt);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java
index a58e5dbbfbd..f73fc138aaf 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java
@@ -52,7 +52,7 @@ public class BuildComponentTreeStepTest {
private BuildComponentTreeStep underTest = new BuildComponentTreeStep(reportReader, treeRootHolder);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
reportReader.setMetadata(Metadata.newBuilder().setRootComponentRef(ROOT_REF).build());
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java
index f28f0095349..5fb4c2df4ad 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java
@@ -65,14 +65,14 @@ public class ComputeFormulaMeasuresStepTest {
ComputeFormulaMeasuresStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
FormulaRepository formulaRepository = mock(FormulaRepository.class);
when(formulaRepository.getFormulas()).thenReturn(Lists.<Formula>newArrayList(new FakeFormula()));
sut = new ComputeFormulaMeasuresStep(treeRootHolder, measureRepository, metricRepository, formulaRepository);
}
@Test
- public void add_measures() throws Exception {
+ public void add_measures() {
DumbComponent project = DumbComponent.builder(PROJECT, 1)
.addChildren(
DumbComponent.builder(MODULE, 11)
@@ -111,7 +111,7 @@ public class ComputeFormulaMeasuresStepTest {
}
@Test
- public void add_no_measure() throws Exception {
+ public void add_no_measure() {
DumbComponent project = DumbComponent.builder(PROJECT, 1)
.addChildren(
DumbComponent.builder(MODULE, 11)
@@ -134,7 +134,7 @@ public class ComputeFormulaMeasuresStepTest {
}
@Test
- public void add_no_measure_when_no_file() throws Exception {
+ public void add_no_measure_when_no_file() {
DumbComponent project = DumbComponent.builder(PROJECT, 1)
.addChildren(
DumbComponent.builder(MODULE, 11)
@@ -153,7 +153,7 @@ public class ComputeFormulaMeasuresStepTest {
}
@Test
- public void add_no_measure_on_module_without_file() throws Exception {
+ public void add_no_measure_on_module_without_file() {
DumbComponent project = DumbComponent.builder(PROJECT, 1)
.addChildren(
DumbComponent.builder(MODULE, 11)
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java
index 85a2807056f..8429381fb21 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java
@@ -65,13 +65,13 @@ public class CustomMeasuresCopyStepTest {
CustomMeasuresCopyStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
DbClient dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new CustomMeasureDao());
sut = new CustomMeasuresCopyStep(treeRootHolder, dbClient, metricRepository, measureRepository);
}
@Test
- public void copy_custom_measures() throws Exception {
+ public void copy_custom_measures() {
dbTester.prepareDbUnit(getClass(), "custom-measures.xml");
// custom metrics
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java
index 996fd888a72..8c13d093fd8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java
@@ -51,7 +51,7 @@ public class FeedDebtModelStepTest extends BaseStepTest {
FeedDebtModelStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new CharacteristicDao(dbTester.myBatis()));
dbSession = dbClient.openSession(false);
@@ -60,7 +60,7 @@ public class FeedDebtModelStepTest extends BaseStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
@@ -70,7 +70,7 @@ public class FeedDebtModelStepTest extends BaseStepTest {
}
@Test
- public void feed_characteristics() throws Exception {
+ public void feed_characteristics() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
sut.execute();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java
index c480aa5d2fb..d6794ac2eab 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java
@@ -97,12 +97,12 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
@Test
- public void no_period_on_first_analysis() throws Exception {
+ public void no_period_on_first_analysis() {
// No project, no snapshot
sut.execute();
@@ -110,7 +110,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_one_period() throws Exception {
+ public void feed_one_period() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
String textDate = "2008-11-22";
@@ -128,7 +128,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_when_settings_match_no_analysis() throws Exception {
+ public void no_period_when_settings_match_no_analysis() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "UNKNWOWN VERSION");
@@ -138,7 +138,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_when_settings_is_empty() throws Exception {
+ public void no_period_when_settings_is_empty() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "");
@@ -148,7 +148,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void ignore_unprocessed_snapshots() throws Exception {
+ public void ignore_unprocessed_snapshots() {
dbTester.prepareDbUnit(getClass(), "unprocessed_snapshots.xml");
settings.setProperty("sonar.timemachine.period1", "100");
@@ -158,7 +158,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_date() throws Exception {
+ public void feed_period_by_date() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
String textDate = "2008-11-22";
@@ -180,7 +180,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void search_by_date_return_nearest_later_analysis() throws Exception {
+ public void search_by_date_return_nearest_later_analysis() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
String date = "2008-11-24";
@@ -199,7 +199,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_date() throws Exception {
+ public void no_period_by_date() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
// No analysis at and after this date
@@ -210,7 +210,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_days() throws Exception {
+ public void feed_period_by_days() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "10");
@@ -231,7 +231,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_days() throws Exception {
+ public void no_period_by_days() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
settings.setProperty("sonar.timemachine.period1", "0");
@@ -241,7 +241,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_previous_analysis() throws Exception {
+ public void feed_period_by_previous_analysis() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "previous_analysis");
@@ -262,7 +262,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_previous_analysis() throws Exception {
+ public void no_period_by_previous_analysis() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
settings.setProperty("sonar.timemachine.period1", "previous_analysis");
@@ -272,7 +272,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_previous_version() throws Exception {
+ public void feed_period_by_previous_version() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "previous_version");
@@ -293,7 +293,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_previous_version_wit_previous_version_deleted() throws Exception {
+ public void feed_period_by_previous_version_wit_previous_version_deleted() {
dbTester.prepareDbUnit(getClass(), "previous_version_deleted.xml");
settings.setProperty("sonar.timemachine.period1", "previous_version");
@@ -311,7 +311,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_previous_version() throws Exception {
+ public void no_period_by_previous_version() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
settings.setProperty("sonar.timemachine.period1", "previous_version");
@@ -321,7 +321,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_previous_version_when_no_event_version() throws Exception {
+ public void no_period_by_previous_version_when_no_event_version() {
dbTester.prepareDbUnit(getClass(), "no_previous_version.xml");
settings.setProperty("sonar.timemachine.period1", "previous_version");
@@ -331,7 +331,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_period_by_version() throws Exception {
+ public void feed_period_by_version() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "0.9");
@@ -352,7 +352,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void no_period_by_version() throws Exception {
+ public void no_period_by_version() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
settings.setProperty("sonar.timemachine.period1", "0.8");
@@ -362,7 +362,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void feed_five_different_periods() throws Exception {
+ public void feed_five_different_periods() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period1", "2008-11-22"); // Analysis from 2008-11-22 should be returned
@@ -405,7 +405,7 @@ public class FeedPeriodsStepTest extends BaseStepTest {
}
@Test
- public void can_use_qualifier_in_settings() throws Exception {
+ public void can_use_qualifier_in_settings() {
dbTester.prepareDbUnit(getClass(), "shared.xml");
settings.setProperty("sonar.timemachine.period4.TRK", "2008-11-22");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java
index 2679134da95..b8741e5b7de 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java
@@ -62,7 +62,7 @@ public class FillComponentsStepTest extends BaseStepTest {
FillComponentsStep sut;
@Before
- public void setup() throws Exception {
+ public void setup() {
dbTester.truncateTables();
session = dbTester.myBatis().openSession(false);
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao());
@@ -71,7 +71,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
MyBatis.closeQuietly(session);
}
@@ -81,7 +81,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void compute_keys_and_uuids() throws Exception {
+ public void compute_keys_and_uuids() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setRootComponentRef(1)
.build());
@@ -129,7 +129,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void return_existing_uuids() throws Exception {
+ public void return_existing_uuids() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY);
dbClient.componentDao().insert(session, project);
ComponentDto module = ComponentTesting.newModuleDto("BCDE", project).setKey("MODULE_KEY");
@@ -187,7 +187,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void use_latest_module_for_files_key() throws Exception {
+ public void use_latest_module_for_files_key() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setRootComponentRef(1)
.build());
@@ -235,7 +235,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void use_branch_to_generate_keys() throws Exception {
+ public void use_branch_to_generate_keys() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setRootComponentRef(1)
.setBranch("origin/master")
@@ -280,7 +280,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void compute_keys_and_uuids_on_project_having_module_and_directory() throws Exception {
+ public void compute_keys_and_uuids_on_project_having_module_and_directory() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setRootComponentRef(1)
.build());
@@ -346,7 +346,7 @@ public class FillComponentsStepTest extends BaseStepTest {
}
@Test
- public void compute_keys_and_uuids_on_multi_modules() throws Exception {
+ public void compute_keys_and_uuids_on_multi_modules() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setRootComponentRef(1)
.build());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java
index b5bb0dcbb84..ee2d54389c9 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java
@@ -100,7 +100,7 @@ public class FillMeasuresWithVariationsStepTest {
FillMeasuresWithVariationsStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
session = dbTester.myBatis().openSession(false);
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao(), new SnapshotDao(), new MetricDao(), new MeasureDao(), new RuleDao(System2.INSTANCE),
@@ -118,12 +118,12 @@ public class FillMeasuresWithVariationsStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
session.close();
}
@Test
- public void do_nothing_when_no_raw_measure() throws Exception {
+ public void do_nothing_when_no_raw_measure() {
SnapshotDto period1ProjectSnapshot = createForProject(PROJECT_DTO);
dbClient.snapshotDao().insert(session, period1ProjectSnapshot);
dbClient.measureDao().insert(session, newMeasureDto(ISSUES_METRIC.getId(), PROJECT_DTO.getId(), period1ProjectSnapshot.getId(), 60d));
@@ -139,7 +139,7 @@ public class FillMeasuresWithVariationsStepTest {
}
@Test
- public void do_nothing_when_no_period() throws Exception {
+ public void do_nothing_when_no_period() {
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid(PROJECT_DTO.uuid()).build();
treeRootHolder.setRoot(project);
periodsHolder.setPeriods();
@@ -150,7 +150,7 @@ public class FillMeasuresWithVariationsStepTest {
}
@Test
- public void set_variation() throws Exception {
+ public void set_variation() {
// Project
SnapshotDto period1ProjectSnapshot = createForProject(PROJECT_DTO);
dbClient.snapshotDao().insert(session, period1ProjectSnapshot);
@@ -180,7 +180,7 @@ public class FillMeasuresWithVariationsStepTest {
}
@Test
- public void set_variations_on_all_periods() throws Exception {
+ public void set_variations_on_all_periods() {
SnapshotDto period1ProjectSnapshot = createForProject(PROJECT_DTO).setLast(false);
SnapshotDto period2ProjectSnapshot = createForProject(PROJECT_DTO).setLast(false);
SnapshotDto period3ProjectSnapshot = createForProject(PROJECT_DTO).setLast(false);
@@ -220,7 +220,7 @@ public class FillMeasuresWithVariationsStepTest {
}
@Test
- public void set_variation_on_all_numeric_metrics() throws Exception {
+ public void set_variation_on_all_numeric_metrics() {
SnapshotDto period1ProjectSnapshot = createForProject(PROJECT_DTO);
dbClient.snapshotDao().insert(session, period1ProjectSnapshot);
dbClient.measureDao().insert(session,
@@ -251,7 +251,7 @@ public class FillMeasuresWithVariationsStepTest {
}
@Test
- public void read_measure_from_batch() throws Exception {
+ public void read_measure_from_batch() {
// Project
SnapshotDto period1ProjectSnapshot = createForProject(PROJECT_DTO);
dbClient.snapshotDao().insert(session, period1ProjectSnapshot);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java
index 30a65aea399..97fa809a3a1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java
@@ -48,7 +48,7 @@ public class IndexComponentsStepTest extends BaseStepTest {
IndexComponentsStep sut = new IndexComponentsStep(resourceIndexDao, dbIdsRepository, treeRootHolder);
@Test
- public void call_indexProject_of_dao() throws IOException {
+ public void call_indexProject_of_dao() {
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("PROJECT_UUID").setKey(PROJECT_KEY).build();
dbIdsRepository.setComponentId(project, 123L);
treeRootHolder.setRoot(project);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java
index d870addb478..d36027bbc5e 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java
@@ -80,7 +80,7 @@ public class NewCoverageMeasuresStepTest {
public static final DumbComponent FILE_COMPONENT = DumbComponent.builder(Component.Type.FILE, 1).setFileAttributes(new FileAttributes(false, null)).build();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
periodsHolder.setPeriods(
new Period(2, "mode_p_1", null, parseDate("2009-12-25").getTime(), 1),
new Period(5, "mode_p_5", null, parseDate("2011-02-18").getTime(), 2));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java
index 094c7fdb071..cf11bca2120 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java
@@ -103,7 +103,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void persist_components() throws Exception {
+ public void persist_components() {
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
.setType(Constants.ComponentType.PROJECT)
@@ -209,7 +209,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void persist_file_directly_attached_on_root_directory() throws Exception {
+ public void persist_file_directly_attached_on_root_directory() {
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
.setType(Constants.ComponentType.PROJECT)
@@ -249,7 +249,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void persist_unit_test() throws Exception {
+ public void persist_unit_test() {
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
.setType(Constants.ComponentType.PROJECT)
@@ -287,7 +287,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void persist_only_new_components() throws Exception {
+ public void persist_only_new_components() {
// Project amd module already exists
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, project);
@@ -361,7 +361,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void compute_parent_project_id() throws Exception {
+ public void compute_parent_project_id() {
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
.setType(Constants.ComponentType.PROJECT)
@@ -432,7 +432,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void persist_multi_modules() throws Exception {
+ public void persist_multi_modules() {
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
.setType(Constants.ComponentType.PROJECT)
@@ -497,7 +497,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void nothing_to_persist() throws Exception {
+ public void nothing_to_persist() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, project);
ComponentDto module = ComponentTesting.newModuleDto("BCDE", project).setKey("MODULE_KEY").setName("Module");
@@ -587,7 +587,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void update_module_name() throws Exception {
+ public void update_module_name() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, project);
ComponentDto module = ComponentTesting.newModuleDto("BCDE", project).setKey("MODULE_KEY").setName("Module").setPath("path");
@@ -623,7 +623,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void update_module_description() throws Exception {
+ public void update_module_description() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project").setDescription("Project description");
dbClient.componentDao().insert(session, project);
ComponentDto module = ComponentTesting.newModuleDto("BCDE", project).setKey("MODULE_KEY").setName("Module");
@@ -660,7 +660,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void update_module_path() throws Exception {
+ public void update_module_path() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, project);
ComponentDto module = ComponentTesting.newModuleDto("BCDE", project).setKey("MODULE_KEY").setName("Module").setPath("path");
@@ -693,7 +693,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void update_module_uuid_when_moving_a_module() throws Exception {
+ public void update_module_uuid_when_moving_a_module() {
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, project);
ComponentDto moduleA = ComponentTesting.newModuleDto("EDCB", project).setKey("MODULE_A").setName("Module A");
@@ -781,7 +781,7 @@ public class PersistComponentsStepTest extends BaseStepTest {
}
@Test
- public void do_not_update_created_at_on_existing_component() throws Exception {
+ public void do_not_update_created_at_on_existing_component() {
Date oldDate = DateUtils.parseDate("2015-01-01");
ComponentDto project = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project").setCreatedAt(oldDate);
dbClient.componentDao().insert(session, project);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java
index da3701f752b..4356f08f9ec 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java
@@ -68,7 +68,7 @@ public class PersistDuplicationsStepTest extends BaseStepTest {
PersistDuplicationsStep sut;
@Before
- public void setup() throws Exception {
+ public void setup() {
dbTester.truncateTables();
session = dbTester.myBatis().openSession(false);
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new MeasureDao(), new MetricDao());
@@ -128,7 +128,7 @@ public class PersistDuplicationsStepTest extends BaseStepTest {
}
@Test
- public void persist_duplications_on_same_file_linked_on_a_module() throws Exception {
+ public void persist_duplications_on_same_file_linked_on_a_module() {
Component file = DumbComponent.builder(Component.Type.FILE, 3).setUuid("CDEF").setKey("MODULE_KEY:file").build();
Component module = DumbComponent.builder(Component.Type.MODULE, 2).setUuid("BCDE").setKey("MODULE_KEY").addChildren(file).build();
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY).addChildren(module).build();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java
index 164bd94ef68..b13e7b22ba6 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java
@@ -88,7 +88,7 @@ public class PersistEventsStepTest extends BaseStepTest {
}
@Test
- public void nothing_to_do_when_no_events_in_report() throws Exception {
+ public void nothing_to_do_when_no_events_in_report() {
dbTester.prepareDbUnit(getClass(), "nothing_to_do_when_no_events_in_report.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
@@ -104,7 +104,7 @@ public class PersistEventsStepTest extends BaseStepTest {
}
@Test
- public void persist_report_events_with_component_children() throws Exception {
+ public void persist_report_events_with_component_children() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
DumbComponent module = DumbComponent.builder(Component.Type.MODULE, 2).setUuid("BCDE").build();
@@ -131,7 +131,7 @@ public class PersistEventsStepTest extends BaseStepTest {
}
@Test
- public void create_version_event() throws Exception {
+ public void create_version_event() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setVersion("1.0").build();
@@ -149,7 +149,7 @@ public class PersistEventsStepTest extends BaseStepTest {
}
@Test
- public void keep_one_event_by_version() throws Exception {
+ public void keep_one_event_by_version() {
dbTester.prepareDbUnit(getClass(), "keep_one_event_by_version.xml");
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").setVersion("1.5-SNAPSHOT").build();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java
index 6c7c7dc774d..e17ae729069 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java
@@ -81,7 +81,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
long now = 123456789L;
@Before
- public void setup() throws Exception {
+ public void setup() {
dbTester.truncateTables();
session = dbTester.myBatis().openSession(false);
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new FileSourceDao(dbTester.myBatis()));
@@ -102,7 +102,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_sources() throws Exception {
+ public void persist_sources() {
initBasicReport(2);
sut.execute();
@@ -126,7 +126,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_last_line() throws Exception {
+ public void persist_last_line() {
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid(PROJECT_UUID).setKey(PROJECT_KEY).addChildren(
DumbComponent.builder(Component.Type.FILE, FILE_REF).setUuid(FILE_UUID).setKey("PROJECT_KEY:file").build())
.build());
@@ -155,7 +155,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_source_hashes() throws Exception {
+ public void persist_source_hashes() {
initBasicReport(2);
sut.execute();
@@ -167,7 +167,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_coverage() throws Exception {
+ public void persist_coverage() {
initBasicReport(1);
reportReader.putCoverage(FILE_REF, newArrayList(BatchReport.Coverage.newBuilder()
@@ -200,7 +200,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_scm() throws Exception {
+ public void persist_scm() {
initBasicReport(1);
reportReader.putChangesets(BatchReport.Changesets.newBuilder()
@@ -227,7 +227,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_highlighting() throws Exception {
+ public void persist_highlighting() {
initBasicReport(1);
reportReader.putSyntaxHighlighting(FILE_REF, newArrayList(BatchReport.SyntaxHighlighting.newBuilder()
@@ -251,7 +251,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_symbols() throws Exception {
+ public void persist_symbols() {
initBasicReport(3);
reportReader.putSymbols(FILE_REF, newArrayList(
@@ -279,7 +279,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void persist_duplication() throws Exception {
+ public void persist_duplication() {
initBasicReport(1);
reportReader.putDuplications(FILE_REF, newArrayList(
@@ -309,7 +309,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void not_update_sources_when_nothing_has_changed() throws Exception {
+ public void not_update_sources_when_nothing_has_changed() {
// Existing sources
long past = 150000L;
String srcHash = "137f72c3708c6bd0de00a0e5a69c699b";
@@ -347,7 +347,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void update_sources_when_source_updated() throws Exception {
+ public void update_sources_when_source_updated() {
// Existing sources
long past = 150000L;
dbClient.fileSourceDao().insert(session, new FileSourceDto()
@@ -378,7 +378,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void update_sources_when_src_hash_is_missing() throws Exception {
+ public void update_sources_when_src_hash_is_missing() {
// Existing sources
long past = 150000L;
dbClient.fileSourceDao().insert(session, new FileSourceDto()
@@ -411,7 +411,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
@Test
- public void display_file_path_when_exception_is_generated() throws Exception {
+ public void display_file_path_when_exception_is_generated() {
initBasicReport(1);
reportReader.putSyntaxHighlighting(FILE_REF, newArrayList(BatchReport.SyntaxHighlighting.newBuilder()
@@ -432,7 +432,7 @@ public class PersistFileSourcesStepTest extends BaseStepTest {
}
}
- private void initBasicReport(int numberOfLines) throws IOException {
+ private void initBasicReport(int numberOfLines) {
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid(PROJECT_UUID).setKey(PROJECT_KEY).addChildren(
DumbComponent.builder(Component.Type.MODULE, 2).setUuid("MODULE").setKey("MODULE_KEY").addChildren(
DumbComponent.builder(Component.Type.FILE, FILE_REF).setUuid(FILE_UUID).setKey("MODULE_KEY:src/Foo.java").build())
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java
index 7cb00521a0a..ca3c89c5859 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java
@@ -120,12 +120,12 @@ public class PersistMeasuresStepTest extends BaseStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
session.close();
}
@Test
- public void insert_measures_from_report() throws Exception {
+ public void insert_measures_from_report() {
metricRepository.add(1, STRING_METRIC);
metricRepository.add(2, DOUBLE_METRIC);
@@ -223,7 +223,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
}
@Test(expected = IllegalStateException.class)
- public void fail_with_ISE_when_trying_to_insert_forbidden_measures() throws Exception {
+ public void fail_with_ISE_when_trying_to_insert_forbidden_measures() {
metricRepository.add(1, DUPLICATIONS_DATA);
reportReader.putMeasures(FILE_REF, Arrays.asList(
@@ -237,7 +237,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
}
@Test
- public void do_not_insert_file_complexity_distribution_metric_on_files() throws Exception {
+ public void do_not_insert_file_complexity_distribution_metric_on_files() {
metricRepository.add(1, FILE_COMPLEXITY_DISTRIBUTION);
reportReader.putMeasures(PROJECT_REF, Arrays.asList(
@@ -270,7 +270,7 @@ public class PersistMeasuresStepTest extends BaseStepTest {
}
@Test
- public void do_not_insert_function_complexity_distribution_metric_on_files() throws Exception {
+ public void do_not_insert_function_complexity_distribution_metric_on_files() {
metricRepository.add(1, FUNCTION_COMPLEXITY_DISTRIBUTION);
reportReader.putMeasures(PROJECT_REF, Arrays.asList(
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java
index 748de4553a3..692c3052577 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java
@@ -68,7 +68,7 @@ public class PersistNumberOfDaysSinceLastCommitStepTest extends BaseStepTest {
LanguageRepository languageRepository;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
db.truncateTables();
dbClient = new DbClient(db.database(), db.myBatis(), new MeasureDao());
sourceLineIndex = mock(SourceLineIndex.class);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java
index 8d8126c9958..950a4ac7b21 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java
@@ -86,7 +86,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void add_links_on_project_and_module() throws Exception {
+ public void add_links_on_project_and_module() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").addChildren(
@@ -116,7 +116,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void nothing_to_do_when_link_already_exists() throws Exception {
+ public void nothing_to_do_when_link_already_exists() {
dbTester.prepareDbUnit(getClass(), "nothing_to_do_when_link_already_exists.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
@@ -133,7 +133,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void do_not_add_links_on_file() throws Exception {
+ public void do_not_add_links_on_file() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").addChildren(
@@ -157,7 +157,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void update_link() throws Exception {
+ public void update_link() {
dbTester.prepareDbUnit(getClass(), "update_link.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
@@ -174,7 +174,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void delete_link() throws Exception {
+ public void delete_link() {
dbTester.prepareDbUnit(getClass(), "delete_link.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
@@ -190,7 +190,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void not_delete_custom_link() throws Exception {
+ public void not_delete_custom_link() {
dbTester.prepareDbUnit(getClass(), "not_delete_custom_link.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
@@ -206,7 +206,7 @@ public class PersistProjectLinksStepTest extends BaseStepTest {
}
@Test
- public void fail_when_trying_to_add_same_link_type_multiple_times() throws Exception {
+ public void fail_when_trying_to_add_same_link_type_multiple_times() {
dbTester.prepareDbUnit(getClass(), "empty.xml");
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("ABCD").build());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java
index 93293f03b4a..fdc3bc3a28b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java
@@ -86,7 +86,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
PersistSnapshotsStep sut;
@Before
- public void setup() throws Exception {
+ public void setup() {
dbTester.truncateTables();
session = dbTester.myBatis().openSession(false);
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao(), new SnapshotDao());
@@ -118,7 +118,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void persist_snapshots() throws Exception {
+ public void persist_snapshots() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, projectDto);
ComponentDto moduleDto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_KEY").setName("Module");
@@ -211,7 +211,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void persist_unit_test() throws Exception {
+ public void persist_unit_test() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, projectDto);
ComponentDto moduleDto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_KEY").setName("Module");
@@ -239,7 +239,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void persist_snapshots_on_multi_modules() throws Exception {
+ public void persist_snapshots_on_multi_modules() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY);
dbClient.componentDao().insert(session, projectDto);
ComponentDto moduleADto = ComponentTesting.newModuleDto("BCDE", projectDto).setKey("MODULE_A");
@@ -295,7 +295,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void persist_snapshots_with_periods() throws Exception {
+ public void persist_snapshots_with_periods() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, projectDto);
SnapshotDto snapshotDto = SnapshotTesting.createForProject(projectDto).setCreatedAt(DateUtils.parseDateQuietly("2015-01-01").getTime());
@@ -316,7 +316,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void only_persist_snapshots_with_periods_on_project_and_module() throws Exception {
+ public void only_persist_snapshots_with_periods_on_project_and_module() {
periodsHolderRule.setPeriods(new Period(1, CoreProperties.TIMEMACHINE_MODE_PREVIOUS_ANALYSIS, null, analysisDate, 123L));
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
@@ -368,7 +368,7 @@ public class PersistSnapshotsStepTest extends BaseStepTest {
}
@Test
- public void set_no_period_on_snapshots_when_no_period() throws Exception {
+ public void set_no_period_on_snapshots_when_no_period() {
ComponentDto projectDto = ComponentTesting.newProjectDto("ABCD").setKey(PROJECT_KEY).setName("Project");
dbClient.componentDao().insert(session, projectDto);
SnapshotDto snapshotDto = SnapshotTesting.createForProject(projectDto);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java
index 267bf5d5b5f..8a682e435ba 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java
@@ -86,7 +86,7 @@ public class PersistTestsStepTest extends BaseStepTest {
long now = 123456789L;
@Before
- public void setup() throws Exception {
+ public void setup() {
db.truncateTables();
session = db.myBatis().openSession(false);
dbClient = new DbClient(db.database(), db.myBatis(), new FileSourceDao(db.myBatis()));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java
index e7850ac4e1d..1f40aa2cb00 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java
@@ -63,12 +63,12 @@ public class PurgeDatastoresStepTest extends BaseStepTest {
PurgeDatastoresStep sut = new PurgeDatastoresStep(mock(DbClient.class, Mockito.RETURNS_DEEP_STUBS), projectCleaner, dbIdsRepository, treeRootHolder, projectSettingsRepository);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(projectSettingsRepository.getProjectSettings(PROJECT_KEY)).thenReturn(new Settings());
}
@Test
- public void call_purge_method_of_the_purge_task() throws IOException {
+ public void call_purge_method_of_the_purge_task() {
Component project = DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("UUID-1234").setKey(PROJECT_KEY).build();
treeRootHolder.setRoot(project);
dbIdsRepository.setComponentId(project, 123L);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java
index 53b60516c6d..dd2ddadc6f3 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java
@@ -74,7 +74,7 @@ public class QualityGateEventsStepTest {
private QualityGateEventsStep underTest = new QualityGateEventsStep(treeRootHolder, metricRepository, measureRepository, eventRepository, notificationManager);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(metricRepository.getByKey(ALERT_STATUS_KEY)).thenReturn(alertStatusMetric);
treeRootHolder.setRoot(PROJECT_COMPONENT);
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java
index a21099c5f37..663be5b4a17 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java
@@ -80,7 +80,7 @@ public class QualityGateMeasuresStepTest {
private QualityGateMeasuresStep underTest = new QualityGateMeasuresStep(treeRootHolder, qualityGateHolder, measureRepository, metricRepository, resultTextConverter);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
treeRootHolder.setRoot(PROJECT_COMPONENT);
when(metricRepository.getByKey(CoreMetrics.ALERT_STATUS_KEY)).thenReturn(ALERT_STATUS_METRIC);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java
index a9e703e5e43..72d9354f952 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java
@@ -83,7 +83,7 @@ public class QualityProfileEventsStepTest {
private QualityProfileEventsStep underTest = new QualityProfileEventsStep(treeRootHolder, metricRepository, measureRepository, languageRepository, eventRepository);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(metricRepository.getByKey(CoreMetrics.QUALITY_PROFILES_KEY)).thenReturn(qualityProfileMetric);
treeRootHolder.setRoot(DumbComponent.builder(Component.Type.PROJECT, 1).setUuid("uuid").setKey("key").build());
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java
index b846287b270..92ea18835a1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java
@@ -87,7 +87,7 @@ public class SendIssueNotificationsStepTest extends BaseStepTest {
}
@Test
- public void do_not_send_notifications_if_no_subscribers() throws IOException {
+ public void do_not_send_notifications_if_no_subscribers() {
when(notifService.hasProjectSubscribersForTypes(PROJECT_UUID, SendIssueNotificationsStep.NOTIF_TYPES)).thenReturn(false);
sut.execute();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java
index 10a8e1ce4e4..10726eab03b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java
@@ -74,7 +74,7 @@ public class SqaleMeasuresStepTest {
private SqaleMeasuresStep underTest = new SqaleMeasuresStep(treeRootHolder, metricRepository, measureRepository, sqaleRatingSettings);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
// assumes SQALE rating configuration is consistent
when(sqaleRatingSettings.getRatingGrid()).thenReturn(RATING_GRID);
when(sqaleRatingSettings.getSizeMetricKey(LANGUAGE_KEY_1)).thenReturn(METRIC_KEY_1);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java
index dc96c34fc40..ad759579da7 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java
@@ -70,7 +70,7 @@ public class ValidateProjectStepTest {
ValidateProjectStep sut;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
dbClient = new DbClient(dbTester.database(), dbTester.myBatis(), new ComponentDao(), new SnapshotDao());
dbSession = dbClient.openSession(false);
@@ -80,12 +80,12 @@ public class ValidateProjectStepTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
@Test
- public void not_fail_if_provisioning_enforced_and_project_exists() throws Exception {
+ public void not_fail_if_provisioning_enforced_and_project_exists() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder().setAnalysisDate(DEFAULT_ANALYSIS_TIME).build());
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
@@ -102,7 +102,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_provisioning_enforced_and_project_does_not_exists() throws Exception {
+ public void fail_if_provisioning_enforced_and_project_does_not_exists() {
thrown.expect(MessageException.class);
thrown.expectMessage("Unable to scan non-existing project '" + PROJECT_KEY + "'");
@@ -120,7 +120,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_provisioning_not_enforced_and_project_does_not_exists() throws Exception {
+ public void fail_if_provisioning_not_enforced_and_project_does_not_exists() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder().setAnalysisDate(DEFAULT_ANALYSIS_TIME).build());
reportReader.putComponent(BatchReport.Component.newBuilder()
.setRef(1)
@@ -135,7 +135,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void not_fail_on_valid_branch() throws Exception {
+ public void not_fail_on_valid_branch() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setAnalysisDate(DEFAULT_ANALYSIS_TIME)
.setBranch("origin/master")
@@ -151,7 +151,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_on_invalid_branch() throws Exception {
+ public void fail_on_invalid_branch() {
thrown.expect(MessageException.class);
thrown.expectMessage("Validation of project failed:\n" +
" o \"bran#ch\" is not a valid branch name. Allowed characters are alphanumeric, '-', '_', '.' and '/'.");
@@ -171,7 +171,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_on_invalid_key() throws Exception {
+ public void fail_on_invalid_key() {
String invalidProjectKey = "Project\\Key";
thrown.expect(MessageException.class);
@@ -199,7 +199,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_module_key_is_already_used_as_project_key() throws Exception {
+ public void fail_if_module_key_is_already_used_as_project_key() {
thrown.expect(MessageException.class);
thrown.expectMessage("Validation of project failed:\n" +
" o The project \"" + MODULE_KEY + "\" is already defined in SonarQube but not as a module of project \"" + PROJECT_KEY + "\". " +
@@ -231,7 +231,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_module_key_already_exists_in_another_project() throws Exception {
+ public void fail_if_module_key_already_exists_in_another_project() {
String anotherProjectKey = "ANOTHER_PROJECT_KEY";
thrown.expect(MessageException.class);
thrown.expectMessage("Validation of project failed:\n" +
@@ -265,7 +265,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_project_key_already_exists_as_module() throws Exception {
+ public void fail_if_project_key_already_exists_as_module() {
String anotherProjectKey = "ANOTHER_PROJECT_KEY";
thrown.expect(MessageException.class);
thrown.expectMessage("Validation of project failed:\n" +
@@ -300,7 +300,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void not_fail_if_analysis_date_is_after_last_analysis() throws Exception {
+ public void not_fail_if_analysis_date_is_after_last_analysis() {
reportReader.setMetadata(BatchReport.Metadata.newBuilder()
.setAnalysisDate(DEFAULT_ANALYSIS_TIME) // 2015-06-01
.build());
@@ -322,7 +322,7 @@ public class ValidateProjectStepTest {
}
@Test
- public void fail_if_analysis_date_is_before_last_analysis() throws Exception {
+ public void fail_if_analysis_date_is_before_last_analysis() {
thrown.expect(MessageException.class);
thrown.expectMessage("Validation of project failed:");
thrown.expectMessage("Date of analysis cannot be older than the date of the last known analysis on this project. Value: ");
diff --git a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java
index abc50e78e77..107509dc705 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class MigrationStepModuleTest {
@Test
- public void verify_count_of_added_MigrationStep_types() throws Exception {
+ public void verify_count_of_added_MigrationStep_types() {
ComponentContainer container = new ComponentContainer();
new MigrationStepModule().configure(container);
assertThat(container.size()).isEqualTo(55);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java
index bd2e691e29d..ee3ffdca96c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java
@@ -41,7 +41,7 @@ public class IssueAuthorizationDaoTest {
IssueAuthorizationDao dao = new IssueAuthorizationDao();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java
index a8947c3ba7a..9ecc7685721 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java
@@ -40,7 +40,7 @@ public class IssueResultSetIteratorTest {
public DbTester dbTester = DbTester.create(System2.INSTANCE);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java
index 6f8e7517a37..15a6671b13a 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java
@@ -91,7 +91,7 @@ public class UpdateActionTest {
}
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbClient = new DbClient(db.database(), db.myBatis(), new CustomMeasureDao(), new ComponentDao(), new MetricDao());
dbSession = dbClient.openSession(false);
db.truncateTables();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java
index 818a64a921c..45871fa616d 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java
@@ -63,7 +63,7 @@ public class DeleteActionTest {
MetricDao metricDao;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbClient = new DbClient(db.database(), db.myBatis(), new MetricDao(), new CustomMeasureDao());
dbSession = dbClient.openSession(false);
db.truncateTables();
@@ -73,7 +73,7 @@ public class DeleteActionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java
index ffd053b7634..22a0469b6b4 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java
@@ -46,14 +46,14 @@ public class DomainsActionTest {
DbSession dbSession;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbClient = new DbClient(db.database(), db.myBatis(), new MetricDao());
dbSession = dbClient.openSession(false);
ws = new WsTester(new MetricsWs(new DomainsAction(dbClient)));
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java
index 2dcacee8840..1a8f3dbd6fc 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java
@@ -32,7 +32,7 @@ public class TypesActionTest {
WsTester ws;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
ws = new WsTester(new MetricsWs(new TypesAction()));
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java
index a93ed164698..90b55c60b09 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java
@@ -96,7 +96,7 @@ public class BulkDeleteActionTest {
ResourceType resourceType;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
ComponentDao componentDao = new ComponentDao();
ResourceDao resourceDao = new ResourceDao(db.myBatis(), System2.INSTANCE);
PurgeDao purgeDao = new PurgeDao(db.myBatis(), resourceDao, System2.INSTANCE);
@@ -114,7 +114,7 @@ public class BulkDeleteActionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java
index de9ce8c6d32..5ac38ed985a 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java
@@ -94,7 +94,7 @@ public class DeleteActionTest {
ResourceType resourceType;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
ComponentDao componentDao = new ComponentDao();
ResourceDao resourceDao = new ResourceDao(db.myBatis(), System2.INSTANCE);
PurgeDao purgeDao = new PurgeDao(db.myBatis(), resourceDao, System2.INSTANCE);
@@ -112,7 +112,7 @@ public class DeleteActionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java
index 2c4d369f1a8..7e6db7a8687 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java
@@ -68,7 +68,7 @@ public class GhostsActionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
dbSession.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java b/server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java
index 0a121b2b9bb..19e925afd1c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java
@@ -26,7 +26,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class EsSearchModuleTest {
@Test
- public void verify_count_of_added_components() throws Exception {
+ public void verify_count_of_added_components() {
ComponentContainer container = new ComponentContainer();
new EsSearchModule().configure(container);
assertThat(container.size()).isEqualTo(5);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java
index 687ba8391fa..dd7cdd15981 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java
@@ -42,7 +42,7 @@ public class SourceLineResultSetIteratorTest {
SourceLineResultSetIterator iterator;
- public void after() throws Exception {
+ public void after() {
if (iterator != null) {
iterator.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
index d59effa65a2..803b960b9b3 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
@@ -113,7 +113,7 @@ public class RegisterMetricsTest {
}
@Test(expected = IllegalStateException.class)
- public void fail_if_duplicated_plugin_metrics() throws Exception {
+ public void fail_if_duplicated_plugin_metrics() {
Metrics plugin1 = new TestMetrics(new Metric.Builder("m1", "In first plugin", Metric.ValueType.FLOAT).create());
Metrics plugin2 = new TestMetrics(new Metric.Builder("m1", "In second plugin", Metric.ValueType.FLOAT).create());
@@ -121,7 +121,7 @@ public class RegisterMetricsTest {
}
@Test(expected = IllegalStateException.class)
- public void fail_if_plugin_duplicates_core_metric() throws Exception {
+ public void fail_if_plugin_duplicates_core_metric() {
Metrics plugin = new TestMetrics(new Metric.Builder("ncloc", "In plugin", Metric.ValueType.FLOAT).create());
new RegisterMetrics(dbClient(), new Metrics[]{plugin}).start();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java
index fdee9c93140..a2e851e9dc9 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java
@@ -50,7 +50,7 @@ public class TestResultSetIteratorTest {
TestResultSetIterator sut;
@After
- public void after() throws Exception {
+ public void after() {
if (sut != null) {
sut.close();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java
index 1c15f020e07..fc30049ebb8 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java
@@ -34,7 +34,7 @@ public class DoPrivilegedTest {
private MockUserSession session = new MockUserSession(LOGIN);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
threadLocalUserSession.set(session);
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
index ac33f8d4078..f98256c24fc 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
@@ -47,7 +47,7 @@ public class RubyUserSessionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
// clean up for next test
threadLocalUserSession.remove();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
index 0347c0a5c4b..ec152b73160 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
@@ -42,7 +42,7 @@ public class ThreadLocalUserSessionTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
// clean up for next test
threadLocalUserSession.remove();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java
index d401c0d6b04..5fb813b6643 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java
@@ -39,7 +39,7 @@ public class UserResultSetIteratorTest {
public DbTester dbTester = DbTester.create(System2.INSTANCE);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
index 5c36bb5834f..40e505f7daa 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
@@ -291,7 +291,7 @@ public class WebServiceEngineTest {
}
@Test
- public void should_handle_headers() throws Exception {
+ public void should_handle_headers() {
ServletResponse response = new ServletResponse();
String name = "Content-Disposition";
String value = "attachment; filename=sonarqube.zip";
diff --git a/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java b/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java
index 411435aebec..32598b28f5e 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java
@@ -45,7 +45,7 @@ public class CachesTest extends AbstractCachesTest {
}
@Test
- public void should_clean_resources() throws PersistitException {
+ public void should_clean_resources() {
Cache<String> c = caches.<String>createCache("test1");
for (int i = 0; i < 1_000_000; i++) {
c.put("a" + i, "a" + i);
diff --git a/sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java b/sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java
index 505ee23191e..4e513e76302 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java
@@ -80,7 +80,7 @@ public class MeasureCacheTest extends AbstractCachesTest {
}
@Test
- public void should_add_measure_with_big_data() throws InterruptedException {
+ public void should_add_measure_with_big_data() {
Project p = new Project("struts");
assertThat(measureCache.entries()).hasSize(0);
diff --git a/sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java b/sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java
index 79a77fbd9e2..681c2d34935 100644
--- a/sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java
@@ -159,7 +159,7 @@ public class TrackerTest {
}
@Test
- public void do_not_fail_if_base_issue_without_line() throws Exception {
+ public void do_not_fail_if_base_issue_without_line() {
FakeInput baseInput = new FakeInput("H1", "H2");
Issue base = baseInput.createIssueOnLine(1, RULE_SYSTEM_PRINT, "msg1");
@@ -172,7 +172,7 @@ public class TrackerTest {
}
@Test
- public void do_not_fail_if_raw_issue_without_line() throws Exception {
+ public void do_not_fail_if_raw_issue_without_line() {
FakeInput baseInput = new FakeInput("H1", "H2");
Issue base = baseInput.createIssue(RULE_SYSTEM_PRINT, "msg1");
@@ -185,7 +185,7 @@ public class TrackerTest {
}
@Test
- public void do_not_fail_if_raw_line_does_not_exist() throws Exception {
+ public void do_not_fail_if_raw_line_does_not_exist() {
FakeInput baseInput = new FakeInput();
FakeInput rawInput = new FakeInput("H1").addIssue(new Issue(200, "H200", RULE_SYSTEM_PRINT, "msg"));
@@ -198,7 +198,7 @@ public class TrackerTest {
* SONAR-3072
*/
@Test
- public void recognize_blocks_1() throws Exception {
+ public void recognize_blocks_1() {
FakeInput baseInput = FakeInput.createForSourceLines(
"package example1;",
"",
@@ -257,7 +257,7 @@ public class TrackerTest {
* SONAR-3072
*/
@Test
- public void recognize_blocks_2() throws Exception {
+ public void recognize_blocks_2() {
FakeInput baseInput = FakeInput.createForSourceLines(
"package example2;",
"",
@@ -298,7 +298,7 @@ public class TrackerTest {
}
@Test
- public void recognize_blocks_3() throws Exception {
+ public void recognize_blocks_3() {
FakeInput baseInput = FakeInput.createForSourceLines(
"package sample;",
"",
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java
index 9b5f6cf2dc5..62d41a14a3f 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java
@@ -43,7 +43,7 @@ public class PluginClassloaderFactoryTest {
PluginClassloaderFactory factory = new PluginClassloaderFactory(temp);
@Test
- public void create_isolated_classloader() throws Exception {
+ public void create_isolated_classloader() {
PluginClassloaderDef def = basePluginDef();
Map<PluginClassloaderDef, ClassLoader> map = factory.create(asList(def));
@@ -61,7 +61,7 @@ public class PluginClassloaderFactoryTest {
}
@Test
- public void create_classloader_compatible_with_with_old_api_dependencies() throws Exception {
+ public void create_classloader_compatible_with_with_old_api_dependencies() {
PluginClassloaderDef def = basePluginDef();
def.setCompatibilityMode(true);
ClassLoader classLoader = factory.create(asList(def)).get(def);
@@ -75,7 +75,7 @@ public class PluginClassloaderFactoryTest {
}
@Test
- public void classloader_exports_resources_to_other_classloaders() throws Exception {
+ public void classloader_exports_resources_to_other_classloaders() {
PluginClassloaderDef baseDef = basePluginDef();
PluginClassloaderDef dependentDef = dependentPluginDef();
Map<PluginClassloaderDef, ClassLoader> map = factory.create(asList(baseDef, dependentDef));
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
index 2b02b48d42f..35893ede34e 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
@@ -209,7 +209,7 @@ public class PluginInfoTest {
* it as base plugin anymore
*/
@Test
- public void l10n_plugins_should_not_extend_english_plugin() throws Exception {
+ public void l10n_plugins_should_not_extend_english_plugin() {
PluginInfo pluginInfo = new PluginInfo("l10nfr").setBasePlugin("l10nen");
assertThat(pluginInfo.getBasePlugin()).isNull();
diff --git a/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java b/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
index cf430a18265..46ac1d819ba 100644
--- a/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class RuleKeyFunctionsTest {
@Test
- public void stringToRuleKey() throws Exception {
+ public void stringToRuleKey() {
Collection<String> strings = Arrays.asList("js:S001", "java:S002");
List<RuleKey> keys = from(strings).transform(RuleKeyFunctions.stringToRuleKey()).toList();
@@ -40,7 +40,7 @@ public class RuleKeyFunctionsTest {
}
@Test
- public void on_static_methods() throws Exception {
+ public void on_static_methods() {
assertThat(TestUtils.hasOnlyPrivateConstructors(RuleKeyFunctions.class)).isTrue();
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
index 21c24b41e4d..7ce29a621b6 100644
--- a/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
@@ -33,7 +33,7 @@ public class ResourceIndexDaoTest extends AbstractDaoTestCase {
ResourceIndexDao dao = dbTester.getDbClient().componentIndexDao();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
@@ -74,7 +74,7 @@ public class ResourceIndexDaoTest extends AbstractDaoTestCase {
}
@Test
- public void shouldNotIndexPackages() throws SQLException {
+ public void shouldNotIndexPackages() {
setupData("shouldNotIndexPackages");
dao.indexProject(1);
diff --git a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
index d4e65fc2f15..7d9092cca2e 100644
--- a/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
@@ -169,7 +169,7 @@ public class SnapshotDaoTest {
}
@Test
- public void select_previous_version_snapshots() throws Exception {
+ public void select_previous_version_snapshots() {
db.prepareDbUnit(getClass(), "select_previous_version_snapshots.xml");
List<SnapshotDto> snapshots = sut.selectPreviousVersionSnapshots(session, 1L, "1.2-SNAPSHOT");
diff --git a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java
index 533c06b5041..7764675d6c0 100644
--- a/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java
@@ -34,7 +34,7 @@ public class ActionPlanDaoTest extends AbstractDaoTestCase {
ActionPlanDao dao = dbTester.getDbClient().actionPlanDao();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java
index 97dec4e0e06..031b1d8d859 100644
--- a/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java
@@ -26,7 +26,7 @@ import org.sonar.db.AbstractDaoTestCase;
public class IssueChangeMapperTest extends AbstractDaoTestCase {
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
index 6b1176088fa..ecdcc46149c 100644
--- a/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
@@ -66,7 +66,7 @@ public class PastMeasureDtoTest {
}
@Test(expected = NullPointerException.class)
- public void get_value_throw_a_NPE_if_value_is_null() throws Exception {
+ public void get_value_throw_a_NPE_if_value_is_null() {
new PastMeasureDto().getValue();
}
}
diff --git a/sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java b/sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java
index 18f21326780..1c0c41d20af 100644
--- a/sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java
@@ -34,7 +34,7 @@ public class NotificationQueueDaoTest extends AbstractDaoTestCase {
NotificationQueueDao dao = new NotificationQueueDao(dbTester.myBatis());
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}
diff --git a/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java b/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java
index 3704d37c992..384e11de2cd 100644
--- a/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java
@@ -37,7 +37,7 @@ public class FileSourceDaoTest extends AbstractDaoTestCase {
FileSourceDao sut = dbTester.getDbClient().fileSourceDao();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
dbTester.truncateTables();
}