summaryrefslogtreecommitdiffstats
path: root/sandbox/endpoint-hazelcast/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-02 10:44:14 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-01-02 10:44:14 +0000
commit1adc194c28d1d5ed5c795c12a6904f8728ba6fee (patch)
tree8070e78ac77414ec85b6768461168adb710d3c2d /sandbox/endpoint-hazelcast/src
parent9d9bf40a2866926d4bf58bcddaee8f8a0bd3dcae (diff)
Try with both multicast and explicit addresses
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@895171 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/endpoint-hazelcast/src')
-rw-r--r--sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java36
1 files changed, 17 insertions, 19 deletions
diff --git a/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java b/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
index baf9873efe..9d2da5fcc4 100644
--- a/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
+++ b/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
@@ -38,26 +38,26 @@ import com.hazelcast.nio.Address;
public class RegistryTestCase {
@Test
- public void foo() throws UnknownHostException {
+ public void test1() throws UnknownHostException {
- HazelcastInstance h1 = create(false, 9001, 9002);
+ HazelcastInstance h1 = create(false, 9001);
IMap<Object, Object> h1map = h1.getMap("mymap");
h1map.put("key1", "bla1");
Assert.assertEquals("bla1", h1map.get("key1"));
- HazelcastInstance h2 = create(false, 9002, 9001, 9003);
+ HazelcastInstance h2 = create(true, 9002, 9001);
IMap<Object, Object> h2map = h2.getMap("mymap");
Assert.assertEquals("bla1", h2map.get("key1"));
- HazelcastInstance h3 = create(false, 9003, 9002);
+ HazelcastInstance h3 = create(true, 9003, 9002);
IMap<Object, Object> h3map = h3.getMap("mymap");
Assert.assertEquals("bla1", h3map.get("key1"));
- HazelcastInstance h4 = create(true, 9004, 9003);
- HazelcastInstance h5 = create(true, 9005);
- IMap<Object, Object> h5map = h5.getMap("mymap");
- Assert.assertEquals("bla1", h5map.get("key1"));
+// HazelcastInstance h4 = create(true, 9004, 9003);
+// HazelcastInstance h5 = create(true, 9005);
+// IMap<Object, Object> h5map = h5.getMap("mymap");
+// Assert.assertEquals("bla1", h5map.get("key1"));
// HazelcastInstance h6 = create(false, 9006, 9005);
// IMap<Object, Object> h6map = h6.getMap("mymap");
@@ -66,22 +66,21 @@ public class RegistryTestCase {
}
private HazelcastInstance create(boolean multicast, int listenPort, int... connectPorts) throws UnknownHostException {
- Config config1 = new XmlConfigBuilder().build();
-
- config1.setPort(listenPort);
- config1.setPortAutoIncrement(false);
+ Config config = new XmlConfigBuilder().build();
+ config.setPort(listenPort);
+ config.setPortAutoIncrement(false);
// declare the interface Hazelcast should bind to
- config1.getNetworkConfig().getInterfaces().clear();
- config1.getNetworkConfig().getInterfaces().addInterface(InetAddress.getLocalHost().getHostAddress());
- config1.getNetworkConfig().getInterfaces().setEnabled(true);
+ config.getNetworkConfig().getInterfaces().clear();
+ config.getNetworkConfig().getInterfaces().addInterface(InetAddress.getLocalHost().getHostAddress());
+ config.getNetworkConfig().getInterfaces().setEnabled(true);
if (!multicast) {
- config1.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
+ config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
}
if (connectPorts.length > 0) {
- TcpIpConfig tcpconfig = config1.getNetworkConfig().getJoin().getJoinMembers();
+ TcpIpConfig tcpconfig = config.getNetworkConfig().getJoin().getJoinMembers();
tcpconfig.setEnabled(true);
List<Address> lsMembers = tcpconfig.getAddresses();
@@ -91,8 +90,7 @@ public class RegistryTestCase {
}
}
- HazelcastInstance h1 = Hazelcast.newHazelcastInstance(config1);
- return h1;
+ return Hazelcast.newHazelcastInstance(config);
}
}