]> source.dussan.org Git - sonarqube.git/commitdiff
FIX Redundant throws clause
authorDavid Gageot <david@gageot.net>
Tue, 7 Jul 2015 09:04:36 +0000 (11:04 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 7 Jul 2015 09:36:26 +0000 (11:36 +0200)
97 files changed:
it/it-tests/src/test/java/qualitygate/QualityGateNotificationTest.java
it/it-tests/src/test/java/qualitygate/QualityGateTest.java
server/sonar-server-benchmarks/src/test/java/org/sonar/server/benchmark/SourceDbBenchmarkTest.java
server/sonar-server/src/test/java/org/sonar/server/activity/index/ActivityResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/batch/BatchWsModuleTest.java
server/sonar-server/src/test/java/org/sonar/server/component/db/ComponentDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ComputationServiceTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/ReportQueueTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/activity/ActivityManagerTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/batch/BatchReportReaderImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/component/ComponentTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/component/DbIdsRepositoryTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/component/ProjectSettingsRepositoryTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/component/TreeRootHolderImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/debt/CharacteristicTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/debt/DebtModelHolderImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/AverageFormulaTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/CoreFormulaRepositoryImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/DistributionFormulaTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/formula/SumFormulaTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtAggregatorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/DebtCalculatorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/DefaultAssigneeTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueAssignerTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/IssueCounterTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtAggregatorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/NewDebtCalculatorTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleRepositoryImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/issue/RuleTagsCopierTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/language/LanguageRepositoryImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureKeyTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/metric/MetricRepositoryImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/period/PeriodsHolderImplTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ApplyPermissionsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/BuildComponentTreeStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ComputeFormulaMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/CustomMeasuresCopyStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedDebtModelStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/FeedPeriodsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/FillComponentsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/IndexComponentsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/NewCoverageMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistComponentsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistDuplicationsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistEventsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistFileSourcesStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistProjectLinksStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistSnapshotsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistTestsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/PurgeDatastoresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateEventsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityGateMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/QualityProfileEventsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/SendIssueNotificationsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/SqaleMeasuresStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ValidateProjectStepTest.java
server/sonar-server/src/test/java/org/sonar/server/db/migrations/MigrationStepModuleTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueAuthorizationDaoTest.java
server/sonar-server/src/test/java/org/sonar/server/issue/index/IssueResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/measure/custom/ws/UpdateActionTest.java
server/sonar-server/src/test/java/org/sonar/server/metric/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/metric/ws/DomainsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/metric/ws/TypesActionTest.java
server/sonar-server/src/test/java/org/sonar/server/project/ws/BulkDeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/project/ws/DeleteActionTest.java
server/sonar-server/src/test/java/org/sonar/server/project/ws/GhostsActionTest.java
server/sonar-server/src/test/java/org/sonar/server/search/EsSearchModuleTest.java
server/sonar-server/src/test/java/org/sonar/server/source/index/SourceLineResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/startup/RegisterMetricsTest.java
server/sonar-server/src/test/java/org/sonar/server/test/index/TestResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/user/DoPrivilegedTest.java
server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
server/sonar-server/src/test/java/org/sonar/server/user/index/UserResultSetIteratorTest.java
server/sonar-server/src/test/java/org/sonar/server/ws/WebServiceEngineTest.java
sonar-batch/src/test/java/org/sonar/batch/index/CachesTest.java
sonar-batch/src/test/java/org/sonar/batch/scan/measure/MeasureCacheTest.java
sonar-core/src/test/java/org/sonar/core/issue/tracking/TrackerTest.java
sonar-core/src/test/java/org/sonar/core/platform/PluginClassloaderFactoryTest.java
sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
sonar-core/src/test/java/org/sonar/core/rule/RuleKeyFunctionsTest.java
sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
sonar-db/src/test/java/org/sonar/db/issue/ActionPlanDaoTest.java
sonar-db/src/test/java/org/sonar/db/issue/IssueChangeMapperTest.java
sonar-db/src/test/java/org/sonar/db/measure/PastMeasureDtoTest.java
sonar-db/src/test/java/org/sonar/db/notification/NotificationQueueDaoTest.java
sonar-db/src/test/java/org/sonar/db/source/FileSourceDaoTest.java

index 582cb58fd0b32f7c3aea2c8e327fe530e3d24344..70467aeb4d82b13dd47e869f8ac735b91183bab3 100644 (file)
@@ -43,7 +43,7 @@ public class QualityGateNotificationTest {
     .build();
 
   @Before
-  public void cleanUp() throws Exception {
+  public void cleanUp() {
     orchestrator.resetData();
   }
 
index e13f8bb07d555cf90ca78c29cc737a261fd8db85..5f975e93a2132af1275eaef9c4cd11a0ebb4d55c 100644 (file)
@@ -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());
   }
index d37f29b87cea4e2691ba00f4f9f659c83a8cdcb2..86663dde0d4df2f33f12ad85f813259752bb0db8 100644 (file)
@@ -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);
index d464a499447f349e6c40d16b75f49931c3cb9c91..b84d328453dc3eccffcdfd2c6f1902cddb9afe47 100644 (file)
@@ -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();
   }
 
index 6c992f9219bd985fd06b2f8ffe8e12d1f885324f..009d79afd9a3f63a3a7238fce4d5525666cb8d00 100644 (file)
@@ -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);
index 88d39c64acebebf2b8509e65e786fe88b559a0b8..597e5a68a696ad9c3d8dbc2996f6e64fbebec404 100644 (file)
@@ -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());
index 935104f93cb4bcc3d5c11f6efdebbdce58b2f5dd..9a9e266b62b75b715c94afbfee015f2124233aa7 100644 (file)
@@ -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();
 
index 137eb422086a6b74a9c95e769ae106e30cdcbeb7..ffd733514de601567d5be3c4ebc0d19fc5b9af15 100644 (file)
@@ -80,7 +80,7 @@ public class ReportQueueTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     session.close();
   }
 
index a10fd58206d06cfc8b79171250ba85ec7baeb7af..f580fd25d79fdaee38ec6ebd5d7ee1ad2da028dd 100644 (file)
@@ -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
index f09ed4bf395f9cd790c98f952b0d2a1496a369ab..ebcf74bcb3506d1e5cfcf33436584c874ea25d1e 100644 (file)
@@ -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);
index 4a1807b62f79f3ccfb29f461147b8b9b28c8958d..e71f43b906c0e96720f976a0f13e379725d0eaa9 100644 (file)
@@ -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);
 
index f7f8f5f3675bce11aa62b37f5b32d5c3cfbf2760..d2f1550826f884c52d064e462373748d9891e348 100644 (file)
@@ -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();
index c614a8bf6dc20ed8ed24a7f82c33c5c16adc3744..692ccac4dc3bde687212fcbb0d17d56ade88e4f0 100644 (file)
@@ -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");
 
index 4927cbe63c9b933d71a192e08f64f28ac6469759..c31e0bac01fd412c49d08857ebaf6d8ca46e0e33 100644 (file)
@@ -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);
index 52c8bdb3c0a745c071eebf70c72be66477ccfe74..6f9447cfb82686ebc8e348dd01a24493d06341ed 100644 (file)
@@ -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);
index 0dea82943c02ebb9c1a1c88565a0f914f12d38ad..496ca6fa6e6b0839cc12f1a41346e0fdf8e10b71 100644 (file)
@@ -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");
 
index 09556a133636b50ede87956c47322c08354a94fa..f7386c021c1ef7e6b3a8b33f4462eb8529f3da18 100644 (file)
@@ -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");
 
index 683052e194eef51c2c0d0df7e31ae525284d0938..27d7b0196ad0445b1767b7b48bc0e61a53d0ab2c 100644 (file)
@@ -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)
index 2a3c0d88a3d77a62893e4407c64d153148db5f92..09aeaaecce62c728a072637d9228ca6af8b39edf 100644 (file)
@@ -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)
index ddba6cc3203d7d994689e35a93d558d658bc94cd..f5cec08206554098c9faa96c05714b9ca637ad11 100644 (file)
@@ -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();
 
   }
index 2ef3ef497319eda3867c0efce2f9434374d61f1c..a38efcf0cf6025d429bdb1eeb71a58af8198c7ac 100644 (file)
@@ -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)
index b78038a3c95e4fd88831fb5d144f0cf249c3b8dc..09b9ec7a17945b9b0726dc5e8b8a24f151726d2d 100644 (file)
@@ -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);
index 40d23340cecdbb243420727d8bf1556df9e6539b..074bcc58ee80a4ac74779d63158a98f3f4868898 100644 (file)
@@ -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)
index cb5de242e34a46702afa70c1a2d5ef2c715ada33..d12c4939b0581860fb2738cf85c18aa7cf2efafa 100644 (file)
@@ -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);
index 3dd4d0e2d96df53bbfb03faea883ea8572b46f4d..8769a2b635bc8e63f6f5805ff16d3766a4f19dad 100644 (file)
@@ -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());
 
index db2bd4d1327a1faa71471461ac673448b4699da3..d596d765bb8ed777674955de6186c717e66eade0 100644 (file)
@@ -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;
index e1e846bb72911fc20907c6d7b488ec7636afd05f..99fc8f47064f198d00633ef124cf780844863b3a 100644 (file)
@@ -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);
 
index edc5a305279c8b4bd51dd4b3ad06b4155f5f7c79..0a7d0f59170d7738979bbb8017ff9acfd4a0cbf0 100644 (file)
@@ -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);
   }
index 4b957ccceac3b3785fb91e483e2bc0c998a3f519..681fca07e0bbe484bc90570aaff5bd470f939b2e 100644 (file)
@@ -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);
 
index f8f217394b9d99138de09b5232094fb649d48106..221ff79c725ad1ff50c3e2b3ba7ba0aa93268ff0 100644 (file)
@@ -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);
index f6afc136df4f133e372df56fc1241410546dc299..2777c98d41e86f0aa8448d15f61cba85b5e520c9 100644 (file)
@@ -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
index 5084e420e1cca26387bd9e4b63b501ea1c49a6d3..b4c723a3c2bc5b7428eb40cf4add00e93ba8ac30 100644 (file)
@@ -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);
index becc308bc91d4b37b99d98447148d3b0d64080bb..4a41e6de7db25aeaf8c046bac7ac6bdbc1f5068c 100644 (file)
@@ -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());
 
index 73e636d295ba2184a1fcc80bb18243f576b7022a..37cae21a731ea6399186f8490380356ae98cd990 100644 (file)
@@ -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();
index 0bf59f529023b217b20439ecb76913dbb8b5d680..842961bfeb547a7e40cb44747c42497ffe912b92 100644 (file)
@@ -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}");
index 6906e2a549b8f5caa1b5720e21b673398697a006..77257c56e081112c77be13f17adc9ca779ffc630 100644 (file)
@@ -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();
     }
index 337ee7732f625c518bfbe67e35b2a550d190bd7b..424a7b90bb8d87498f47c03d66c7d3c27bb8ddb7 100644 (file)
@@ -45,7 +45,7 @@ public class MetricRepositoryImplTest {
   private MetricRepositoryImpl underTest = new MetricRepositoryImpl(dbClient);
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
   }
 
index 570bab438c9b90fd900104649859f1eafd1b4953..34ec82e1d88ed0d15294fc08398a497c2c3f72b2 100644 (file)
@@ -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}");
   }
index 8af67b31c63d7cf25cc916f2fcfd0cfec38802ff..813419c1c2e71a8dae395eb98295056268d5eaba 100644 (file)
@@ -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)));
index c6f6ac2e3d7fac322e8ff47ef3ea62dfb63b6b9c..b7d36e464346bb14cce73308efcde825bfc0c3c2 100644 (file)
@@ -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);
index a58e5dbbfbd1f1b4fecae72692364c69966a330e..f73fc138aaf384b0a6c27bf427000ed8aba2b630 100644 (file)
@@ -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());
   }
 
index f28f0095349618773d1add98bb0d203734166eb1..5fb4c2df4ad2d2455478e1fb15b07bad319ae385 100644 (file)
@@ -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)
index 85a2807056f3c10e550bd4823abe7ae2de114e70..8429381fb21a1dab33f32a66dfe5b9905cb0b98c 100644 (file)
@@ -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
index 996fd888a72d39874ed7af4fd46925f362551e74..8c13d093fd8847006ed377a4e94f0e4dfc29b862 100644 (file)
@@ -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();
index c480aa5d2fb9b9f6d5ed834fbcb99c0609e121f7..d6794ac2eabca10a449cffeb21e5d69660a86c0c 100644 (file)
@@ -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");
index 2679134da9576097373f7e7ed77b8d334e821ad9..b8741e5b7def310bad181ee13d8ff376b957cd9a 100644 (file)
@@ -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());
index b5bb0dcbb849b788876a8ad6aff69df0a568871a..ee2d54389c98f8e6ee81e91d861c336af94d103a 100644 (file)
@@ -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);
index 30a65aea399013838c85fe97c35dc5015982c939..97fa809a3a16fcf48c66dfe0a7dfe06762b0190e 100644 (file)
@@ -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);
index d870addb478e100de367bd92e9f9148aed1a2658..d36027bbc5ec272148f9e2bef393508b2d533f8a 100644 (file)
@@ -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));
index 094c7fdb071931d0ac1a7a316bd60c6803cdf1ea..cf11bca212082b7496127d6d9f8708312225a57d 100644 (file)
@@ -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);
index da3701f752b6df0948886bc8f1ef12f30b0a6a7c..4356f08f9ece8cf081db9257e50e66f7b1048445 100644 (file)
@@ -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();
index 164bd94ef68fc4c926d7e2bc6a67a87b26d9bbd0..b13e7b22ba683aae287f18df884c5905d84b7c09 100644 (file)
@@ -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();
index 6c7c7dc774d48f11bc0f175d7e1da17651430d56..e17ae72906948c2c9bed06a7a874bd9f06cbe616 100644 (file)
@@ -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())
index 7cb00521a0a53bc959a0adb4f23ca513d24f1b7b..ca3c89c5859ea861dd6d072be18db74d972025bb 100644 (file)
@@ -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(
index 748de4553a3a0a120436dd8fd82b1f0512679c5a..692c305257724f5a42061ee521a9c3d9af15d17e 100644 (file)
@@ -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);
index 8d8126c99585452fcf2e2b29ba8666e5e16b238b..950a4ac7b21dd4691d553bfc16ae3aabb13432bd 100644 (file)
@@ -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());
index 93293f03b4ae9f2ff3de36565832b92599f2766d..fdc3bc3a28b8f913c37aa025e75e265eac9b34bd 100644 (file)
@@ -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);
index 267bf5d5b5f44119e923fb0e25fe91fbd13c5518..8a682e435baf025a89f7b24ae71ac4469ef95dcd 100644 (file)
@@ -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()));
index e7850ac4e1d6fa6cde821f5de38d098719f86d7d..1f40aa2cb00c74e4f6213b44889e7ef545917279 100644 (file)
@@ -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);
index 53b60516c6d0d872b34dcf095699a5894586e3c3..dd2ddadc6f3fa04498158a64bfee36794be2b063 100644 (file)
@@ -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);
   }
index a21099c5f37628b1273ffb30ea73d9d7ac105c73..663be5b4a17c1325f542a82cf126126d89b8f77d 100644 (file)
@@ -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);
index a9e703e5e4351eccdd8e9a06508027f52c418fdd..72d9354f952227b6fcc11ee057cd58c1d46eadd1 100644 (file)
@@ -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());
   }
index b846287b270d44fa7f5d57ca7037d0c963eb971b..92ea18835a115b58260a5778c37d69be679527b1 100644 (file)
@@ -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();
index 10a8e1ce4e4ee8251c56e20d52c5cccda8b2332b..10726eab03bc5a5e045ea53f56cbbefa931e178b 100644 (file)
@@ -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);
index dc96c34fc4084d8a69083ddda24976df4b25b8eb..ad759579da76b4cf526d8e8160608c09bfc54345 100644 (file)
@@ -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: ");
index abc50e78e770640c9ff11ac897fe98651a6da0f3..107509dc705c714074bdba48b41fd23c0d19fb30 100644 (file)
@@ -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);
index bd2e691e29d5fcddb7951f2b7bcb783817d1804f..ee3ffdca96cce0b5acc18c816bc48d2d73e982ed 100644 (file)
@@ -41,7 +41,7 @@ public class IssueAuthorizationDaoTest {
   IssueAuthorizationDao dao = new IssueAuthorizationDao();
 
   @Before
-  public void setUp() throws Exception {
+  public void setUp() {
     dbTester.truncateTables();
   }
 
index a8947c3ba7a99aa374f8250642bdf0198eb62da6..9ecc7685721f73f05fea0c1abf91f639b8ddeb23 100644 (file)
@@ -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();
   }
 
index 6f8e7517a37193deb5d100dc91bd4aedac761f04..15a6671b13a50288c952a4ee94fe15bcf37e186a 100644 (file)
@@ -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();
index 818a64a921c72f7f0d406cc89b288d6fddc0b45b..45871fa616de3d22195d7290e41a9f6732f6ca8e 100644 (file)
@@ -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();
   }
 
index ffd053b7634ac59d001893fd3d716b6ff5b62fe0..22a0469b6b4cd55a7a0934c9bf52b143603aa372 100644 (file)
@@ -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();
   }
 
index 2dcacee88401d4dc1d060321a007c32966ed91b3..1a8f3dbd6fc87116a9ed9bbddb54e5a40988ff97 100644 (file)
@@ -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()));
   }
 
index a93ed1646980352697f04c2a6f04ffa7aeab088d..90b55c60b09b8c09799ef27541f066f1102eb4b1 100644 (file)
@@ -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();
   }
 
index de9ce8c6d327dfcf67dbeb04e3226eb8e4472218..5ac38ed985a6b162c6cdb9f49afd94c88713d9c9 100644 (file)
@@ -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();
   }
 
index 2c4d369f1a8a4d7cebfbbe0f1e51adf7eca64af7..7e6db7a868760962eb0153f0e4719bcf0afa7666 100644 (file)
@@ -68,7 +68,7 @@ public class GhostsActionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     dbSession.close();
   }
 
index 0a121b2b9bbb7cbc493c3e2b6214a3e169dcb2b2..19e925afd1ce1a6ea501e5fd595f4762cc89e5bc 100644 (file)
@@ -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);
index 687ba8391fa7f54723f84c23a148f1ac06d5abcf..dd7cdd159813f3605dcf13ead72c9d505adff846 100644 (file)
@@ -42,7 +42,7 @@ public class SourceLineResultSetIteratorTest {
 
   SourceLineResultSetIterator iterator;
 
-  public void after() throws Exception {
+  public void after() {
     if (iterator != null) {
       iterator.close();
     }
index d59effa65a21f2aa582207e3fe110e1e4a7e655e..803b960b9b37d2d8b5082650eda22913382e56c1 100644 (file)
@@ -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();
index fdee9c931407e6e881f1b5f3cc575a0f9d6d7d48..a2e851e9dc94bac12b455d3095f4d99ca03c1b02 100644 (file)
@@ -50,7 +50,7 @@ public class TestResultSetIteratorTest {
   TestResultSetIterator sut;
 
   @After
-  public void after() throws Exception {
+  public void after() {
     if (sut != null) {
       sut.close();
     }
index 1c15f020e079ae1c627592caeeeb7fbcbe2935d7..fc30049ebb802035314bd80fe2675604415fef0b 100644 (file)
@@ -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);
   }
 
index ac33f8d40780131d7b6c55f57f1747abc5bea827..f98256c24fc02481a4ede2f6929938ea4e9aeb2e 100644 (file)
@@ -47,7 +47,7 @@ public class RubyUserSessionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     // clean up for next test
     threadLocalUserSession.remove();
   }
index 0347c0a5c4b7a16a267439355363b25859e1495b..ec152b7316032c5e343700c5e6b9828bfaba9380 100644 (file)
@@ -42,7 +42,7 @@ public class ThreadLocalUserSessionTest {
   }
 
   @After
-  public void tearDown() throws Exception {
+  public void tearDown() {
     // clean up for next test
     threadLocalUserSession.remove();
   }
index d401c0d6b046667a35d5a2df3c4ed1d087e95c04..5fb813b664383a2c0b718de0948f13f809fcb57e 100644 (file)
@@ -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();
   }
 
index 5c36bb5834f445d1319a822bab3ca0f3846ace00..40e505f7daa342c70267178757a04d4d9787afb8 100644 (file)
@@ -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";
index 411435aebec80152cfc4adf1e55c7029847f6b7e..32598b28f5e6e0161415c470d226a01a7ba57915 100644 (file)
@@ -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);
index 505ee23191e54291916802344ff2bfb5f4125f82..4e513e76302cdd9cc0031a060dac422882661d9b 100644 (file)
@@ -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);
index 79a77fbd9e26908482ad7f8a69d3128527870071..681c2d349355d370d73722a09a0aec08e818d368 100644 (file)
@@ -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;",
       "",
index 9b5f6cf2dc5bf778086748ce73eae87678ef8074..62d41a14a3fd9737e9876a993bd888447b066be2 100644 (file)
@@ -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));
index 2b02b48d42f42f0c29f1182264addcafd00e59d8..35893ede34ecff6e262cdd1bc970789c485f4572 100644 (file)
@@ -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();
 
index cf430a182653bc5d13cb16a0900c39f017bc4778..46ac1d819ba2f1d0fedcc9d9660f8128bfe442a7 100644 (file)
@@ -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();
   }
 }
index 21c24b41e4d45839462437ebbfb6106e7b557c63..7ce29a621b67b617680089ec4cdd30a04a0ed3d4 100644 (file)
@@ -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);
index d4e65fc2f1532e93d6eef70aa2ae9808b9e071fa..7d9092cca2e7af8454f0cfba99f2fc109b24e52d 100644 (file)
@@ -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");
index 533c06b50412bacebe5aa4988074b78ef14a9013..7764675d6c0da39bde4099486237e0a39aac72cb 100644 (file)
@@ -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();
   }
 
index 97dec4e0e06fbcc7719a6fafc7dc2e6a9a26c940..031b1d8d859a51dce5863ddbdf880cc135bf107f 100644 (file)
@@ -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();
   }
 
index 6b1176088fa008a9f6ae8af4ed8c7c794335b07d..ecdcc46149cdb08444f11ac0907a0eb2461539f0 100644 (file)
@@ -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();
   }
 }
index 18f21326780c69e7571079032d45812be9b85d71..1c0c41d20afea97a650e77852598285c3b9f82b2 100644 (file)
@@ -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();
   }
 
index 3704d37c99234c3321a5218d704f0caf3d1f1e34..384e11de2cd9027ba1048d4d69dc0de738f708b6 100644 (file)
@@ -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();
   }