You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2010/10/04 04:07:28 UTC
svn commit: r1004084 - in
/tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes:
MultiRegTestCase.java ReplicatedEndpointRegistryTestCase.java
Author: lresende
Date: Mon Oct 4 02:07:28 2010
New Revision: 1004084
URL: http://svn.apache.org/viewvc?rev=1004084&view=rev
Log:
Merging changes from 957345 to use loopback for multicast testing
Modified:
tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
Modified: tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java?rev=1004084&r1=1004083&r2=1004084&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java (original)
+++ tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java Mon Oct 4 02:07:28 2010
@@ -6,15 +6,15 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.tuscany.sca.endpoint.tribes;
@@ -55,8 +55,8 @@ public class MultiRegTestCase implements
public void testReplication() throws Exception {
RuntimeEndpoint ep1 = createEndpoint("ep1uri");
- String host = InetAddress.getLocalHost().getHostAddress();
- String bind = null; // "9.65.158.31";
+ //String host = InetAddress.getLocalHost().getHostAddress();
+ String bind = "127.0.0.1"; // "9.65.158.31";
String port1 = "8085";
String port2 = "8086";
String port3 = "8087";
@@ -74,7 +74,7 @@ public class MultiRegTestCase implements
Map<String, String> attrs2 = new HashMap<String, String>();
// attrs2.put("nomcast", "true");
- attrs1.put("bind", bind);
+ attrs2.put("bind", bind);
attrs2.put("receiverPort", port2);
attrs2.put("receiverAutoBind", range);
// attrs2.put("routes", host + ":"+port1);
@@ -84,7 +84,7 @@ public class MultiRegTestCase implements
Map<String, String> attrs3 = new HashMap<String, String>();
// attrs3.put("nomcast", "true");
- attrs1.put("bind", bind);
+ attrs3.put("bind", bind);
attrs3.put("receiverPort", port3);
attrs3.put("receiverAutoBind", range);
// attrs3.put("routes", host + ":"+port1);
@@ -111,14 +111,14 @@ public class MultiRegTestCase implements
Assert.assertNull(reg3.getEndpoint("ep1uri"));
assertExists(reg2, "ep2uri");
assertExists(reg3, "ep2uri");
-
+
reg1.start();
ep1.bind(extensionPoints, reg1);
reg1.addEndpoint(ep1);
assertExists(reg1, "ep1uri");
assertExists(reg2, "ep1uri");
assertExists(reg3, "ep1uri");
-
+
reg1.stop();
reg2.stop();
reg3.stop();
@@ -149,7 +149,7 @@ public class MultiRegTestCase implements
ep.setURI(uri);
return ep;
}
-
+
private void print(String prefix, Endpoint ep) {
System.out.println(prefix + ": "+ep);
}
Modified: tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java?rev=1004084&r1=1004083&r2=1004084&view=diff
==============================================================================
--- tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java (original)
+++ tuscany/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java Mon Oct 4 02:07:28 2010
@@ -6,19 +6,22 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
- * under the License.
+ * under the License.
*/
package org.apache.tuscany.sca.endpoint.tribes;
+import java.util.HashMap;
+import java.util.Map;
+
import org.apache.tuscany.sca.assembly.AssemblyFactory;
import org.apache.tuscany.sca.assembly.Endpoint;
import org.apache.tuscany.sca.core.DefaultExtensionPointRegistry;
@@ -37,7 +40,9 @@ public class ReplicatedEndpointRegistryT
FactoryExtensionPoint factories = extensionPoints.getExtensionPoint(FactoryExtensionPoint.class);
AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
- ReplicatedEndpointRegistry ep1 = new ReplicatedEndpointRegistry(extensionPoints, null, "foo", "bar");
+ Map<String, String> attrs = new HashMap<String, String>();
+ attrs.put("bind", "127.0.0.1");
+ ReplicatedEndpointRegistry ep1 = new ReplicatedEndpointRegistry(extensionPoints, attrs, "foo", "bar");
System.out.println("ep1 is: " + ep1);
ep1.start();
@@ -50,7 +55,7 @@ public class ReplicatedEndpointRegistryT
System.out.println("EP1 in Registry 1: " + e1p);
Assert.assertNotNull(e1p);
- ReplicatedEndpointRegistry ep2 = new ReplicatedEndpointRegistry(extensionPoints, null, "foo", "bar");
+ ReplicatedEndpointRegistry ep2 = new ReplicatedEndpointRegistry(extensionPoints, attrs, "foo", "bar");
System.out.println("ep2 is: " + ep2);
ep2.start();
Thread.sleep(5000);
@@ -59,7 +64,7 @@ public class ReplicatedEndpointRegistryT
System.out.println("EP1 in Registry 2: " + e1p2);
Assert.assertNotNull(e1p2);
- ReplicatedEndpointRegistry ep3 = new ReplicatedEndpointRegistry(extensionPoints, null, "foo", "bar");
+ ReplicatedEndpointRegistry ep3 = new ReplicatedEndpointRegistry(extensionPoints, attrs, "foo", "bar");
System.out.println("ep3 is: " + ep3);
ep3.start();
Thread.sleep(5000);