tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject svn commit: r895171 - /tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
Date Sat, 02 Jan 2010 10:44:15 GMT
Author: antelder
Date: Sat Jan  2 10:44:14 2010
New Revision: 895171

URL: http://svn.apache.org/viewvc?rev=895171&view=rev
Log:
Try with both multicast and explicit addresses

Modified:
    tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java

Modified: tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java?rev=895171&r1=895170&r2=895171&view=diff
==============================================================================
--- tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
(original)
+++ tuscany/sandbox/endpoint-hazelcast/src/test/java/org/apache/tuscany/sca/endpoint/hazelcast/RegistryTestCase.java
Sat Jan  2 10:44:14 2010
@@ -38,26 +38,26 @@
 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 @@
     }
 
     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 @@
             }
         }
 
-        HazelcastInstance h1 = Hazelcast.newHazelcastInstance(config1);
-        return h1;
+        return Hazelcast.newHazelcastInstance(config);
     }
 
 }



Mime
View raw message