summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemStatusWsActionTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java4
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java10
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java2
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java6
-rw-r--r--server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java2
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/persistence/IsAliveMapperTest.java6
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java2
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/platform/PluginLoaderTest.java2
18 files changed, 30 insertions, 30 deletions
diff --git a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java
index bf4bc9d5596..66196e232a9 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/debt/DebtModelBackupTest.java
@@ -118,7 +118,7 @@ public class DebtModelBackupTest {
DebtModelBackup debtModelBackup;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
userSessionRule.setGlobalPermissions(GlobalPermissions.SYSTEM_ADMIN);
when(system2.now()).thenReturn(now.getTime());
diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java
index 9e70d80a699..50190428539 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/platform/monitoring/PluginsMonitorTest.java
@@ -44,7 +44,7 @@ public class PluginsMonitorTest {
}
@Test
- public void plugin_name_and_version() throws Exception {
+ public void plugin_name_and_version() {
when(repo.getPluginInfos()).thenReturn(Arrays.asList(
new PluginInfo("key-1")
.setName("plugin-1")
diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemStatusWsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemStatusWsActionTest.java
index ddcdaa9f9bd..a64e45a95b9 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemStatusWsActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ws/SystemStatusWsActionTest.java
@@ -69,13 +69,13 @@ public class SystemStatusWsActionTest {
private Request request = mock(Request.class);
@Before
- public void wireMocks() throws Exception {
+ public void wireMocks() {
when(dbClient.openSession(anyBoolean())).thenReturn(dbSession);
when(dbSession.getMapper(IsAliveMapper.class)).thenReturn(isAliveMapper);
}
@Test
- public void action_status_is_defined() throws Exception {
+ public void action_status_is_defined() {
WsTester wsTester = new WsTester();
WebService.NewController newController = wsTester.context().createController(DUMMY_CONTROLLER_KEY);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java
index b027737c116..ce629c07476 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/InstalledPluginReferentialFactoryTest.java
@@ -33,7 +33,7 @@ import static org.mockito.Mockito.when;
public class InstalledPluginReferentialFactoryTest {
@Test
- public void should_create_plugin_referential() throws IOException {
+ public void should_create_plugin_referential() {
PluginInfo info = new PluginInfo("foo");
PluginRepository pluginRepository = mock(PluginRepository.class);
when(pluginRepository.getPluginInfos()).thenReturn(newArrayList(info));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java
index 25b5b4978c4..235831cd6fe 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/MimeTypesTest.java
@@ -38,7 +38,7 @@ public class MimeTypesTest {
}
@Test
- public void only_statics() throws Exception {
+ public void only_statics() {
assertThat(TestUtils.hasOnlyPrivateConstructors(MimeTypes.class)).isTrue();
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
index 8afe4e72f62..6e2a64e6ead 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/PluginReferentialMetadataConverterTest.java
@@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat;
public class PluginReferentialMetadataConverterTest {
@Test
- public void should_convert_info_to_plugin_referential() throws IOException {
+ public void should_convert_info_to_plugin_referential() {
PluginInfo info = new PluginInfo("foo");
PluginReferential pluginReferential = PluginReferentialMetadataConverter.getInstalledPluginReferential(newArrayList(info));
@@ -41,7 +41,7 @@ public class PluginReferentialMetadataConverterTest {
}
@Test
- public void should_not_add_core_plugin() throws IOException {
+ public void should_not_add_core_plugin() {
PluginInfo info = new PluginInfo("foo").setCore(true);
PluginReferential pluginReferential = PluginReferentialMetadataConverter.getInstalledPluginReferential(newArrayList(info));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
index 0e114a78f75..41e3523344c 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ServerPluginRepositoryTest.java
@@ -74,7 +74,7 @@ public class ServerPluginRepositoryTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
underTest.stop();
}
@@ -124,7 +124,7 @@ public class ServerPluginRepositoryTest {
* to test sensibility to null values.
*/
@Test
- public void no_plugins_at_all_on_startup() throws Exception {
+ public void no_plugins_at_all_on_startup() {
underTest.start();
assertThat(underTest.getPluginInfos()).isEmpty();
@@ -301,7 +301,7 @@ public class ServerPluginRepositoryTest {
}
@Test
- public void fail_to_get_missing_plugins() throws Exception {
+ public void fail_to_get_missing_plugins() {
try {
underTest.getPluginInfo("unknown");
fail();
@@ -318,7 +318,7 @@ public class ServerPluginRepositoryTest {
}
@Test
- public void plugin_is_incompatible_if_no_entry_point_class() throws Exception {
+ public void plugin_is_incompatible_if_no_entry_point_class() {
PluginInfo plugin = new PluginInfo("foo").setName("Foo");
assertThat(ServerPluginRepository.isCompatible(plugin, server, Collections.<String, PluginInfo>emptyMap())).isFalse();
assertThat(logs.logs()).contains("Plugin Foo [foo] is ignored because entry point class is not defined");
@@ -328,7 +328,7 @@ public class ServerPluginRepositoryTest {
* Some plugins can only extend the classloader of base plugin, without declaring new extensions.
*/
@Test
- public void plugin_is_compatible_if_no_entry_point_class_but_extend_other_plugin() throws Exception {
+ public void plugin_is_compatible_if_no_entry_point_class_but_extend_other_plugin() {
PluginInfo basePlugin = new PluginInfo("base").setMainClass("org.bar.Bar");
PluginInfo plugin = new PluginInfo("foo").setBasePlugin("base");
Map<String, PluginInfo> plugins = ImmutableMap.of("base", basePlugin, "foo", plugin);
diff --git a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java
index bc3bea14a3a..a0256b3a8fb 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/plugins/ws/PendingPluginsWsActionTest.java
@@ -208,7 +208,7 @@ public class PendingPluginsWsActionTest {
.setImplementationBuild("9ce9d330c313c296fab051317cc5ad4b26319e07");
}
- public PluginInfo newPluginInfo(int id) throws IOException {
+ public PluginInfo newPluginInfo(int id) {
return new PluginInfo("key" + id).setName("name" + id);
}
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java
index c571bf96836..06078595bfa 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/rule/RuleServiceMediumTest.java
@@ -244,7 +244,7 @@ public class RuleServiceMediumTest {
}
@Test(expected = UnauthorizedException.class)
- public void do_not_delete_if_not_granted() throws Exception {
+ public void do_not_delete_if_not_granted() {
userSessionRule.setGlobalPermissions(GlobalPermissions.SCAN_EXECUTION);
service.delete(RuleKey.of("java", "S001"));
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
index eb6160d5717..d75a7c733b1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/RubyUserSessionTest.java
@@ -37,7 +37,7 @@ public class RubyUserSessionTest {
RubyUserSession underTest = new RubyUserSession(platform);
@Before
- public void setUp() throws Exception {
+ public void setUp() {
when(platform.getContainer()).thenReturn(componentContainer);
when(componentContainer.getComponentByType(ThreadLocalUserSession.class)).thenReturn(threadLocalUserSession);
}
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
index 40a64d627ed..1b69404d8c1 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/ThreadLocalUserSessionTest.java
@@ -34,12 +34,12 @@ public class ThreadLocalUserSessionTest {
public ExpectedException thrown = ExpectedException.none();
@Before
- public void setUp() throws Exception {
+ public void setUp() {
threadLocalUserSession.remove();
}
@Test
- public void getSession_get_anonymous_by_default() throws Exception {
+ public void getSession_get_anonymous_by_default() {
UserSession session = threadLocalUserSession.get();
assertThat(session).isNotNull();
@@ -51,7 +51,7 @@ public class ThreadLocalUserSessionTest {
}
@Test
- public void get_session() throws Exception {
+ public void get_session() {
threadLocalUserSession.set(new MockUserSession("karadoc").setUserId(123).setLocale(Locale.FRENCH));
UserSession session = threadLocalUserSession.get();
diff --git a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java
index 2b2f7c545ea..52592d2460b 100644
--- a/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java
+++ b/server/sonar-server/src/test/java/org/sonar/server/user/UserSessionFilterTest.java
@@ -51,7 +51,7 @@ public class UserSessionFilterTest {
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
threadLocalUserSession.remove();
}
diff --git a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
index cafee2bebf2..2adf1b31452 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/bootstrap/BatchPluginRepositoryTest.java
@@ -39,7 +39,7 @@ public class BatchPluginRepositoryTest {
BatchPluginRepository underTest = new BatchPluginRepository(installer, loader);
@Test
- public void install_and_load_plugins() throws Exception {
+ public void install_and_load_plugins() {
PluginInfo info = new PluginInfo("squid");
ImmutableMap<String, PluginInfo> infos = ImmutableMap.of("squid", info);
Plugin instance = mock(Plugin.class);
@@ -57,7 +57,7 @@ public class BatchPluginRepositoryTest {
}
@Test
- public void fail_if_requesting_missing_plugin() throws Exception {
+ public void fail_if_requesting_missing_plugin() {
underTest.start();
try {
diff --git a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java
index 383a93af12e..9b0577ec5b8 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/mediumtest/fs/FileSystemMediumTest.java
@@ -262,7 +262,7 @@ public class FileSystemMediumTest {
}
@Test
- public void scanMultiModuleProject() throws IOException {
+ public void scanMultiModuleProject() {
File projectDir = new File("src/test/resources/mediumtest/xoo/multi-modules-sample");
TaskResult result = tester
.newScanTask(new File(projectDir, "sonar-project.properties"))
diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/IsAliveMapperTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/IsAliveMapperTest.java
index ff5b27a0271..4cf93908b7e 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/IsAliveMapperTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/IsAliveMapperTest.java
@@ -38,18 +38,18 @@ public class IsAliveMapperTest {
IsAliveMapper underTest;
@Before
- public void setUp() throws Exception {
+ public void setUp() {
session = dbTester.myBatis().openSession(false);
underTest = session.getMapper(IsAliveMapper.class);
}
@After
- public void tearDown() throws Exception {
+ public void tearDown() {
session.close();
}
@Test
- public void isAlive_works_for_current_vendors() throws Exception {
+ public void isAlive_works_for_current_vendors() {
assertThat(underTest.isAlive()).isEqualTo(IsAliveMapper.IS_ALIVE_RETURNED_VALUE);
}
}
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java b/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java
index 431890bc012..bf8bd8dda9d 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/ComponentKeysTest.java
@@ -38,7 +38,7 @@ public class ComponentKeysTest {
}
@Test
- public void generate_key_of_object() throws Exception {
+ public void generate_key_of_object() {
assertThat(keys.of(new FakeComponent())).isEqualTo("org.sonar.core.platform.ComponentKeysTest.FakeComponent-fake");
}
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
index 02cdea2aebe..28b33ae338b 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginInfoTest.java
@@ -190,7 +190,7 @@ public class PluginInfoTest {
}
@Test
- public void create_from_file() throws Exception {
+ public void create_from_file() {
File checkstyleJar = FileUtils.toFile(getClass().getResource("/org/sonar/core/plugins/sonar-checkstyle-plugin-2.8.jar"));
PluginInfo checkstyleInfo = PluginInfo.create(checkstyleJar);
@@ -207,7 +207,7 @@ public class PluginInfoTest {
assertThat(pluginInfo.toString()).isEqualTo("[java / 1.1 / SHA1]");
}
- PluginInfo withMinSqVersion(@Nullable String version) throws IOException {
+ PluginInfo withMinSqVersion(@Nullable String version) {
PluginInfo pluginInfo = new PluginInfo("foo");
if (version != null) {
pluginInfo.setMinimalSqVersion(Version.create(version));
diff --git a/sonar-core/src/test/java/org/sonar/core/platform/PluginLoaderTest.java b/sonar-core/src/test/java/org/sonar/core/platform/PluginLoaderTest.java
index c32fc2f711a..e2da9f4c85f 100644
--- a/sonar-core/src/test/java/org/sonar/core/platform/PluginLoaderTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/platform/PluginLoaderTest.java
@@ -43,7 +43,7 @@ public class PluginLoaderTest {
public TemporaryFolder temp = new TemporaryFolder();
@Test
- public void load_and_unload_plugins() throws Exception {
+ public void load_and_unload_plugins() {
File checkstyleJar = FileUtils.toFile(getClass().getResource("/org/sonar/core/plugins/sonar-checkstyle-plugin-2.8.jar"));
PluginInfo checkstyleInfo = PluginInfo.create(checkstyleJar);