aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process/src/test/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2018-01-10 21:14:52 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2018-01-14 20:37:37 +0100
commitd55f047c445daf698ccde5f0af9d0669804c818b (patch)
tree990d01ddad6fd40aff012e1f40bfc8ce77918670 /server/sonar-process/src/test/java
parent4a5be9fbaba0b9729e909eec935852c56f6e71e2 (diff)
downloadsonarqube-d55f047c445daf698ccde5f0af9d0669804c818b.tar.gz
sonarqube-d55f047c445daf698ccde5f0af9d0669804c818b.zip
Cleanup code based on Intellij inspections
Diffstat (limited to 'server/sonar-process/src/test/java')
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java2
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java4
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java4
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberSelectorsTest.java6
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/hz/SuccessfulDistributedCall.java2
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/test/HttpProcess.java2
6 files changed, 10 insertions, 10 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java
index 933e3aee8fa..f34ab26d563 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeDetailsTest.java
@@ -197,7 +197,7 @@ public class NodeDetailsTest {
@Test
public void NodeDetails_is_Externalizable() throws IOException, ClassNotFoundException {
NodeDetails source = testSupport.randomNodeDetails();
- byte[] byteArray = testSupport.serialize(source);
+ byte[] byteArray = NodeDetailsTestSupport.serialize(source);
NodeDetails underTest = (NodeDetails) new ObjectInputStream(new ByteArrayInputStream(byteArray)).readObject();
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java
index cd20a89c7eb..61d78b1b1ae 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/health/NodeHealthTest.java
@@ -141,7 +141,7 @@ public class NodeHealthTest {
@Test
public void class_is_serializable_with_causes() throws IOException, ClassNotFoundException {
NodeHealth source = testSupport.randomBuilder(1).build();
- byte[] bytes = testSupport.serialize(source);
+ byte[] bytes = NodeDetailsTestSupport.serialize(source);
NodeHealth underTest = (NodeHealth) new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject();
@@ -154,7 +154,7 @@ public class NodeHealthTest {
.setStatus(randomStatus)
.setDetails(testSupport.randomNodeDetails());
NodeHealth source = builder.build();
- byte[] bytes = testSupport.serialize(source);
+ byte[] bytes = NodeDetailsTestSupport.serialize(source);
NodeHealth underTest = (NodeHealth) new ObjectInputStream(new ByteArrayInputStream(bytes)).readObject();
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java
index 707beadaf89..ee784627048 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java
@@ -55,7 +55,7 @@ public class HazelcastMemberImplTest {
private static HazelcastMember member3;
@BeforeClass
- public static void setUp() throws Exception {
+ public static void setUp() {
int port1 = NetworkUtilsImpl.INSTANCE.getNextAvailablePort(loopback);
int port2 = NetworkUtilsImpl.INSTANCE.getNextAvailablePort(loopback);
int port3 = NetworkUtilsImpl.INSTANCE.getNextAvailablePort(loopback);
@@ -65,7 +65,7 @@ public class HazelcastMemberImplTest {
}
@AfterClass
- public static void tearDown() throws Exception {
+ public static void tearDown() {
member1.close();
member2.close();
member3.close();
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberSelectorsTest.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberSelectorsTest.java
index 02befcd5dbc..c594410f4a5 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberSelectorsTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberSelectorsTest.java
@@ -34,7 +34,7 @@ import static org.sonar.process.cluster.hz.HazelcastMember.Attribute.PROCESS_KEY
public class HazelcastMemberSelectorsTest {
@Test
- public void selecting_ce_nodes() throws Exception {
+ public void selecting_ce_nodes() {
Member member = mock(Member.class);
MemberSelector underTest = HazelcastMemberSelectors.selectorForProcessIds(COMPUTE_ENGINE);
@@ -49,7 +49,7 @@ public class HazelcastMemberSelectorsTest {
}
@Test
- public void selecting_web_and_app_nodes() throws Exception {
+ public void selecting_web_and_app_nodes() {
Member member = mock(Member.class);
MemberSelector underTest = HazelcastMemberSelectors.selectorForProcessIds(WEB_SERVER, APP);
@@ -62,4 +62,4 @@ public class HazelcastMemberSelectorsTest {
when(member.getStringAttribute(PROCESS_KEY.getKey())).thenReturn(APP.getKey());
assertThat(underTest.select(member)).isTrue();
}
-} \ No newline at end of file
+}
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/SuccessfulDistributedCall.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/SuccessfulDistributedCall.java
index 1053586dd94..4937b5601a7 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/SuccessfulDistributedCall.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/SuccessfulDistributedCall.java
@@ -25,7 +25,7 @@ public class SuccessfulDistributedCall implements DistributedCall<Long> {
static final AtomicLong COUNTER = new AtomicLong();
@Override
- public Long call() throws Exception {
+ public Long call() {
return COUNTER.getAndIncrement();
}
}
diff --git a/server/sonar-process/src/test/java/org/sonar/process/test/HttpProcess.java b/server/sonar-process/src/test/java/org/sonar/process/test/HttpProcess.java
index adc64f54169..dd249cfd0fc 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/test/HttpProcess.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/test/HttpProcess.java
@@ -65,7 +65,7 @@ public class HttpProcess implements Monitored {
server.setHandler(context);
context.setHandler(new AbstractHandler() {
@Override
- public void handle(String target, Request request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException, ServletException {
+ public void handle(String target, Request request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws IOException {
if ("/ping".equals(target)) {
request.setHandled(true);
httpServletResponse.getWriter().print("ping");