summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/branches/sca-java-2.0-M5
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-10-04 02:07:28 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2010-10-04 02:07:28 +0000
commitdbd909e0277e73eceee65939cecbcf8b731e3ee3 (patch)
tree0d1572c3ae66c94b4836fbf16179ab310df47a47 /sca-java-2.x/branches/sca-java-2.0-M5
parent25b96a3aebc9a83b3fb46ff44c9a748291495c17 (diff)
Merging changes from 957345 to use loopback for multicast testing
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1004084 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/branches/sca-java-2.0-M5')
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java20
-rw-r--r--sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java17
2 files changed, 21 insertions, 16 deletions
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
index a470c47ba0..c0321ef3a0 100644
--- a/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/MultiRegTestCase.java
@@ -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 EndpointListener {
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 EndpointListener {
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 EndpointListener {
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 EndpointListener {
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 EndpointListener {
ep.setURI(uri);
return ep;
}
-
+
private void print(String prefix, Endpoint ep) {
System.out.println(prefix + ": "+ep);
}
diff --git a/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java b/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
index 28158d55f5..993562c1eb 100644
--- a/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
+++ b/sca-java-2.x/branches/sca-java-2.0-M5/modules/endpoint-tribes/src/test/java/org/apache/tuscany/sca/endpoint/tribes/ReplicatedEndpointRegistryTestCase.java
@@ -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 ReplicatedEndpointRegistryTestCase {
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 ReplicatedEndpointRegistryTestCase {
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 ReplicatedEndpointRegistryTestCase {
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);