aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-process/src/test/java
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2018-04-27 10:24:31 +0200
committerSonarTech <sonartech@sonarsource.com>2018-05-10 20:20:54 +0200
commit656fa53bd8f6b64c788ab97ff851fbb4c244cb7c (patch)
tree608d72f59e6fa6192f5b7586d692d1de91d7d4b2 /server/sonar-process/src/test/java
parent12c9914607973eb5cd4fabfa3627a0184ff23773 (diff)
downloadsonarqube-656fa53bd8f6b64c788ab97ff851fbb4c244cb7c.tar.gz
sonarqube-656fa53bd8f6b64c788ab97ff851fbb4c244cb7c.zip
SONAR-10604 remove HazelcastMember.Attribute.NODE_TYPE
Diffstat (limited to 'server/sonar-process/src/test/java')
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberBuilderTest.java13
-rw-r--r--server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberImplTest.java2
2 files changed, 11 insertions, 4 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberBuilderTest.java b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberBuilderTest.java
index b06d7dc3570..a829d1008ca 100644
--- a/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberBuilderTest.java
+++ b/server/sonar-process/src/test/java/org/sonar/process/cluster/hz/HazelcastMemberBuilderTest.java
@@ -23,11 +23,11 @@ import java.net.InetAddress;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.DisableOnDebug;
+import org.junit.rules.ExpectedException;
import org.junit.rules.TestRule;
import org.junit.rules.Timeout;
import org.sonar.process.NetworkUtilsImpl;
import org.sonar.process.ProcessId;
-import org.sonar.process.cluster.NodeType;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
@@ -36,6 +36,8 @@ import static org.sonar.process.ProcessProperties.Property.CLUSTER_NODE_PORT;
public class HazelcastMemberBuilderTest {
@Rule
+ public ExpectedException expectedException = ExpectedException.none();
+ @Rule
public TestRule safeguardTimeout = new DisableOnDebug(Timeout.seconds(60));
// use loopback for support of offline builds
@@ -45,7 +47,6 @@ public class HazelcastMemberBuilderTest {
@Test
public void build_member() {
HazelcastMember member = underTest
- .setNodeType(NodeType.APPLICATION)
.setProcessId(ProcessId.COMPUTE_ENGINE)
.setNodeName("bar")
.setPort(NetworkUtilsImpl.INSTANCE.getNextAvailablePort(loopback))
@@ -76,4 +77,12 @@ public class HazelcastMemberBuilderTest {
"bar:9100",
"1.2.3.4:" + CLUSTER_NODE_PORT.getDefaultValue());
}
+
+ @Test
+ public void fail_if_elasticsearch_process() {
+ expectedException.expect(IllegalArgumentException.class);
+ expectedException.expectMessage("Hazelcast must not be enabled on Elasticsearch node");
+
+ underTest.setProcessId(ProcessId.ELASTICSEARCH);
+ }
}
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 ee784627048..ebe458f0952 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
@@ -37,7 +37,6 @@ import org.junit.rules.TestRule;
import org.junit.rules.Timeout;
import org.sonar.process.NetworkUtilsImpl;
import org.sonar.process.ProcessId;
-import org.sonar.process.cluster.NodeType;
import static org.assertj.core.api.Assertions.assertThat;
@@ -112,7 +111,6 @@ public class HazelcastMemberImplTest {
private static HazelcastMember newHzMember(int port, int... otherPorts) {
return new HazelcastMemberBuilder()
- .setNodeType(NodeType.APPLICATION)
.setProcessId(ProcessId.COMPUTE_ENGINE)
.setNodeName("name" + port)
.setPort(port)