summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/test/Ice/udp/AllTests.cpp11
-rw-r--r--cpp/test/Ice/udp/Server.cpp13
-rw-r--r--csharp/test/Ice/udp/AllTests.cs10
-rw-r--r--csharp/test/Ice/udp/Server.cs10
-rw-r--r--java-compat/test/src/main/java/test/Ice/udp/AllTests.java15
-rw-r--r--java-compat/test/src/main/java/test/Ice/udp/Server.java16
-rw-r--r--java/test/src/main/java/test/Ice/udp/AllTests.java15
-rw-r--r--java/test/src/main/java/test/Ice/udp/Server.java38
-rw-r--r--scripts/tests/IceDiscovery/simple.py4
9 files changed, 73 insertions, 59 deletions
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp
index 431271cd3e7..fbb4e7ea083 100644
--- a/cpp/test/Ice/udp/AllTests.cpp
+++ b/cpp/test/Ice/udp/AllTests.cpp
@@ -134,20 +134,19 @@ allTests(const CommunicatorPtr& communicator)
cout << "ok" << endl;
- string endpoint;
+ ostringstream endpoint;
if(communicator->getProperties()->getProperty("Ice.IPv6") == "1")
{
+ endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(communicator->getProperties(), 10);
#ifdef __APPLE__
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
-#else
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint << " --interface \"::1\"";
#endif
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint << "udp -h 239.255.1.1 -p " << getTestPort(communicator->getProperties(), 10);
}
- base = communicator->stringToProxy("test -d:" + endpoint);
+ base = communicator->stringToProxy("test -d:" + endpoint.str());
TestIntfPrxPtr objMcast = ICE_UNCHECKED_CAST(TestIntfPrx, base);
#if (!defined(__APPLE__) || (defined(__APPLE__) && !TARGET_OS_IPHONE))
cout << "testing udp multicast... " << flush;
diff --git a/cpp/test/Ice/udp/Server.cpp b/cpp/test/Ice/udp/Server.cpp
index 29b108f60c3..6643dc76d95 100644
--- a/cpp/test/Ice/udp/Server.cpp
+++ b/cpp/test/Ice/udp/Server.cpp
@@ -35,20 +35,19 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
adapter2->activate();
}
- string endpoint;
+ ostringstream endpoint;
if(properties->getProperty("Ice.IPv6") == "1")
{
-#ifndef __APPLE__
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
-#else
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
+ endpoint << "udp -h \"ff15::1:1\" -p " << getTestPort(properties, 10);
+#ifdef __APPLE__
+ endpoint << " --interface \"::1\"";
#endif
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint << "udp -h 239.255.1.1 -p " << getTestPort(properties, 10);
}
- properties->setProperty("McastTestAdapter.Endpoints", endpoint);
+ properties->setProperty("McastTestAdapter.Endpoints", endpoint.str());
Ice::ObjectAdapterPtr mcastAdapter = communicator->createObjectAdapter("McastTestAdapter");
mcastAdapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test"));
mcastAdapter->activate();
diff --git a/csharp/test/Ice/udp/AllTests.cs b/csharp/test/Ice/udp/AllTests.cs
index bc3fb55706f..522f3994f9e 100644
--- a/csharp/test/Ice/udp/AllTests.cs
+++ b/csharp/test/Ice/udp/AllTests.cs
@@ -9,6 +9,7 @@
using Test;
using System;
+using System.Text;
using System.Threading;
public class AllTests
@@ -155,16 +156,17 @@ public class AllTests
Console.Out.Write("testing udp multicast... ");
Console.Out.Flush();
- string endpoint;
+ StringBuilder endpoint = new StringBuilder();
if(communicator.getProperties().getProperty("Ice.IPv6").Equals("1"))
{
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint.Append("udp -h \"ff15::1:1\" -p ");
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint.Append("udp -h 239.255.1.1 -p ");
}
- @base = communicator.stringToProxy("test -d:" + endpoint);
+ endpoint.Append(app.getTestPort(10));
+ @base = communicator.stringToProxy("test -d:" + endpoint.ToString());
TestIntfPrx objMcast = Test.TestIntfPrxHelper.uncheckedCast(@base);
nRetry = 5;
diff --git a/csharp/test/Ice/udp/Server.cs b/csharp/test/Ice/udp/Server.cs
index 71d7f8c581f..dbffc6f8f11 100644
--- a/csharp/test/Ice/udp/Server.cs
+++ b/csharp/test/Ice/udp/Server.cs
@@ -8,6 +8,7 @@
// **********************************************************************
using System;
+using System.Text;
using System.Reflection;
[assembly: CLSCompliant(true)]
@@ -43,16 +44,17 @@ public class Server : TestCommon.Application
adapter2.activate();
}
- string endpoint;
+ StringBuilder endpoint = new StringBuilder();
if(properties.getProperty("Ice.IPv6").Equals("1"))
{
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint.Append("udp -h \"ff15::1:1\" -p ");
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint.Append("udp -h 239.255.1.1 -p ");
}
- properties.setProperty("McastTestAdapter.Endpoints", endpoint);
+ endpoint.Append(getTestPort(properties, 10));
+ properties.setProperty("McastTestAdapter.Endpoints", endpoint.ToString());
Ice.ObjectAdapter mcastAdapter = communicator().createObjectAdapter("McastTestAdapter");
mcastAdapter.add(new TestIntfI(), Ice.Util.stringToIdentity("test"));
mcastAdapter.activate();
diff --git a/java-compat/test/src/main/java/test/Ice/udp/AllTests.java b/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
index a953aa1ef2f..441b35931b6 100644
--- a/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
+++ b/java-compat/test/src/main/java/test/Ice/udp/AllTests.java
@@ -152,23 +152,22 @@ public class AllTests
{
out.print("testing udp multicast... ");
out.flush();
- String endpoint;
+ StringBuilder endpoint = new StringBuilder();
if(communicator.getProperties().getProperty("Ice.IPv6").equals("1"))
{
+ endpoint.append("udp -h \"ff15::1:1\" -p ");
+ endpoint.append(app.getTestPort(communicator.getProperties(), 10));
if(System.getProperty("os.name").contains("OS X"))
{
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
- }
- else
- {
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint.append(" --interface \"::1\"");
}
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint.append("udp -h 239.255.1.1 -p ");
+ endpoint.append(app.getTestPort(communicator.getProperties(), 10));
}
- base = communicator.stringToProxy("test -d:" + endpoint);
+ base = communicator.stringToProxy("test -d:" + endpoint.toString());
TestIntfPrx objMcast = TestIntfPrxHelper.uncheckedCast(base);
nRetry = 5;
diff --git a/java-compat/test/src/main/java/test/Ice/udp/Server.java b/java-compat/test/src/main/java/test/Ice/udp/Server.java
index 1a0f4f5dcf2..dee36662ed9 100644
--- a/java-compat/test/src/main/java/test/Ice/udp/Server.java
+++ b/java-compat/test/src/main/java/test/Ice/udp/Server.java
@@ -39,6 +39,22 @@ public class Server extends test.Util.Application
if(!isAndroid())
{
+ StringBuilder endpoint = new StringBuilder();
+ if(properties.getProperty("Ice.IPv6").equals("1"))
+ {
+ endpoint.append("udp -h \"ff15::1:1\" -p ");
+ endpoint.append(getTestPort(properties, 10));
+ if(System.getProperty("os.name").contains("OS X"))
+ {
+ endpoint.append(" --interface \"::1\"");
+ }
+ }
+ else
+ {
+ endpoint.append("udp -h 239.255.1.1 -p ");
+ endpoint.append(getTestPort(properties, 10));
+ }
+ properties.setProperty("McastTestAdapter.Endpoints", endpoint.toString());
Ice.ObjectAdapter mcastAdapter = communicator().createObjectAdapter("McastTestAdapter");
mcastAdapter.add(new TestIntfI(), Ice.Util.stringToIdentity("test"));
mcastAdapter.activate();
diff --git a/java/test/src/main/java/test/Ice/udp/AllTests.java b/java/test/src/main/java/test/Ice/udp/AllTests.java
index 0a9d41b421f..a2c41512a63 100644
--- a/java/test/src/main/java/test/Ice/udp/AllTests.java
+++ b/java/test/src/main/java/test/Ice/udp/AllTests.java
@@ -146,23 +146,22 @@ public class AllTests
{
out.print("testing udp multicast... ");
out.flush();
- String endpoint;
+ StringBuilder endpoint = new StringBuilder();
if(communicator.getProperties().getProperty("Ice.IPv6").equals("1"))
{
+ endpoint.append("udp -h \"ff15::1:1\" -p ");
+ endpoint.append(app.getTestPort(communicator.getProperties(), 10));
if(System.getProperty("os.name").contains("OS X"))
{
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
- }
- else
- {
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
+ endpoint.append(" --interface \"::1\"");
}
}
else
{
- endpoint = "udp -h 239.255.1.1 -p 12020";
+ endpoint.append("udp -h 239.255.1.1 -p ");
+ endpoint.append(app.getTestPort(communicator.getProperties(), 10));
}
- base = communicator.stringToProxy("test -d:" + endpoint);
+ base = communicator.stringToProxy("test -d:" + endpoint.toString());
TestIntfPrx objMcast = TestIntfPrx.uncheckedCast(base);
nRetry = 5;
diff --git a/java/test/src/main/java/test/Ice/udp/Server.java b/java/test/src/main/java/test/Ice/udp/Server.java
index 59f70333778..573f21e7ac6 100644
--- a/java/test/src/main/java/test/Ice/udp/Server.java
+++ b/java/test/src/main/java/test/Ice/udp/Server.java
@@ -40,6 +40,23 @@ public class Server extends test.Util.Application
if(!isAndroid())
{
+ StringBuilder endpoint = new StringBuilder();
+ if(properties.getProperty("Ice.IPv6").equals("1"))
+ {
+ endpoint.append("udp -h \"ff15::1:1\" -p ");
+ endpoint.append(getTestPort(properties, 10));
+ if(System.getProperty("os.name").contains("OS X"))
+ {
+ endpoint.append(" --interface \"::1\"");
+ }
+ }
+ else
+ {
+ endpoint.append("udp -h 239.255.1.1 -p ");
+ endpoint.append(getTestPort(properties, 10));
+ }
+ properties.setProperty("McastTestAdapter.Endpoints", endpoint.toString());
+
com.zeroc.Ice.ObjectAdapter mcastAdapter = communicator().createObjectAdapter("McastTestAdapter");
mcastAdapter.add(new TestIntfI(), com.zeroc.Ice.Util.stringToIdentity("test"));
mcastAdapter.activate();
@@ -56,27 +73,6 @@ public class Server extends test.Util.Application
initData.properties.setProperty("Ice.Warn.Connections", "0");
initData.properties.setProperty("Ice.UDP.RcvSize", "16384");
initData.properties.setProperty("Ice.UDP.SndSize", "16384");
-
- if(!isAndroid())
- {
- String endpoint;
- if(initData.properties.getProperty("Ice.IPv6").equals("1"))
- {
- if(System.getProperty("os.name").contains("OS X"))
- {
- endpoint = "udp -h \"ff15::1:1\" -p 12020 --interface \"::1\"";
- }
- else
- {
- endpoint = "udp -h \"ff15::1:1\" -p 12020";
- }
- }
- else
- {
- endpoint = "udp -h 239.255.1.1 -p 12020";
- }
- initData.properties.setProperty("McastTestAdapter.Endpoints", endpoint);
- }
return initData;
}
diff --git a/scripts/tests/IceDiscovery/simple.py b/scripts/tests/IceDiscovery/simple.py
index 40c8a00b2a0..4f395201894 100644
--- a/scripts/tests/IceDiscovery/simple.py
+++ b/scripts/tests/IceDiscovery/simple.py
@@ -17,12 +17,14 @@
props = lambda process, current: {
"IceDiscovery.Timeout": 50,
"IceDiscovery.RetryCount": 5,
+ "IceDiscovery.Port": current.driver.getTestPort(10),
"Ice.Plugin.IceDiscovery": current.getPluginEntryPoint("IceDiscovery", process)
}
# Server properties (client properties + plugin configuration)
serverProps = lambda process, current: dict(itertools.chain({
- "Ice.Plugin.IceDiscovery": current.getPluginEntryPoint("IceDiscovery", process)
+ "Ice.Plugin.IceDiscovery": current.getPluginEntryPoint("IceDiscovery", process),
+ "IceDiscovery.Port": current.driver.getTestPort(10)
}.items(), props(process, current).items()))
TestSuite(__name__, [