summaryrefslogtreecommitdiff
path: root/cpp/test/Ice
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2016-11-25 13:13:22 +0100
committerBenoit Foucher <benoit@zeroc.com>2016-11-25 13:13:22 +0100
commitdcdc32af1fced49d80a8ccd93230e15d91ab45d8 (patch)
treeeb69e2555fbd54496fce8a33f4dd610e1473ff51 /cpp/test/Ice
parentC# IceSSL/configuration log expired certificate exceptions. (diff)
downloadice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.bz2
ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.tar.xz
ice-dcdc32af1fced49d80a8ccd93230e15d91ab45d8.zip
Refactored test scripts
Diffstat (limited to 'cpp/test/Ice')
-rw-r--r--cpp/test/Ice/acm/Client.cpp3
-rw-r--r--cpp/test/Ice/acm/Server.cpp3
-rwxr-xr-xcpp/test/Ice/acm/run.py24
-rw-r--r--cpp/test/Ice/adapterDeactivation/AllTests.cpp16
-rw-r--r--cpp/test/Ice/adapterDeactivation/Client.cpp3
-rw-r--r--cpp/test/Ice/adapterDeactivation/Collocated.cpp3
-rw-r--r--cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp6
-rw-r--r--cpp/test/Ice/adapterDeactivation/Server.cpp3
-rw-r--r--cpp/test/Ice/adapterDeactivation/TestI.cpp6
-rwxr-xr-xcpp/test/Ice/adapterDeactivation/run.py25
-rw-r--r--cpp/test/Ice/admin/Client.cpp3
-rw-r--r--cpp/test/Ice/admin/Server.cpp3
-rwxr-xr-xcpp/test/Ice/admin/run.py24
-rw-r--r--cpp/test/Ice/ami/Client.cpp3
-rw-r--r--cpp/test/Ice/ami/Collocated.cpp3
-rw-r--r--cpp/test/Ice/ami/Server.cpp3
-rwxr-xr-xcpp/test/Ice/ami/run.py25
-rw-r--r--cpp/test/Ice/background/Client.cpp5
-rw-r--r--cpp/test/Ice/background/Server.cpp3
-rwxr-xr-xcpp/test/Ice/background/run.py25
-rw-r--r--cpp/test/Ice/binding/AllTests.cpp19
-rw-r--r--cpp/test/Ice/binding/Client.cpp3
-rw-r--r--cpp/test/Ice/binding/Server.cpp3
-rw-r--r--cpp/test/Ice/binding/TestI.cpp23
-rwxr-xr-xcpp/test/Ice/binding/run.py24
-rw-r--r--cpp/test/Ice/checksum/Client.cpp5
-rw-r--r--cpp/test/Ice/checksum/Server.cpp3
-rwxr-xr-xcpp/test/Ice/checksum/run.py24
-rw-r--r--cpp/test/Ice/custom/Client.cpp3
-rw-r--r--cpp/test/Ice/custom/Collocated.cpp3
-rw-r--r--cpp/test/Ice/custom/Server.cpp3
-rw-r--r--cpp/test/Ice/custom/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/custom/run.py27
-rw-r--r--cpp/test/Ice/custom/test.py12
-rw-r--r--cpp/test/Ice/defaultServant/Client.cpp3
-rwxr-xr-xcpp/test/Ice/defaultServant/run.py25
-rwxr-xr-xcpp/test/Ice/defaultValue/run.py24
-rw-r--r--cpp/test/Ice/dispatcher/Client.cpp3
-rw-r--r--cpp/test/Ice/dispatcher/Collocated.cpp3
-rw-r--r--cpp/test/Ice/dispatcher/Server.cpp3
-rwxr-xr-xcpp/test/Ice/dispatcher/run.py25
-rw-r--r--cpp/test/Ice/echo/Server.cpp3
-rwxr-xr-xcpp/test/Ice/echo/run.py29
-rw-r--r--cpp/test/Ice/echo/test.py15
-rw-r--r--cpp/test/Ice/enums/Client.cpp3
-rw-r--r--cpp/test/Ice/enums/Server.cpp3
-rwxr-xr-xcpp/test/Ice/enums/run.py28
-rw-r--r--cpp/test/Ice/exceptions/Client.cpp3
-rw-r--r--cpp/test/Ice/exceptions/Collocated.cpp3
-rw-r--r--cpp/test/Ice/exceptions/Server.cpp3
-rw-r--r--cpp/test/Ice/exceptions/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/exceptions/run.py50
-rw-r--r--cpp/test/Ice/facets/Client.cpp3
-rw-r--r--cpp/test/Ice/facets/Collocated.cpp3
-rw-r--r--cpp/test/Ice/facets/Server.cpp3
-rwxr-xr-xcpp/test/Ice/facets/run.py25
-rw-r--r--cpp/test/Ice/faultTolerance/AllTests.cpp4
-rw-r--r--cpp/test/Ice/faultTolerance/Client.cpp3
-rw-r--r--cpp/test/Ice/faultTolerance/Server.cpp6
-rwxr-xr-xcpp/test/Ice/faultTolerance/run.py48
-rwxr-xr-xcpp/test/Ice/gc/run.py23
-rw-r--r--cpp/test/Ice/gc/test.py11
-rwxr-xr-xcpp/test/Ice/hash/run.py25
-rw-r--r--cpp/test/Ice/hold/Client.cpp3
-rw-r--r--cpp/test/Ice/hold/Server.cpp3
-rwxr-xr-xcpp/test/Ice/hold/run.py24
-rw-r--r--cpp/test/Ice/impl/Server.cpp3
-rw-r--r--cpp/test/Ice/impl/ServerAMD.cpp3
-rw-r--r--cpp/test/Ice/info/AllTests.cpp28
-rw-r--r--cpp/test/Ice/info/Client.cpp3
-rw-r--r--cpp/test/Ice/info/Server.cpp6
-rwxr-xr-xcpp/test/Ice/info/run.py24
-rw-r--r--cpp/test/Ice/inheritance/Client.cpp3
-rw-r--r--cpp/test/Ice/inheritance/Collocated.cpp3
-rw-r--r--cpp/test/Ice/inheritance/Server.cpp3
-rwxr-xr-xcpp/test/Ice/inheritance/run.py25
-rw-r--r--cpp/test/Ice/interceptor/Client.cpp3
-rwxr-xr-xcpp/test/Ice/interceptor/run.py26
-rw-r--r--cpp/test/Ice/invoke/Client.cpp3
-rw-r--r--cpp/test/Ice/invoke/Server.cpp3
-rwxr-xr-xcpp/test/Ice/invoke/run.py31
-rw-r--r--cpp/test/Ice/library/Client.cpp3
-rw-r--r--cpp/test/Ice/library/run.py29
-rw-r--r--cpp/test/Ice/library/test.py10
-rw-r--r--cpp/test/Ice/location/Client.cpp5
-rw-r--r--cpp/test/Ice/location/Server.cpp6
-rw-r--r--cpp/test/Ice/location/TestI.cpp24
-rwxr-xr-xcpp/test/Ice/location/run.py24
-rwxr-xr-xcpp/test/Ice/logger/run.py147
-rw-r--r--cpp/test/Ice/metrics/AllTests.cpp108
-rw-r--r--cpp/test/Ice/metrics/Client.cpp4
-rw-r--r--cpp/test/Ice/metrics/Collocated.cpp8
-rw-r--r--cpp/test/Ice/metrics/Server.cpp8
-rw-r--r--cpp/test/Ice/metrics/ServerAMD.cpp13
-rwxr-xr-xcpp/test/Ice/metrics/run.py27
-rw-r--r--cpp/test/Ice/networkProxy/AllTests.cpp10
-rw-r--r--cpp/test/Ice/networkProxy/Client.cpp6
-rw-r--r--cpp/test/Ice/networkProxy/Server.cpp5
-rwxr-xr-xcpp/test/Ice/networkProxy/run.py45
-rw-r--r--cpp/test/Ice/objects/Client.cpp5
-rw-r--r--cpp/test/Ice/objects/Collocated.cpp3
-rw-r--r--cpp/test/Ice/objects/Server.cpp3
-rwxr-xr-xcpp/test/Ice/objects/run.py34
-rw-r--r--cpp/test/Ice/operations/Client.cpp3
-rw-r--r--cpp/test/Ice/operations/Collocated.cpp3
-rw-r--r--cpp/test/Ice/operations/Server.cpp3
-rw-r--r--cpp/test/Ice/operations/ServerAMD.cpp3
-rw-r--r--cpp/test/Ice/operations/TwowaysAMI.cpp4
-rwxr-xr-xcpp/test/Ice/operations/run.py28
-rw-r--r--cpp/test/Ice/optional/Client.cpp3
-rw-r--r--cpp/test/Ice/optional/Server.cpp3
-rw-r--r--cpp/test/Ice/optional/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/optional/run.py29
-rw-r--r--cpp/test/Ice/plugin/Client.cpp34
-rwxr-xr-xcpp/test/Ice/plugin/run.py25
-rw-r--r--cpp/test/Ice/plugin/test.py12
-rwxr-xr-xcpp/test/Ice/properties/run.py55
-rw-r--r--cpp/test/Ice/proxy/AllTests.cpp21
-rw-r--r--cpp/test/Ice/proxy/Client.cpp3
-rw-r--r--cpp/test/Ice/proxy/Collocated.cpp3
-rw-r--r--cpp/test/Ice/proxy/Server.cpp4
-rw-r--r--cpp/test/Ice/proxy/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/proxy/run.py27
-rw-r--r--cpp/test/Ice/retry/Client.cpp3
-rw-r--r--cpp/test/Ice/retry/Collocated.cpp3
-rw-r--r--cpp/test/Ice/retry/Server.cpp3
-rwxr-xr-xcpp/test/Ice/retry/run.py25
-rw-r--r--cpp/test/Ice/servantLocator/Client.cpp3
-rw-r--r--cpp/test/Ice/servantLocator/Collocated.cpp3
-rw-r--r--cpp/test/Ice/servantLocator/Server.cpp3
-rw-r--r--cpp/test/Ice/servantLocator/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/servantLocator/run.py27
-rw-r--r--cpp/test/Ice/services/AllTests.cpp2
-rw-r--r--cpp/test/Ice/services/Client.cpp3
-rwxr-xr-xcpp/test/Ice/services/run.py24
-rw-r--r--cpp/test/Ice/slicing/exceptions/Client.cpp3
-rw-r--r--cpp/test/Ice/slicing/exceptions/Server.cpp3
-rw-r--r--cpp/test/Ice/slicing/exceptions/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/slicing/exceptions/run.py37
-rw-r--r--cpp/test/Ice/slicing/objects/Client.cpp3
-rw-r--r--cpp/test/Ice/slicing/objects/Server.cpp3
-rw-r--r--cpp/test/Ice/slicing/objects/ServerAMD.cpp3
-rwxr-xr-xcpp/test/Ice/slicing/objects/run.py37
-rw-r--r--cpp/test/Ice/stream/Client.cpp3
-rwxr-xr-xcpp/test/Ice/stream/run.py29
-rw-r--r--cpp/test/Ice/stringConverter/Client.cpp3
-rw-r--r--cpp/test/Ice/stringConverter/Server.cpp3
-rwxr-xr-xcpp/test/Ice/stringConverter/run.py24
-rw-r--r--cpp/test/Ice/threadPoolPriority/Client.cpp3
-rw-r--r--cpp/test/Ice/threadPoolPriority/Server.cpp3
-rw-r--r--cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp3
-rwxr-xr-xcpp/test/Ice/threadPoolPriority/run.py26
-rw-r--r--cpp/test/Ice/threadPoolPriority/test.py14
-rw-r--r--cpp/test/Ice/timeout/Client.cpp3
-rw-r--r--cpp/test/Ice/timeout/Server.cpp3
-rwxr-xr-xcpp/test/Ice/timeout/run.py24
-rw-r--r--cpp/test/Ice/udp/AllTests.cpp16
-rw-r--r--cpp/test/Ice/udp/Client.cpp5
-rw-r--r--cpp/test/Ice/udp/Server.cpp9
-rwxr-xr-xcpp/test/Ice/udp/run.py52
160 files changed, 395 insertions, 1742 deletions
diff --git a/cpp/test/Ice/acm/Client.cpp b/cpp/test/Ice/acm/Client.cpp
index 55f24fafec1..50ff5687f93 100644
--- a/cpp/test/Ice/acm/Client.cpp
+++ b/cpp/test/Ice/acm/Client.cpp
@@ -35,8 +35,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/acm/Server.cpp b/cpp/test/Ice/acm/Server.cpp
index d2af92e45f8..068441bada3 100644
--- a/cpp/test/Ice/acm/Server.cpp
+++ b/cpp/test/Ice/acm/Server.cpp
@@ -42,8 +42,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.ACM.Timeout", "1");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/acm/run.py b/cpp/test/Ice/acm/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/acm/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/adapterDeactivation/AllTests.cpp b/cpp/test/Ice/adapterDeactivation/AllTests.cpp
index c1aa649be20..558c939d5ef 100644
--- a/cpp/test/Ice/adapterDeactivation/AllTests.cpp
+++ b/cpp/test/Ice/adapterDeactivation/AllTests.cpp
@@ -42,26 +42,20 @@ allTests(const CommunicatorPtr& communicator)
if(!winrt || (communicator->getProperties()->getProperty("Ice.Default.Protocol") != "ssl" &&
communicator->getProperties()->getProperty("Ice.Default.Protocol") != "wss"))
{
- string host = communicator->getProperties()->getPropertyAsIntWithDefault("Ice.IPv6", 0) == 0 ?
- "127.0.0.1" : "\"0:0:0:0:0:0:0:1\"";
cout << "creating/destroying/recreating object adapter... " << flush;
- ObjectAdapterPtr adapter =
- communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host);
+ ObjectAdapterPtr adpt = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
try
{
- communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host);
+ communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
test(false);
}
catch(const AlreadyRegisteredException&)
{
}
- adapter->destroy();
+ adpt->destroy();
- //
- // Use a different port than the first adapter to avoid an "address already in use" error.
- //
- adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -h " + host);
- adapter->destroy();
+ adpt = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default");
+ adpt->destroy();
cout << "ok" << endl;
}
}
diff --git a/cpp/test/Ice/adapterDeactivation/Client.cpp b/cpp/test/Ice/adapterDeactivation/Client.cpp
index 57d213db18c..10bb6c1ddc8 100644
--- a/cpp/test/Ice/adapterDeactivation/Client.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Client.cpp
@@ -36,7 +36,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/adapterDeactivation/Collocated.cpp b/cpp/test/Ice/adapterDeactivation/Collocated.cpp
index 1314d809f42..2be431c8db5 100644
--- a/cpp/test/Ice/adapterDeactivation/Collocated.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Collocated.cpp
@@ -48,7 +48,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp
index 02ae90f5771..b73ef715829 100644
--- a/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp
+++ b/cpp/test/Ice/adapterDeactivation/ServantLocatorI.cpp
@@ -44,11 +44,9 @@ ServantLocatorI::locate(const Ice::Current& current, Ice::LocalObjectPtr& cookie
void
#ifdef ICE_CPP11_MAPPING
-ServantLocatorI::finished(const Ice::Current&, const Ice::ObjectPtr&,
- const std::shared_ptr<void>& cookie)
+ServantLocatorI::finished(const Ice::Current&, const Ice::ObjectPtr&, const std::shared_ptr<void>& cookie)
#else
-ServantLocatorI::finished(const Ice::Current&, const Ice::ObjectPtr&,
- const Ice::LocalObjectPtr& cookie)
+ServantLocatorI::finished(const Ice::Current&, const Ice::ObjectPtr&, const Ice::LocalObjectPtr& cookie)
#endif
{
test(!_deactivated);
diff --git a/cpp/test/Ice/adapterDeactivation/Server.cpp b/cpp/test/Ice/adapterDeactivation/Server.cpp
index 622787f1676..b737e236f68 100644
--- a/cpp/test/Ice/adapterDeactivation/Server.cpp
+++ b/cpp/test/Ice/adapterDeactivation/Server.cpp
@@ -38,7 +38,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/adapterDeactivation/TestI.cpp b/cpp/test/Ice/adapterDeactivation/TestI.cpp
index 2f8f2e29e77..f318420ab1d 100644
--- a/cpp/test/Ice/adapterDeactivation/TestI.cpp
+++ b/cpp/test/Ice/adapterDeactivation/TestI.cpp
@@ -10,6 +10,7 @@
#include <IceUtil/IceUtil.h>
#include <Ice/Ice.h>
#include <TestI.h>
+#include <TestCommon.h>
using namespace std;
using namespace Ice;
@@ -18,9 +19,8 @@ void
TestI::transient(const Current& current)
{
CommunicatorPtr communicator = current.adapter->getCommunicator();
-
- ObjectAdapterPtr adapter =
- communicator->createObjectAdapterWithEndpoints("TransientTestAdapter", "default -p 9999");
+ ObjectAdapterPtr adapter = communicator->createObjectAdapterWithEndpoints("TransientTestAdapter",
+ getTestEndpoint(communicator, 1));
adapter->activate();
adapter->destroy();
}
diff --git a/cpp/test/Ice/adapterDeactivation/run.py b/cpp/test/Ice/adapterDeactivation/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/adapterDeactivation/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/admin/Client.cpp b/cpp/test/Ice/admin/Client.cpp
index 2b954f4ac2a..1fcfc0a05ad 100644
--- a/cpp/test/Ice/admin/Client.cpp
+++ b/cpp/test/Ice/admin/Client.cpp
@@ -32,7 +32,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/admin/Server.cpp b/cpp/test/Ice/admin/Server.cpp
index c18d954e2ef..729f9bd73ea 100644
--- a/cpp/test/Ice/admin/Server.cpp
+++ b/cpp/test/Ice/admin/Server.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/admin/run.py b/cpp/test/Ice/admin/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/admin/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/ami/Client.cpp b/cpp/test/Ice/ami/Client.cpp
index 9e4c0e234c7..660157236f5 100644
--- a/cpp/test/Ice/ami/Client.cpp
+++ b/cpp/test/Ice/ami/Client.cpp
@@ -35,8 +35,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.AMICallback", "0");
//
diff --git a/cpp/test/Ice/ami/Collocated.cpp b/cpp/test/Ice/ami/Collocated.cpp
index 0f9abd96355..46d1aec0736 100644
--- a/cpp/test/Ice/ami/Collocated.cpp
+++ b/cpp/test/Ice/ami/Collocated.cpp
@@ -48,8 +48,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.AMICallback", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/ami/Server.cpp b/cpp/test/Ice/ami/Server.cpp
index 7c0ebd03b42..b021aa221eb 100644
--- a/cpp/test/Ice/ami/Server.cpp
+++ b/cpp/test/Ice/ami/Server.cpp
@@ -48,8 +48,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// This test kills connections, so we don't want warnings.
diff --git a/cpp/test/Ice/ami/run.py b/cpp/test/Ice/ami/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/ami/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/background/Client.cpp b/cpp/test/Ice/background/Client.cpp
index f0c60ee8128..c4b2e4fe416 100644
--- a/cpp/test/Ice/background/Client.cpp
+++ b/cpp/test/Ice/background/Client.cpp
@@ -32,8 +32,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// For this test, we want to disable retries.
@@ -46,7 +45,7 @@ main(int argc, char* argv[])
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
-
+
// This test relies on filling the TCP send/recv buffer, so
// we rely on a fixed value for these buffers.
initData.properties->setProperty("Ice.TCP.SndSize", "50000");
diff --git a/cpp/test/Ice/background/Server.cpp b/cpp/test/Ice/background/Server.cpp
index 3f13ca8fbb3..84545c8a271 100644
--- a/cpp/test/Ice/background/Server.cpp
+++ b/cpp/test/Ice/background/Server.cpp
@@ -149,8 +149,7 @@ main(int argc, char* argv[])
{
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// This test kills connections, so we don't want warnings.
diff --git a/cpp/test/Ice/background/run.py b/cpp/test/Ice/background/run.py
deleted file mode 100755
index b53b591197e..00000000000
--- a/cpp/test/Ice/background/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("testtransport"))])
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/binding/AllTests.cpp b/cpp/test/Ice/binding/AllTests.cpp
index 8754af1bd28..cc6bc02cdd6 100644
--- a/cpp/test/Ice/binding/AllTests.cpp
+++ b/cpp/test/Ice/binding/AllTests.cpp
@@ -916,19 +916,26 @@ allTests(const Ice::CommunicatorPtr& communicator)
clientProps.push_back(bothPreferIPv4);
clientProps.push_back(bothPreferIPv6);
+ string endpoint;
+ {
+ ostringstream str;
+ str << "tcp -p " << getTestPort(communicator->getProperties(), 2);
+ endpoint = str.str();
+ }
+
Ice::PropertiesPtr anyipv4 = ipv4->clone();
- anyipv4->setProperty("Adapter.Endpoints", "tcp -p 12012");
- anyipv4->setProperty("Adapter.PublishedEndpoints", "tcp -h 127.0.0.1 -p 12012");
+ anyipv4->setProperty("Adapter.Endpoints", endpoint);
+ anyipv4->setProperty("Adapter.PublishedEndpoints", endpoint + " -h 127.0.0.1");
Ice::PropertiesPtr anyipv6 = ipv6->clone();
- anyipv6->setProperty("Adapter.Endpoints", "tcp -p 12012");
- anyipv6->setProperty("Adapter.PublishedEndpoints", "tcp -h \"::1\" -p 12012");
+ anyipv6->setProperty("Adapter.Endpoints", endpoint);
+ anyipv6->setProperty("Adapter.PublishedEndpoints", endpoint + " -h \"::1\"");
Ice::PropertiesPtr anyboth = Ice::createProperties();
anyboth->setProperty("Ice.IPv4", "1");
anyboth->setProperty("Ice.IPv6", "1");
- anyboth->setProperty("Adapter.Endpoints", "tcp -p 12012");
- anyboth->setProperty("Adapter.PublishedEndpoints", "tcp -h \"::1\" -p 12012:tcp -h 127.0.0.1 -p 12012");
+ anyboth->setProperty("Adapter.Endpoints", endpoint);
+ anyboth->setProperty("Adapter.PublishedEndpoints", endpoint + " -p 12012:" + endpoint + " -p 12012");
Ice::PropertiesPtr localipv4 = ipv4->clone();
localipv4->setProperty("Adapter.Endpoints", "tcp -h 127.0.0.1");
diff --git a/cpp/test/Ice/binding/Client.cpp b/cpp/test/Ice/binding/Client.cpp
index 9bc4acff3a4..c9ea03062c5 100644
--- a/cpp/test/Ice/binding/Client.cpp
+++ b/cpp/test/Ice/binding/Client.cpp
@@ -35,7 +35,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/binding", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/binding/Server.cpp b/cpp/test/Ice/binding/Server.cpp
index 431e7dfe3f2..a7fae8974a7 100644
--- a/cpp/test/Ice/binding/Server.cpp
+++ b/cpp/test/Ice/binding/Server.cpp
@@ -41,7 +41,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/binding/TestI.cpp b/cpp/test/Ice/binding/TestI.cpp
index 38c1b92e2e9..f191b1c176a 100644
--- a/cpp/test/Ice/binding/TestI.cpp
+++ b/cpp/test/Ice/binding/TestI.cpp
@@ -9,12 +9,13 @@
#include <Ice/Ice.h>
#include <TestI.h>
+#include <TestCommon.h>
using namespace std;
using namespace Ice;
using namespace Test;
-RemoteCommunicatorI::RemoteCommunicatorI() : _nextPort(10001)
+RemoteCommunicatorI::RemoteCommunicatorI() : _nextPort(1)
{
}
@@ -34,18 +35,14 @@ RemoteCommunicatorI::createObjectAdapter(const string& name, const string& endpt
{
if(endpoints.find("-p") == string::npos)
{
- // Use a fixed port if none is specified (bug 2896)
- ostringstream os;
- os << endpoints << " -h \""
- << (com->getProperties()->getPropertyWithDefault("Ice.Default.Host", "127.0.0.1"))
- << "\" -p " << _nextPort++;
- endpoints = os.str();
+ endpoints = getTestEndpoint(com, _nextPort++, endpoints);
}
}
-
+
com->getProperties()->setProperty(name + ".ThreadPool.Size", "1");
ObjectAdapterPtr adapter = com->createObjectAdapterWithEndpoints(name, endpoints);
- return ICE_UNCHECKED_CAST(RemoteObjectAdapterPrx, current.adapter->addWithUUID(ICE_MAKE_SHARED(RemoteObjectAdapterI, adapter)));
+ return ICE_UNCHECKED_CAST(RemoteObjectAdapterPrx,
+ current.adapter->addWithUUID(ICE_MAKE_SHARED(RemoteObjectAdapterI, adapter)));
}
#ifdef ICE_CPP11_MAPPING
@@ -65,10 +62,10 @@ RemoteCommunicatorI::shutdown(const Ice::Current& current)
current.adapter->getCommunicator()->shutdown();
}
-RemoteObjectAdapterI::RemoteObjectAdapterI(const Ice::ObjectAdapterPtr& adapter) :
- _adapter(adapter),
- _testIntf(ICE_UNCHECKED_CAST(TestIntfPrx,
- _adapter->add(ICE_MAKE_SHARED(TestI),
+RemoteObjectAdapterI::RemoteObjectAdapterI(const Ice::ObjectAdapterPtr& adapter) :
+ _adapter(adapter),
+ _testIntf(ICE_UNCHECKED_CAST(TestIntfPrx,
+ _adapter->add(ICE_MAKE_SHARED(TestI),
stringToIdentity("test"))))
{
_adapter->activate();
diff --git a/cpp/test/Ice/binding/run.py b/cpp/test/Ice/binding/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/binding/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/checksum/Client.cpp b/cpp/test/Ice/checksum/Client.cpp
index 03a6010177e..e2b795b39bf 100644
--- a/cpp/test/Ice/checksum/Client.cpp
+++ b/cpp/test/Ice/checksum/Client.cpp
@@ -31,8 +31,9 @@ main(int argc, char* argv[])
Ice::registerIceSSL();
#endif
try
- {
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ {
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/checksum/Server.cpp b/cpp/test/Ice/checksum/Server.cpp
index 42d986b2dbf..8e11a544e0e 100644
--- a/cpp/test/Ice/checksum/Server.cpp
+++ b/cpp/test/Ice/checksum/Server.cpp
@@ -35,7 +35,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/checksum/run.py b/cpp/test/Ice/checksum/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/checksum/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/custom/Client.cpp b/cpp/test/Ice/custom/Client.cpp
index 0ab1c20d832..b7880e9021f 100644
--- a/cpp/test/Ice/custom/Client.cpp
+++ b/cpp/test/Ice/custom/Client.cpp
@@ -40,7 +40,8 @@ main(int argc, char** argv)
setProcessStringConverter(ICE_MAKE_SHARED(Test::StringConverterI));
setProcessWstringConverter(ICE_MAKE_SHARED(Test::WstringConverterI));
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/custom/Collocated.cpp b/cpp/test/Ice/custom/Collocated.cpp
index 6eda30c718a..0d5e50e9aff 100644
--- a/cpp/test/Ice/custom/Collocated.cpp
+++ b/cpp/test/Ice/custom/Collocated.cpp
@@ -46,7 +46,8 @@ main(int argc, char** argv)
setProcessStringConverter(ICE_MAKE_SHARED(Test::StringConverterI));
setProcessWstringConverter(ICE_MAKE_SHARED(Test::WstringConverterI));
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/custom/Server.cpp b/cpp/test/Ice/custom/Server.cpp
index c6361f7c0c5..c3b8a90e21a 100644
--- a/cpp/test/Ice/custom/Server.cpp
+++ b/cpp/test/Ice/custom/Server.cpp
@@ -47,7 +47,8 @@ main(int argc, char** argv)
setProcessStringConverter(ICE_MAKE_SHARED(Test::StringConverterI));
setProcessWstringConverter(ICE_MAKE_SHARED(Test::WstringConverterI));
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/custom/ServerAMD.cpp b/cpp/test/Ice/custom/ServerAMD.cpp
index c64aca0aac4..275c7147158 100644
--- a/cpp/test/Ice/custom/ServerAMD.cpp
+++ b/cpp/test/Ice/custom/ServerAMD.cpp
@@ -47,7 +47,8 @@ main(int argc, char** argv)
setProcessStringConverter(ICE_MAKE_SHARED(Test::StringConverterI));
setProcessWstringConverter(ICE_MAKE_SHARED(Test::WstringConverterI));
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/custom/run.py b/cpp/test/Ice/custom/run.py
deleted file mode 100755
index 7921ce9e9ff..00000000000
--- a/cpp/test/Ice/custom/run.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/custom/test.py b/cpp/test/Ice/custom/test.py
new file mode 100644
index 00000000000..0e56af0590d
--- /dev/null
+++ b/cpp/test/Ice/custom/test.py
@@ -0,0 +1,12 @@
+# -*- coding: utf-8 -*-
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+# Don't run this test with SSL, it doesn't work on Windows, see ICE-4588
+TestSuite(__name__, options = { "protocol" : ["tcp", "ws"] })
diff --git a/cpp/test/Ice/defaultServant/Client.cpp b/cpp/test/Ice/defaultServant/Client.cpp
index d6600fdce36..c8c6f178e64 100644
--- a/cpp/test/Ice/defaultServant/Client.cpp
+++ b/cpp/test/Ice/defaultServant/Client.cpp
@@ -32,7 +32,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/defaultServant/run.py b/cpp/test/Ice/defaultServant/run.py
deleted file mode 100755
index 874ef6a5125..00000000000
--- a/cpp/test/Ice/defaultServant/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice-E is licensed to you under the terms described in the
-# ICEE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-TestUtil.simpleTest(client)
diff --git a/cpp/test/Ice/defaultValue/run.py b/cpp/test/Ice/defaultValue/run.py
deleted file mode 100755
index 1a758d84c41..00000000000
--- a/cpp/test/Ice/defaultValue/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-TestUtil.simpleTest(client)
diff --git a/cpp/test/Ice/dispatcher/Client.cpp b/cpp/test/Ice/dispatcher/Client.cpp
index 6440ce065f3..6bb5c265977 100644
--- a/cpp/test/Ice/dispatcher/Client.cpp
+++ b/cpp/test/Ice/dispatcher/Client.cpp
@@ -33,8 +33,7 @@ main(int argc, char* argv[])
int status;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Limit the send buffer size, this test relies on the socket
diff --git a/cpp/test/Ice/dispatcher/Collocated.cpp b/cpp/test/Ice/dispatcher/Collocated.cpp
index 05592f5a8ed..6d91c93a3c4 100644
--- a/cpp/test/Ice/dispatcher/Collocated.cpp
+++ b/cpp/test/Ice/dispatcher/Collocated.cpp
@@ -48,8 +48,7 @@ main(int argc, char* argv[])
int status;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
#ifdef ICE_CPP11_MAPPING
IceUtil::Handle<Dispatcher> dispatcher = new Dispatcher;
initData.dispatcher = [=](function<void()> call, const shared_ptr<Ice::Connection>& conn)
diff --git a/cpp/test/Ice/dispatcher/Server.cpp b/cpp/test/Ice/dispatcher/Server.cpp
index 08dc9b75e17..fa8cf0a1323 100644
--- a/cpp/test/Ice/dispatcher/Server.cpp
+++ b/cpp/test/Ice/dispatcher/Server.cpp
@@ -49,8 +49,7 @@ main(int argc, char* argv[])
int status;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Limit the recv buffer size, this test relies on the socket
diff --git a/cpp/test/Ice/dispatcher/run.py b/cpp/test/Ice/dispatcher/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/dispatcher/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/echo/Server.cpp b/cpp/test/Ice/echo/Server.cpp
index 9d80f8833a9..397509df120 100644
--- a/cpp/test/Ice/echo/Server.cpp
+++ b/cpp/test/Ice/echo/Server.cpp
@@ -69,8 +69,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cpp/test/Ice/echo/run.py b/cpp/test/Ice/echo/run.py
deleted file mode 100755
index 2f0c3b6439d..00000000000
--- a/cpp/test/Ice/echo/run.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-sys.stdout.write("starting server... ")
-sys.stdout.flush()
-server = server = os.path.join(os.getcwd(), TestUtil.getTestExecutable("server"))
-p = TestUtil.startServer(server)
-print("ok")
-sys.stdout.flush()
-p.waitTestSuccess()
diff --git a/cpp/test/Ice/echo/test.py b/cpp/test/Ice/echo/test.py
new file mode 100644
index 00000000000..27ced12e84c
--- /dev/null
+++ b/cpp/test/Ice/echo/test.py
@@ -0,0 +1,15 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+class EchoServerTestCase(ClientServerTestCase):
+
+ def runClientSide(self, current):
+ pass
+
+TestSuite(__name__, [EchoServerTestCase(name="server", server=Server(waitForShutdown=False))])
diff --git a/cpp/test/Ice/enums/Client.cpp b/cpp/test/Ice/enums/Client.cpp
index 14156675eb7..981c32ec106 100644
--- a/cpp/test/Ice/enums/Client.cpp
+++ b/cpp/test/Ice/enums/Client.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/enums", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/enums/Server.cpp b/cpp/test/Ice/enums/Server.cpp
index 45dec2632e4..f73bd41e86a 100644
--- a/cpp/test/Ice/enums/Server.cpp
+++ b/cpp/test/Ice/enums/Server.cpp
@@ -38,7 +38,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/enums/run.py b/cpp/test/Ice/enums/run.py
deleted file mode 100755
index 22809a25c68..00000000000
--- a/cpp/test/Ice/enums/run.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.",
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueClientServerTest(configName = "1.1", message = "Running test with 1.1 encoding.")
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/exceptions/Client.cpp b/cpp/test/Ice/exceptions/Client.cpp
index 650503900ba..ea868afb18a 100644
--- a/cpp/test/Ice/exceptions/Client.cpp
+++ b/cpp/test/Ice/exceptions/Client.cpp
@@ -37,8 +37,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
diff --git a/cpp/test/Ice/exceptions/Collocated.cpp b/cpp/test/Ice/exceptions/Collocated.cpp
index 063bbd25e1a..6a2e5ad8f2b 100644
--- a/cpp/test/Ice/exceptions/Collocated.cpp
+++ b/cpp/test/Ice/exceptions/Collocated.cpp
@@ -39,8 +39,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
diff --git a/cpp/test/Ice/exceptions/Server.cpp b/cpp/test/Ice/exceptions/Server.cpp
index 2a95948c06a..51ad11f564f 100644
--- a/cpp/test/Ice/exceptions/Server.cpp
+++ b/cpp/test/Ice/exceptions/Server.cpp
@@ -47,8 +47,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
diff --git a/cpp/test/Ice/exceptions/ServerAMD.cpp b/cpp/test/Ice/exceptions/ServerAMD.cpp
index 528b0e7ee03..c6d87272714 100644
--- a/cpp/test/Ice/exceptions/ServerAMD.cpp
+++ b/cpp/test/Ice/exceptions/ServerAMD.cpp
@@ -47,8 +47,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "10"); // 10KB max
diff --git a/cpp/test/Ice/exceptions/run.py b/cpp/test/Ice/exceptions/run.py
deleted file mode 100755
index 00f2bf56951..00000000000
--- a/cpp/test/Ice/exceptions/run.py
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.")
-
-TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.",
- additionalClientOptions="--Ice.Default.SlicedFormat",
- additionalServerOptions="--Ice.Default.SlicedFormat")
-
-TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.",
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueClientServerTest(configName = "compactAMD", localOnly = True,
- message = "Running test with compact (default) format and AMD server.",
- server=TestUtil.getTestExecutable("serveramd"))
-
-TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True,
- message = "Running test with sliced format and AMD server.",
- server=TestUtil.getTestExecutable("serveramd"),
- additionalClientOptions="--Ice.Default.SlicedFormat",
- additionalServerOptions="--Ice.Default.SlicedFormat")
-
-TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True,
- message = "Running test with 1.0 encoding and AMD server.",
- server=TestUtil.getTestExecutable("serveramd"),
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/facets/Client.cpp b/cpp/test/Ice/facets/Client.cpp
index 9e970a20bc8..94f9d76a1e0 100644
--- a/cpp/test/Ice/facets/Client.cpp
+++ b/cpp/test/Ice/facets/Client.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/facets", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/facets/Collocated.cpp b/cpp/test/Ice/facets/Collocated.cpp
index 21460a5806c..f5c372212f1 100644
--- a/cpp/test/Ice/facets/Collocated.cpp
+++ b/cpp/test/Ice/facets/Collocated.cpp
@@ -44,7 +44,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/facets/Server.cpp b/cpp/test/Ice/facets/Server.cpp
index 92d0b838bd5..12230ed64e4 100644
--- a/cpp/test/Ice/facets/Server.cpp
+++ b/cpp/test/Ice/facets/Server.cpp
@@ -43,7 +43,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/facets/run.py b/cpp/test/Ice/facets/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/facets/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/faultTolerance/AllTests.cpp b/cpp/test/Ice/faultTolerance/AllTests.cpp
index 5a861677c08..2bb1fbd862b 100644
--- a/cpp/test/Ice/faultTolerance/AllTests.cpp
+++ b/cpp/test/Ice/faultTolerance/AllTests.cpp
@@ -116,7 +116,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports)
ref << "test";
for(vector<int>::const_iterator p = ports.begin(); p != ports.end(); ++p)
{
- ref << ":default -p " << *p;
+ ref << ":" << getTestEndpoint(communicator, *p);
}
Ice::ObjectPrxPtr base = communicator->stringToProxy(ref.str());
test(base);
@@ -282,7 +282,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const vector<int>& ports)
#else
cout << "aborting server #" << i << " and #" << i + 1 << " with idempotent AMI call... " << flush;
CallbackPtr cb = new Callback;
- obj->begin_idempotentAbort(newCallback_TestIntf_idempotentAbort(cb, &Callback::response,
+ obj->begin_idempotentAbort(newCallback_TestIntf_idempotentAbort(cb, &Callback::response,
&Callback::exceptAbortI));
cb->check();
cout << "ok" << endl;
diff --git a/cpp/test/Ice/faultTolerance/Client.cpp b/cpp/test/Ice/faultTolerance/Client.cpp
index 5636653ac06..ef39a9be5b6 100644
--- a/cpp/test/Ice/faultTolerance/Client.cpp
+++ b/cpp/test/Ice/faultTolerance/Client.cpp
@@ -65,8 +65,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0"); // test aborts
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/faultTolerance/Server.cpp b/cpp/test/Ice/faultTolerance/Server.cpp
index c731d007786..9a6b0e63e75 100644
--- a/cpp/test/Ice/faultTolerance/Server.cpp
+++ b/cpp/test/Ice/faultTolerance/Server.cpp
@@ -9,6 +9,7 @@
#include <Ice/Ice.h>
#include <TestI.h>
+#include <TestCommon.h>
using namespace std;
@@ -49,7 +50,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
}
ostringstream endpts;
- endpts << "default -p " << port << ":udp";
+ endpts << getTestEndpoint(communicator, port) << ":udp";
communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpts.str());
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::ObjectPtr object = ICE_MAKE_SHARED(TestI);
@@ -73,8 +74,7 @@ main(int argc, char* argv[])
// our test servers may time out before they are used in the
// test.
//
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.ServerIdleTime", "120"); // Two minutes.
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/faultTolerance/run.py b/cpp/test/Ice/faultTolerance/run.py
deleted file mode 100755
index a581594fbbb..00000000000
--- a/cpp/test/Ice/faultTolerance/run.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-server = os.path.join(os.getcwd(), TestUtil.getTestExecutable("server"))
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-num = 12
-base = 12340
-
-serverProc = []
-for i in range(0, num):
- sys.stdout.write("starting server #%d... " % (i + 1))
- sys.stdout.flush()
- serverProc.append(TestUtil.startServer(server, "%d" % (base + i)))
- print("ok")
-
-ports = ""
-for i in range(0, num):
- ports = "%s %d" % (ports, base + i)
-
-sys.stdout.write("starting client... ")
-sys.stdout.flush()
-clientProc = TestUtil.startClient(client, ports, startReader = False)
-print("ok")
-clientProc.startReader()
-
-clientProc.waitTestSuccess()
-for p in serverProc:
- p.waitTestSuccess()
diff --git a/cpp/test/Ice/gc/run.py b/cpp/test/Ice/gc/run.py
deleted file mode 100755
index 6423deb32a1..00000000000
--- a/cpp/test/Ice/gc/run.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.simpleTest(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client")))
diff --git a/cpp/test/Ice/gc/test.py b/cpp/test/Ice/gc/test.py
new file mode 100644
index 00000000000..f371bb23ced
--- /dev/null
+++ b/cpp/test/Ice/gc/test.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+TestSuite(__name__, options = { "cpp11" : [False] })
diff --git a/cpp/test/Ice/hash/run.py b/cpp/test/Ice/hash/run.py
deleted file mode 100755
index 4ca27f9e829..00000000000
--- a/cpp/test/Ice/hash/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-TestUtil.simpleTest(client)
diff --git a/cpp/test/Ice/hold/Client.cpp b/cpp/test/Ice/hold/Client.cpp
index f69c263d682..3a74970a720 100644
--- a/cpp/test/Ice/hold/Client.cpp
+++ b/cpp/test/Ice/hold/Client.cpp
@@ -36,7 +36,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/hold", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/hold/Server.cpp b/cpp/test/Ice/hold/Server.cpp
index 261d83d4660..3ed04c280ac 100644
--- a/cpp/test/Ice/hold/Server.cpp
+++ b/cpp/test/Ice/hold/Server.cpp
@@ -56,7 +56,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/hold/run.py b/cpp/test/Ice/hold/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/hold/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/impl/Server.cpp b/cpp/test/Ice/impl/Server.cpp
index 91cb3580b0d..dab7a8f6c7b 100644
--- a/cpp/test/Ice/impl/Server.cpp
+++ b/cpp/test/Ice/impl/Server.cpp
@@ -38,8 +38,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Its possible to have batch oneway requests dispatched after
// the adapter is deactivated due to thread scheduling so we
diff --git a/cpp/test/Ice/impl/ServerAMD.cpp b/cpp/test/Ice/impl/ServerAMD.cpp
index 88a22188406..35c7123fce8 100644
--- a/cpp/test/Ice/impl/ServerAMD.cpp
+++ b/cpp/test/Ice/impl/ServerAMD.cpp
@@ -38,8 +38,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Its possible to have batch oneway requests dispatched after
// the adapter is deactivated due to thread scheduling so we
diff --git a/cpp/test/Ice/info/AllTests.cpp b/cpp/test/Ice/info/AllTests.cpp
index 18fb252424c..542d3194e59 100644
--- a/cpp/test/Ice/info/AllTests.cpp
+++ b/cpp/test/Ice/info/AllTests.cpp
@@ -116,7 +116,8 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "test object adapter endpoint information... " << flush;
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h 127.0.0.1 -t 15000:udp -h 127.0.0.1");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints",
+ "default -h 127.0.0.1 -t 15000:udp -h 127.0.0.1");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::EndpointSeq endpoints = adapter->getEndpoints();
@@ -140,8 +141,11 @@ allTests(const Ice::CommunicatorPtr& communicator)
adapter->destroy();
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h * -p 12020");
- communicator->getProperties()->setProperty("TestAdapter.PublishedEndpoints", "default -h 127.0.0.1 -p 12020");
+ int port = getTestPort(communicator->getProperties(), 1);
+ ostringstream portStr;
+ portStr << port;
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -h * -p " + portStr.str());
+ communicator->getProperties()->setProperty("TestAdapter.PublishedEndpoints", getTestEndpoint(communicator, 1));
adapter = communicator->createObjectAdapter("TestAdapter");
endpoints = adapter->getEndpoints();
@@ -152,26 +156,28 @@ allTests(const Ice::CommunicatorPtr& communicator)
for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p)
{
ipEndpoint = getTCPEndpointInfo((*p)->getInfo());
- test(ipEndpoint->port == 12020);
+ test(ipEndpoint->port == port);
}
ipEndpoint = getTCPEndpointInfo(publishedEndpoints[0]->getInfo());
test(ipEndpoint->host == "127.0.0.1");
- test(ipEndpoint->port == 12020);
+ test(ipEndpoint->port == port);
adapter->destroy();
}
cout << "ok" << endl;
}
-
- Ice::ObjectPrxPtr base = communicator->stringToProxy("test:default -p 12010:udp -p 12010 -c");
+
+ string endpoints = getTestEndpoint(communicator, 0) + ":" + getTestEndpoint(communicator, 0, "udp") + " -c";
+ int port = getTestPort(communicator->getProperties(), 0);
+ Ice::ObjectPrxPtr base = communicator->stringToProxy("test:" + endpoints);
TestIntfPrxPtr testIntf = ICE_CHECKED_CAST(TestIntfPrx, base);
cout << "test connection endpoint information... " << flush;
{
Ice::EndpointInfoPtr info = base->ice_getConnection()->getEndpoint()->getInfo();
Ice::TCPEndpointInfoPtr tcpinfo = getTCPEndpointInfo(info);
- test(tcpinfo->port == 12010);
+ test(tcpinfo->port == port);
test(!tcpinfo->compress);
test(tcpinfo->host == defaultHost);
@@ -188,7 +194,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
info = base->ice_datagram()->ice_getConnection()->getEndpoint()->getInfo();
Ice::UDPEndpointInfoPtr udp = ICE_DYNAMIC_CAST(Ice::UDPEndpointInfo, info);
test(udp);
- test(udp->port == 12010);
+ test(udp->port == port);
test(udp->host == defaultHost);
}
cout << "ok" << endl;
@@ -203,7 +209,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(!info->incoming);
test(info->adapterName.empty());
test(info->localPort > 0);
- test(info->remotePort == 12010);
+ test(info->remotePort == port);
if(defaultHost == "127.0.0.1")
{
test(info->remoteAddress == defaultHost);
@@ -264,7 +270,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
test(!udpinfo->incoming);
test(udpinfo->adapterName.empty());
test(udpinfo->localPort > 0);
- test(udpinfo->remotePort == 12010);
+ test(udpinfo->remotePort == port);
if(defaultHost == "127.0.0.1")
{
test(udpinfo->remoteAddress == defaultHost);
diff --git a/cpp/test/Ice/info/Client.cpp b/cpp/test/Ice/info/Client.cpp
index 6aa30209e92..2029090b95f 100644
--- a/cpp/test/Ice/info/Client.cpp
+++ b/cpp/test/Ice/info/Client.cpp
@@ -32,7 +32,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/info/Server.cpp b/cpp/test/Ice/info/Server.cpp
index 47c8bbb3332..78765c87b94 100644
--- a/cpp/test/Ice/info/Server.cpp
+++ b/cpp/test/Ice/info/Server.cpp
@@ -18,7 +18,8 @@ using namespace std;
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010");
+ string endpoints = getTestEndpoint(communicator, 0) + ":" + getTestEndpoint(communicator, 0, "udp");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", endpoints);
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(TestI), Ice::stringToIdentity("test"));
adapter->activate();
@@ -36,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/info/run.py b/cpp/test/Ice/info/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/info/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/inheritance/Client.cpp b/cpp/test/Ice/inheritance/Client.cpp
index c64080f96ab..6e44696210a 100644
--- a/cpp/test/Ice/inheritance/Client.cpp
+++ b/cpp/test/Ice/inheritance/Client.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/inheritance", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/inheritance/Collocated.cpp b/cpp/test/Ice/inheritance/Collocated.cpp
index 0f640de9b8b..13bd1b564d6 100644
--- a/cpp/test/Ice/inheritance/Collocated.cpp
+++ b/cpp/test/Ice/inheritance/Collocated.cpp
@@ -39,7 +39,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/inheritance/Server.cpp b/cpp/test/Ice/inheritance/Server.cpp
index 8ec0c761076..69c5a2ba868 100644
--- a/cpp/test/Ice/inheritance/Server.cpp
+++ b/cpp/test/Ice/inheritance/Server.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/inheritance/run.py b/cpp/test/Ice/inheritance/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/inheritance/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/interceptor/Client.cpp b/cpp/test/Ice/interceptor/Client.cpp
index d77b076c157..4776dd942b8 100644
--- a/cpp/test/Ice/interceptor/Client.cpp
+++ b/cpp/test/Ice/interceptor/Client.cpp
@@ -57,8 +57,7 @@ public:
virtual int _main(int argc, char** argv)
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
_communicator = Ice::initialize(initData);
return run(argc, argv);
diff --git a/cpp/test/Ice/interceptor/run.py b/cpp/test/Ice/interceptor/run.py
deleted file mode 100755
index dc73f0e0506..00000000000
--- a/cpp/test/Ice/interceptor/run.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("interceptortest"))])
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-TestUtil.simpleTest(client, " --Ice.Warn.Dispatch=0")
diff --git a/cpp/test/Ice/invoke/Client.cpp b/cpp/test/Ice/invoke/Client.cpp
index f2d45cb2990..120d3555a98 100644
--- a/cpp/test/Ice/invoke/Client.cpp
+++ b/cpp/test/Ice/invoke/Client.cpp
@@ -40,8 +40,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator, initData);
}
diff --git a/cpp/test/Ice/invoke/Server.cpp b/cpp/test/Ice/invoke/Server.cpp
index c25e72fddf4..7bbd28e143b 100644
--- a/cpp/test/Ice/invoke/Server.cpp
+++ b/cpp/test/Ice/invoke/Server.cpp
@@ -123,8 +123,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cpp/test/Ice/invoke/run.py b/cpp/test/Ice/invoke/run.py
deleted file mode 100755
index a9b2d78339f..00000000000
--- a/cpp/test/Ice/invoke/run.py
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "blobject", message = "Running test with Blobject server.")
-TestUtil.queueClientServerTest(configName = "blobjectArray", message = "Running test with BlobjectArray server.",
- additionalServerOptions = "--array")
-TestUtil.queueClientServerTest(configName = "blobjectAsync", message = "Running test with BlobjectAsync server.",
- additionalServerOptions = "--async")
-TestUtil.queueClientServerTest(configName = "blobjectAsyncArray",
- message = "Running test with BlobjectAsyncArray server.",
- additionalServerOptions = "--array --async")
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/library/Client.cpp b/cpp/test/Ice/library/Client.cpp
index bc8371e95a2..109efc1c4e6 100644
--- a/cpp/test/Ice/library/Client.cpp
+++ b/cpp/test/Ice/library/Client.cpp
@@ -26,7 +26,8 @@ main(int argc, char* argv[])
{
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
// Collocated-only OA
Ice::ObjectAdapterPtr oa = ich->createObjectAdapter("");
diff --git a/cpp/test/Ice/library/run.py b/cpp/test/Ice/library/run.py
deleted file mode 100644
index da3317138ad..00000000000
--- a/cpp/test/Ice/library/run.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("gencode"))])
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("consumer"))])
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("alltests"))])
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-TestUtil.simpleTest(client)
diff --git a/cpp/test/Ice/library/test.py b/cpp/test/Ice/library/test.py
new file mode 100644
index 00000000000..6184d25b675
--- /dev/null
+++ b/cpp/test/Ice/library/test.py
@@ -0,0 +1,10 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+TestSuite(__file__, libDirs=["gencode", "consumer", "alltests"])
diff --git a/cpp/test/Ice/location/Client.cpp b/cpp/test/Ice/location/Client.cpp
index 44fe67ee19a..cd586168359 100644
--- a/cpp/test/Ice/location/Client.cpp
+++ b/cpp/test/Ice/location/Client.cpp
@@ -31,9 +31,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
- initData.properties->setProperty("Ice.Default.Locator", "locator:default -p 12010");
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ initData.properties->setProperty("Ice.Default.Locator", "locator:" + getTestEndpoint(initData.properties, 0));
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/location/Server.cpp b/cpp/test/Ice/location/Server.cpp
index fb2f29a2226..79c0a9abf0c 100644
--- a/cpp/test/Ice/location/Server.cpp
+++ b/cpp/test/Ice/location/Server.cpp
@@ -17,8 +17,7 @@ DEFINE_TEST("server")
using namespace std;
int
-run(int, char**, const Ice::CommunicatorPtr& communicator,
- const Ice::InitializationData& initData)
+run(int, char**, const Ice::CommunicatorPtr& communicator, const Ice::InitializationData& initData)
{
//
// Register the server manager. The server manager creates a new
@@ -63,8 +62,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
assert(initData.properties != ich->getProperties());
return run(argc, argv, ich.communicator(), initData);
diff --git a/cpp/test/Ice/location/TestI.cpp b/cpp/test/Ice/location/TestI.cpp
index 80e391b2a8d..fb55391c3b0 100644
--- a/cpp/test/Ice/location/TestI.cpp
+++ b/cpp/test/Ice/location/TestI.cpp
@@ -10,6 +10,7 @@
#include <Ice/Ice.h>
#include <Ice/Locator.h>
#include <TestI.h>
+#include <TestCommon.h>
using namespace Test;
@@ -17,10 +18,10 @@ ServerManagerI::ServerManagerI(const ServerLocatorRegistryPtr& registry,
const Ice::InitializationData& initData) :
_registry(registry),
_initData(initData),
- _nextPort(12011)
+ _nextPort(1)
{
_initData.properties->setProperty("TestAdapter.AdapterId", "TestAdapter");
- _initData.properties->setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
+ _initData.properties->setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter");
_initData.properties->setProperty("TestAdapter2.AdapterId", "TestAdapter2");
_initData.properties->setProperty("Ice.PrintAdapterReady", "0");
}
@@ -50,21 +51,14 @@ ServerManagerI::startServer(const Ice::Current&)
// Use fixed port to ensure that OA re-activation doesn't re-use previous port from
// another OA (e.g.: TestAdapter2 is re-activated using port of TestAdapter).
//
- {
- std::ostringstream os;
- os << "default -p " << _nextPort++;
- serverCommunicator->getProperties()->setProperty("TestAdapter.Endpoints", os.str());
- }
- {
- std::ostringstream os;
- os << "default -p " << _nextPort++;
- serverCommunicator->getProperties()->setProperty("TestAdapter2.Endpoints", os.str());
- }
+ Ice::PropertiesPtr props = _initData.properties;
+ serverCommunicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(props, _nextPort++));
+ serverCommunicator->getProperties()->setProperty("TestAdapter2.Endpoints", getTestEndpoint(props, _nextPort++));
Ice::ObjectAdapterPtr adapter = serverCommunicator->createObjectAdapter("TestAdapter");
Ice::ObjectAdapterPtr adapter2 = serverCommunicator->createObjectAdapter("TestAdapter2");
- Ice::ObjectPrxPtr locator = serverCommunicator->stringToProxy("locator:default -p 12010");
+ Ice::ObjectPrxPtr locator = serverCommunicator->stringToProxy("locator:" + getTestEndpoint(props, 0));
adapter->setLocator(ICE_UNCHECKED_CAST(Ice::LocatorPrx, locator));
adapter2->setLocator(ICE_UNCHECKED_CAST(Ice::LocatorPrx, locator));
@@ -88,8 +82,8 @@ ServerManagerI::shutdown(const Ice::Current& current)
}
-TestI::TestI(const Ice::ObjectAdapterPtr& adapter,
- const Ice::ObjectAdapterPtr& adapter2,
+TestI::TestI(const Ice::ObjectAdapterPtr& adapter,
+ const Ice::ObjectAdapterPtr& adapter2,
const ServerLocatorRegistryPtr& registry) :
_adapter1(adapter), _adapter2(adapter2), _registry(registry)
{
diff --git a/cpp/test/Ice/location/run.py b/cpp/test/Ice/location/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/location/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/logger/run.py b/cpp/test/Ice/logger/run.py
deleted file mode 100755
index 4744ede4eb4..00000000000
--- a/cpp/test/Ice/logger/run.py
+++ /dev/null
@@ -1,147 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, subprocess, glob, atexit, shutil
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-def test(cmd, match, enc):
- p = subprocess.Popen([cmd], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
- out, err = p.communicate()
- ret = p.poll()
- if ret != 0:
- print("%s failed! status %s " % (cmd, ret))
- if out.decode(enc).find(match.decode(enc)) == -1:
- raise RuntimeError("test failed")
-
-TestUtil.simpleTest(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client1")))
-env = TestUtil.getTestEnv("cpp", os.getcwd())
-
-sys.stdout.write("testing logger ISO-8859-15 output... ")
-test(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client2")), b'aplicaci\xf3n', "ISO-8859-15")
-print("ok")
-
-sys.stdout.write("testing logger UTF8 output without string converter... ")
-test(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client3")), b'aplicaci\xc3\xb3n', "UTF8")
-print("ok")
-
-sys.stdout.write("testing logger UTF8 output with ISO-8859-15 narrow string converter... ")
-#
-# In Windows expected output is UTF8, because the console output code page is set to UTF-8
-# in Linux and OS X, the expected output is ISO-8859-15 because that is the narrow string
-# encoding used by the application.
-#
-if TestUtil.isWin32():
- test(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client4")), b'aplicaci\xc3\xb3n', "UTF8")
-else:
- test(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client4")), b'aplicaci\xf3n', "ISO-8859-15")
-print("ok")
-
-sys.stdout.write("testing logger file rotation... ")
-
-def cleanup():
- for f in glob.glob("client5-*.log"):
- os.remove(f)
- if os.path.exists("log/client5-4.log"):
- os.remove("log/client5-4.log")
-
-cleanup()
-
-atexit.register(cleanup)
-
-if not os.path.exists("log"):
- os.makedirs("log")
-
-open("log/client5-4.log", 'a').close()
-
-if TestUtil.isWin32():
- os.system("echo Y|cacls log /P \"%USERNAME%\":R 1> nul")
-else:
- os.system("chmod -w log")
-
-p = subprocess.Popen(os.path.join(os.getcwd(), TestUtil.getTestExecutable("client5")), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
-out, err = p.communicate()
-ret = p.poll()
-if ret != 0:
- print("failed! status %s " % ret)
- sys.exit(1)
-
-if TestUtil.isWin32():
- os.system("echo Y|cacls log /P \"%USERNAME%\":F 1> nul")
-else:
- os.system("chmod +w log")
-
-if (not os.path.isfile("client5-0.log") or
- not os.stat("client5-0.log").st_size == 512 or
- len(glob.glob("client5-0-*.log")) != 19):
- print("failed!")
- sys.exit(1)
-
-for f in glob.glob("client5-0-*.log"):
- if not os.stat(f).st_size == 512:
- print("failed! file {0} size: {1} unexpected".format(f, os.stat(f).st_size))
- sys.exit(1)
-
-if (not os.path.isfile("client5-1.log") or
- not os.stat("client5-1.log").st_size == 1024 or
- len(glob.glob("client5-1-*.log")) != 0):
- print("failed!")
- sys.exit(1)
-
-if (not os.path.isfile("client5-2.log") or
- not os.stat("client5-2.log").st_size == 128 or
- len(glob.glob("client5-2-*.log")) != 7):
- print("failed!")
- sys.exit(1)
-
-for f in glob.glob("client5-2-*.log"):
- if not os.stat(f).st_size == 128:
- print("failed! file {0} size: {1} unexpected".format(f, os.stat(f).st_size))
- sys.exit(1)
-
-if (not os.path.isfile("client5-3.log") or
- not os.stat("client5-2.log").st_size == 128 or
- len(glob.glob("client5-2-*.log")) != 7):
- print("failed!")
- sys.exit(1)
-
-for f in glob.glob("client5-3-*.log"):
- if not os.stat(f).st_size == 128:
- print("failed! file {0} size: {1} unexpected".format(f, os.stat(f).st_size))
- sys.exit(1)
-
-#
-# When running as root log rotation will not fail as
-# root always has write access.
-#
-if TestUtil.isWin32() or os.getuid() != 0:
- if (not os.path.isfile("log/client5-4.log") or
- os.stat("log/client5-4.log").st_size < 1024 or
- len(glob.glob("log/client5-4-*.log")) > 0):
- print("failed!")
- sys.exit(1)
-
- with open("log/client5-4.log", 'r') as f:
- if f.read().count("error: FileLogger: cannot rename `log/client5-4.log'") != 1:
- print("failed!")
- sys.exit(1)
-
-shutil.rmtree("log")
-
-print("ok")
diff --git a/cpp/test/Ice/metrics/AllTests.cpp b/cpp/test/Ice/metrics/AllTests.cpp
index c5d692fd2d7..3faea063c8d 100644
--- a/cpp/test/Ice/metrics/AllTests.cpp
+++ b/cpp/test/Ice/metrics/AllTests.cpp
@@ -55,10 +55,18 @@ private:
};
typedef IceUtil::Handle<Callback> CallbackPtr;
+string
+getPort(const Ice::PropertiesAdminPrxPtr& p)
+{
+ ostringstream os;
+ os << getTestPort(p->ice_getCommunicator()->getProperties(), 0);
+ return os.str();
+}
+
Ice::PropertyDict
-getClientProps(const Ice::PropertiesAdminPrxPtr& p, const Ice::PropertyDict& orig, const string& m = string())
+getClientProps(const Ice::PropertiesAdminPrxPtr& pa, const Ice::PropertyDict& orig, const string& m = string())
{
- Ice::PropertyDict props = p->getPropertiesForPrefix("IceMX.Metrics");
+ Ice::PropertyDict props = pa->getPropertiesForPrefix("IceMX.Metrics");
for(Ice::PropertyDict::iterator p = props.begin(); p != props.end(); ++p)
{
p->second = "";
@@ -73,15 +81,15 @@ getClientProps(const Ice::PropertiesAdminPrxPtr& p, const Ice::PropertyDict& ori
map += "Map." + m + '.';
}
props["IceMX.Metrics.View." + map + "Reject.parent"] = "Ice\\.Admin";
- props["IceMX.Metrics.View." + map + "Accept.endpointPort"] = "12010";
+ props["IceMX.Metrics.View." + map + "Accept.endpointPort"] = getPort(pa);
props["IceMX.Metrics.View." + map + "Reject.identity"] = ".*/admin|controller";
return props;
}
Ice::PropertyDict
-getServerProps(const Ice::PropertiesAdminPrxPtr& p, const Ice::PropertyDict& orig, const string& m = string())
+getServerProps(const Ice::PropertiesAdminPrxPtr& pa, const Ice::PropertyDict& orig, const string& m = string())
{
- Ice::PropertyDict props = p->getPropertiesForPrefix("IceMX.Metrics");
+ Ice::PropertyDict props = pa->getPropertiesForPrefix("IceMX.Metrics");
for(Ice::PropertyDict::iterator p = props.begin(); p != props.end(); ++p)
{
p->second = "";
@@ -96,7 +104,7 @@ getServerProps(const Ice::PropertiesAdminPrxPtr& p, const Ice::PropertyDict& ori
map += "Map." + m + '.';
}
props["IceMX.Metrics.View." + map + "Reject.parent"] = "Ice\\.Admin|Controller";
- props["IceMX.Metrics.View." + map + "Accept.endpointPort"] = "12010";
+ props["IceMX.Metrics.View." + map + "Accept.endpointPort"] = getPort(pa);
return props;
}
@@ -408,7 +416,24 @@ toMap(const IceMX::MetricsMap& mmap)
MetricsPrxPtr
allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPtr& obsv)
{
- MetricsPrxPtr metrics = ICE_CHECKED_CAST(MetricsPrx, communicator->stringToProxy("metrics:default -p 12010"));
+ Ice::PropertiesPtr properties = communicator->getProperties();
+ string host = getTestHost(properties);
+ string port;
+ {
+ ostringstream os;
+ os << getTestPort(properties, 0);
+ port = os.str();
+ }
+ string hostAndPort = host + ":" + port;
+ string protocol = getTestProtocol(properties);
+ string endpoint;
+ {
+ ostringstream os;
+ os << protocol << " -h " << host << " -p " << port;
+ endpoint = os.str();
+ }
+
+ MetricsPrxPtr metrics = ICE_CHECKED_CAST(MetricsPrx, communicator->stringToProxy("metrics:" + endpoint));
bool collocated = !metrics->ice_getConnection();
cout << "testing metrics admin facet checkedCast... " << flush;
@@ -522,12 +547,6 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
map<string, IceMX::MetricsPtr> map;
- string endpoint;
- {
- ostringstream os;
- os << communicator->getProperties()->getPropertyWithDefault("Ice.Default.Protocol", "tcp") << " -h 127.0.0.1 -p 12010";
- endpoint = os.str();
- }
string type;
string isSecure;
if(!collocated)
@@ -617,7 +636,8 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
map = toMap(clientMetrics->getMetricsView("View", timestamp)["Connection"]);
test(map["active"]->current == 1);
- ControllerPrxPtr controller = ICE_CHECKED_CAST(ControllerPrx, communicator->stringToProxy("controller:default -p 12011"));
+ Ice::ObjectPrxPtr cprx = communicator->stringToProxy("controller:" + getTestEndpoint(communicator, 1));
+ ControllerPrxPtr controller = ICE_CHECKED_CAST(ControllerPrx, cprx);
controller->hold();
map = toMap(clientMetrics->getMetricsView("View", timestamp)["Connection"]);
@@ -684,16 +704,16 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointIsSecure", isSecure);
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointTimeout", "500");
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointCompress", "false");
- testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointHost", "127.0.0.1");
- testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointPort", "12010");
+ testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointHost", host);
+ testAttribute(clientMetrics, clientProps, update.get(), "Connection", "endpointPort", port);
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "incoming", "false");
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "adapterName", "");
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "connectionId", "Con1");
- testAttribute(clientMetrics, clientProps, update.get(), "Connection", "localHost", "127.0.0.1");
+ testAttribute(clientMetrics, clientProps, update.get(), "Connection", "localHost", host);
//testAttribute(clientMetrics, clientProps, update.get(), "Connection", "localPort", "");
- testAttribute(clientMetrics, clientProps, update.get(), "Connection", "remoteHost", "127.0.0.1");
- testAttribute(clientMetrics, clientProps, update.get(), "Connection", "remotePort", "12010");
+ testAttribute(clientMetrics, clientProps, update.get(), "Connection", "remoteHost", host);
+ testAttribute(clientMetrics, clientProps, update.get(), "Connection", "remotePort", port);
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "mcastHost", "");
testAttribute(clientMetrics, clientProps, update.get(), "Connection", "mcastPort", "");
@@ -714,13 +734,13 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
test(clientMetrics->getMetricsView("View", timestamp)["ConnectionEstablishment"].size() == 1);
IceMX::MetricsPtr m1 = clientMetrics->getMetricsView("View", timestamp)["ConnectionEstablishment"][0];
- test(m1->current == 0 && m1->total == 1 && m1->id == "127.0.0.1:12010");
+ test(m1->current == 0 && m1->total == 1 && m1->id == hostAndPort);
metrics->ice_getConnection()->close(false);
controller->hold();
try
{
- communicator->stringToProxy("test:tcp -p 12010 -h 127.0.0.1")->ice_timeout(10)->ice_ping();
+ communicator->stringToProxy("test:" + endpoint)->ice_timeout(10)->ice_ping();
test(false);
}
catch(const Ice::ConnectTimeoutException&)
@@ -733,13 +753,13 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
controller->resume();
test(clientMetrics->getMetricsView("View", timestamp)["ConnectionEstablishment"].size() == 1);
m1 = clientMetrics->getMetricsView("View", timestamp)["ConnectionEstablishment"][0];
- test(m1->id == "127.0.0.1:12010" && m1->total == 3 && m1->failures == 2);
+ test(m1->id == hostAndPort && m1->total == 3 && m1->failures == 2);
checkFailure(clientMetrics, "ConnectionEstablishment", m1->id, "::Ice::ConnectTimeoutException", 2);
Connect c(metrics);
testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "parent", "Communicator", c);
- testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "id", "127.0.0.1:12010", c);
+ testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "id", hostAndPort, c);
testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpoint",
endpoint + " -t 60000", c);
@@ -748,8 +768,8 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointIsSecure", isSecure, c);
testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointTimeout", "60000", c);
testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointCompress", "false", c);
- testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointHost", "127.0.0.1", c);
- testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointPort", "12010", c);
+ testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointHost", host, c);
+ testAttribute(clientMetrics, clientProps, update.get(), "ConnectionEstablishment", "endpointPort", port, c);
cout << "ok" << endl;
@@ -760,24 +780,28 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
#if !defined(ICE_OS_WINRT) && TARGET_OS_IPHONE==0
cout << "testing endpoint lookup metrics... " << flush;
- props["IceMX.Metrics.View.Map.ConnectionEstablishment.GroupBy"] = "id";
+ props["IceMX.Metrics.View.Map.EndpointLookup.GroupBy"] = "id";
updateProps(clientProps, serverProps, update.get(), props, "EndpointLookup");
test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].empty());
- Ice::ObjectPrxPtr prx = communicator->stringToProxy("metrics:default -p 12010 -h localhost -t infinite");
- prx->ice_ping();
+ Ice::ObjectPrxPtr prx = communicator->stringToProxy("metrics:" + protocol + " -h localhost -t 500 -p " + port);
+ try
+ {
+ prx->ice_ping();
+ prx->ice_getConnection()->close(false);
+ }
+ catch(const Ice::LocalException&)
+ {
+ }
test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].size() == 1);
m1 = clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"][0];
-
- test(m1->current <= 1 && m1->total == 1 && m1->id == prx->ice_getConnection()->getEndpoint()->toString());
-
- prx->ice_getConnection()->close(false);
+ test(m1->current <= 1 && (m1->total == 1 || m1->total == 2));
bool dnsException = false;
try
{
- communicator->stringToProxy("test:tcp -t 500 -p 12010 -h unknownfoo.zeroc.com")->ice_ping();
+ communicator->stringToProxy("test:tcp -t 500 -h unknownfoo.zeroc.com -p " + port)->ice_ping();
test(false);
}
catch(const Ice::DNSException&)
@@ -790,7 +814,7 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
}
test(clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"].size() == 2);
m1 = clientMetrics->getMetricsView("View", timestamp)["EndpointLookup"][1];
- test(m1->id == "tcp -h unknownfoo.zeroc.com -p 12010 -t 500" && m1->total == 2 &&
+ test(m1->id == "tcp -h unknownfoo.zeroc.com -p " + port + " -t 500" && m1->total == 2 &&
(!dnsException || m1->failures == 2));
if(dnsException)
{
@@ -808,10 +832,10 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointType", type, c);
testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointIsDatagram", "false", c);
testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointIsSecure", isSecure, c);
- testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointTimeout", "-1", c);
+ testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointTimeout", "500", c);
testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointCompress", "false", c);
testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointHost", "localhost", c);
- testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointPort", "12010", c);
+ testAttribute(clientMetrics, clientProps, update.get(), "EndpointLookup", "endpointPort", port, c);
cout << "ok" << endl;
#endif
@@ -915,16 +939,16 @@ allTests(const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPt
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointIsSecure", isSecure, op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointTimeout", "60000", op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointCompress", "false", op);
- testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointHost", "127.0.0.1", op);
- testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointPort", "12010", op);
+ testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointHost", host, op);
+ testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "endpointPort", port, op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "incoming", "true", op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "adapterName", "TestAdapter", op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "connectionId", "", op);
- testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "localHost", "127.0.0.1", op);
- testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "localPort", "12010", op);
- testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "remoteHost", "127.0.0.1", op);
- //testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "remotePort", "12010", op);
+ testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "localHost", host, op);
+ testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "localPort", port, op);
+ testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "remoteHost", host, op);
+ //testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "remotePort", port, op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "mcastHost", "", op);
testAttribute(serverMetrics, serverProps, update.get(), "Dispatch", "mcastPort", "", op);
}
diff --git a/cpp/test/Ice/metrics/Client.cpp b/cpp/test/Ice/metrics/Client.cpp
index 65611a7de95..0e2c3e95b95 100644
--- a/cpp/test/Ice/metrics/Client.cpp
+++ b/cpp/test/Ice/metrics/Client.cpp
@@ -34,14 +34,12 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Admin.Endpoints", "default");
initData.properties->setProperty("Ice.Admin.InstanceName", "client");
initData.properties->setProperty("Ice.Admin.DelayCreation", "1");
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
- initData.properties->setProperty("Ice.Default.Host", "127.0.0.1");
CommunicatorObserverIPtr observer = ICE_MAKE_SHARED(CommunicatorObserverI);
initData.observer = observer;
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/metrics/Collocated.cpp b/cpp/test/Ice/metrics/Collocated.cpp
index dd314954612..f79a4ca8d6e 100644
--- a/cpp/test/Ice/metrics/Collocated.cpp
+++ b/cpp/test/Ice/metrics/Collocated.cpp
@@ -20,12 +20,12 @@ using namespace Test;
int
run(int, char**, const Ice::CommunicatorPtr& communicator, const CommunicatorObserverIPtr& observer)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(MetricsI), Ice::stringToIdentity("metrics"));
//adapter->activate(); // Don't activate OA to ensure collocation is used.
- communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011");
+ communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1));
Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter");
controllerAdapter->add(ICE_MAKE_SHARED(ControllerI, adapter), Ice::stringToIdentity("controller"));
//controllerAdapter->activate(); // Don't activate OA to ensure collocation is used.
@@ -44,15 +44,13 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Admin.Endpoints", "tcp");
initData.properties->setProperty("Ice.Admin.InstanceName", "client");
initData.properties->setProperty("Ice.Admin.DelayCreation", "1");
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
- initData.properties->setProperty("Ice.Default.Host", "127.0.0.1");
CommunicatorObserverIPtr observer = ICE_MAKE_SHARED(CommunicatorObserverI);
initData.observer = observer;
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/metrics/Server.cpp b/cpp/test/Ice/metrics/Server.cpp
index e5daf413204..970739640f8 100644
--- a/cpp/test/Ice/metrics/Server.cpp
+++ b/cpp/test/Ice/metrics/Server.cpp
@@ -18,12 +18,12 @@ using namespace std;
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(MetricsI), Ice::stringToIdentity("metrics"));
adapter->activate();
- communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011");
+ communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1));
Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter");
controllerAdapter->add(ICE_MAKE_SHARED(ControllerI, adapter), Ice::stringToIdentity("controller"));
controllerAdapter->activate();
@@ -42,8 +42,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//initData.properties->setProperty("Ice.ThreadPool.Server.Size", "1");
//initData.properties->setProperty("Ice.ThreadPool.Server.SizeMax", "1");
initData.properties->setProperty("Ice.Admin.Endpoints", "tcp");
@@ -51,7 +50,6 @@ main(int argc, char* argv[])
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
- initData.properties->setProperty("Ice.Default.Host", "127.0.0.1");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/metrics/ServerAMD.cpp b/cpp/test/Ice/metrics/ServerAMD.cpp
index 40aee438374..ec6e9fcbf38 100644
--- a/cpp/test/Ice/metrics/ServerAMD.cpp
+++ b/cpp/test/Ice/metrics/ServerAMD.cpp
@@ -18,12 +18,12 @@ using namespace std;
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0));
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
adapter->add(ICE_MAKE_SHARED(MetricsI), Ice::stringToIdentity("metrics"));
adapter->activate();
- communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", "default -p 12011");
+ communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(communicator, 1));
Ice::ObjectAdapterPtr controllerAdapter = communicator->createObjectAdapter("ControllerAdapter");
controllerAdapter->add(ICE_MAKE_SHARED(ControllerI, adapter), Ice::stringToIdentity("controller"));
controllerAdapter->activate();
@@ -40,11 +40,9 @@ main(int argc, char* argv[])
#ifdef ICE_STATIC_LIBS
Ice::registerIceSSL();
#endif
- Ice::CommunicatorPtr communicator;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//initData.properties->setProperty("Ice.ThreadPool.Server.Size", "1");
//initData.properties->setProperty("Ice.ThreadPool.Server.SizeMax", "1");
initData.properties->setProperty("Ice.Admin.Endpoints", "tcp");
@@ -52,9 +50,8 @@ main(int argc, char* argv[])
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.MessageSizeMax", "50000");
- initData.properties->setProperty("Ice.Default.Host", "127.0.0.1");
- communicator = Ice::initialize(argc, argv, initData);
- return run(argc, argv, communicator);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
+ return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
{
diff --git a/cpp/test/Ice/metrics/run.py b/cpp/test/Ice/metrics/run.py
deleted file mode 100755
index 7921ce9e9ff..00000000000
--- a/cpp/test/Ice/metrics/run.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/networkProxy/AllTests.cpp b/cpp/test/Ice/networkProxy/AllTests.cpp
index f1d2fa1fe71..49cd8789232 100644
--- a/cpp/test/Ice/networkProxy/AllTests.cpp
+++ b/cpp/test/Ice/networkProxy/AllTests.cpp
@@ -36,10 +36,16 @@ getIPConnectionInfo(const Ice::ConnectionInfoPtr& info)
void
allTests(const Ice::CommunicatorPtr& communicator)
{
- string sref = "test:default -p 12010";
+ string sref = "test:" + getTestEndpoint(communicator, 0);
Ice::ObjectPrxPtr obj = communicator->stringToProxy(sref);
test(obj);
+ int proxyPort = communicator->getProperties()->getPropertyAsInt("Ice.HTTPProxyPort");
+ if(proxyPort == 0)
+ {
+ proxyPort = communicator->getProperties()->getPropertyAsInt("Ice.SOCKSProxyPort");
+ }
+
TestIntfPrxPtr test = ICE_CHECKED_CAST(TestIntfPrx, obj);
test(test);
@@ -52,7 +58,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
cout << "testing connection information... " << flush;
{
Ice::IPConnectionInfoPtr info = getIPConnectionInfo(test->ice_getConnection()->getInfo());
- test(info->remotePort == 12030 || info->remotePort == 12031); // make sure we are connected to the proxy port.
+ test(info->remotePort == proxyPort); // make sure we are connected to the proxy port.
}
cout << "ok" << endl;
diff --git a/cpp/test/Ice/networkProxy/Client.cpp b/cpp/test/Ice/networkProxy/Client.cpp
index ca8c629df93..d8b93814226 100644
--- a/cpp/test/Ice/networkProxy/Client.cpp
+++ b/cpp/test/Ice/networkProxy/Client.cpp
@@ -17,8 +17,7 @@ using namespace std;
using namespace Test;
int
-run(int, char**, const Ice::CommunicatorPtr& communicator)
-{
+run(int, char**, const Ice::CommunicatorPtr& communicator){
void allTests(const Ice::CommunicatorPtr&);
allTests(communicator);
return EXIT_SUCCESS;
@@ -33,7 +32,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/networkProxy/Server.cpp b/cpp/test/Ice/networkProxy/Server.cpp
index 07dac51360a..02ca25d574b 100644
--- a/cpp/test/Ice/networkProxy/Server.cpp
+++ b/cpp/test/Ice/networkProxy/Server.cpp
@@ -34,7 +34,7 @@ public:
int
run(int, char**, const Ice::CommunicatorPtr& communicator)
{
- communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010:udp");
+ communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, 0) + ":udp");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::ObjectPtr object = ICE_MAKE_SHARED(TestI);
adapter->add(object, Ice::stringToIdentity("test"));
@@ -53,7 +53,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/networkProxy/run.py b/cpp/test/Ice/networkProxy/run.py
deleted file mode 100755
index 8a5a87c9f42..00000000000
--- a/cpp/test/Ice/networkProxy/run.py
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil, NetworkProxy
-
-sys.stdout.write("starting SOCKS proxy... ")
-sys.stdout.flush()
-socksProxy = NetworkProxy.SocksProxy(12030)
-print("ok")
-
-TestUtil.clientServerTest(additionalClientOptions="--Ice.SOCKSProxyHost=localhost --Ice.SOCKSProxyPort=12030")
-
-sys.stdout.write("terminating SOCKS proxy... ")
-sys.stdout.flush()
-socksProxy.terminate()
-print("ok")
-
-sys.stdout.write("starting HTTP proxy... ")
-sys.stdout.flush()
-httpProxy = NetworkProxy.HttpProxy(12031)
-print("ok")
-
-TestUtil.clientServerTest(additionalClientOptions="--Ice.HTTPProxyHost=localhost --Ice.HTTPProxyPort=12031")
-
-sys.stdout.write("terminating HTTP proxy... ")
-sys.stdout.flush()
-httpProxy.terminate()
-print("ok")
diff --git a/cpp/test/Ice/objects/Client.cpp b/cpp/test/Ice/objects/Client.cpp
index bceb4001e3a..5b93e93fddd 100644
--- a/cpp/test/Ice/objects/Client.cpp
+++ b/cpp/test/Ice/objects/Client.cpp
@@ -14,7 +14,7 @@
//
// Required to trigger initialization of Derived object factory.
//
-#include <Derived.h>
+#include <Derived.h>
//
// Required to trigger initialization of DerivedEx exception factory.
@@ -161,7 +161,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/objects", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/objects/Collocated.cpp b/cpp/test/Ice/objects/Collocated.cpp
index 6443ed13252..e0df2f04303 100644
--- a/cpp/test/Ice/objects/Collocated.cpp
+++ b/cpp/test/Ice/objects/Collocated.cpp
@@ -153,7 +153,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/objects/Server.cpp b/cpp/test/Ice/objects/Server.cpp
index c63b2d7c415..8bffdbfdc00 100644
--- a/cpp/test/Ice/objects/Server.cpp
+++ b/cpp/test/Ice/objects/Server.cpp
@@ -87,7 +87,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/objects/run.py b/cpp/test/Ice/objects/run.py
deleted file mode 100755
index bd13835d1c7..00000000000
--- a/cpp/test/Ice/objects/run.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.")
-
-TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.",
- additionalClientOptions="--Ice.Default.SlicedFormat",
- additionalServerOptions="--Ice.Default.SlicedFormat")
-
-TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.",
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/operations/Client.cpp b/cpp/test/Ice/operations/Client.cpp
index 65d65d35701..a3d6e76cb4b 100644
--- a/cpp/test/Ice/operations/Client.cpp
+++ b/cpp/test/Ice/operations/Client.cpp
@@ -63,8 +63,7 @@ main(int argc, char* argv[])
// In this test, we need at least two threads in the
// client side thread pool for nested AMI.
//
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.ThreadPool.Client.Size", "2");
initData.properties->setProperty("Ice.ThreadPool.Client.SizeWarn", "0");
initData.properties->setProperty("Ice.BatchAutoFlushSize", "100");
diff --git a/cpp/test/Ice/operations/Collocated.cpp b/cpp/test/Ice/operations/Collocated.cpp
index cfce947446d..3cff4ccfb74 100644
--- a/cpp/test/Ice/operations/Collocated.cpp
+++ b/cpp/test/Ice/operations/Collocated.cpp
@@ -41,8 +41,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.BatchAutoFlushSize", "100");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/operations/Server.cpp b/cpp/test/Ice/operations/Server.cpp
index 80f89467fe7..e7082f75486 100644
--- a/cpp/test/Ice/operations/Server.cpp
+++ b/cpp/test/Ice/operations/Server.cpp
@@ -37,8 +37,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Its possible to have batch oneway requests dispatched after
// the adapter is deactivated due to thread scheduling so we
diff --git a/cpp/test/Ice/operations/ServerAMD.cpp b/cpp/test/Ice/operations/ServerAMD.cpp
index f291f11a5a4..3b77a048c19 100644
--- a/cpp/test/Ice/operations/ServerAMD.cpp
+++ b/cpp/test/Ice/operations/ServerAMD.cpp
@@ -37,8 +37,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// Its possible to have batch oneway requests dispatched after
// the adapter is deactivated due to thread scheduling so we
diff --git a/cpp/test/Ice/operations/TwowaysAMI.cpp b/cpp/test/Ice/operations/TwowaysAMI.cpp
index 1e96c80cae4..4731ece4dce 100644
--- a/cpp/test/Ice/operations/TwowaysAMI.cpp
+++ b/cpp/test/Ice/operations/TwowaysAMI.cpp
@@ -177,7 +177,7 @@ public:
//
// We can't do the callbacks below in connection serialization mode.
//
- if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize"))
+ if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize") == 0)
{
r->opVoid();
c1->opVoid();
@@ -204,7 +204,7 @@ public:
//
// We can't do the callbacks below in connection serialization mode.
//
- if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize"))
+ if(_communicator->getProperties()->getPropertyAsInt("Ice.ThreadPool.Client.Serialize") == 0)
{
so.p->opVoid();
}
diff --git a/cpp/test/Ice/operations/run.py b/cpp/test/Ice/operations/run.py
deleted file mode 100755
index e4c188e8960..00000000000
--- a/cpp/test/Ice/operations/run.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(additionalClientOptions = "--Ice.Warn.AMICallback=0")
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- additionalClientOptions = "--Ice.Warn.AMICallback=0",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/optional/Client.cpp b/cpp/test/Ice/optional/Client.cpp
index 4983ad69a88..7dc9b1c3ae7 100644
--- a/cpp/test/Ice/optional/Client.cpp
+++ b/cpp/test/Ice/optional/Client.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/optional", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/optional/Server.cpp b/cpp/test/Ice/optional/Server.cpp
index aacddd084ed..3d75a924ca6 100644
--- a/cpp/test/Ice/optional/Server.cpp
+++ b/cpp/test/Ice/optional/Server.cpp
@@ -40,7 +40,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/optional/ServerAMD.cpp b/cpp/test/Ice/optional/ServerAMD.cpp
index c47b19721b5..ddbc1a2eb28 100644
--- a/cpp/test/Ice/optional/ServerAMD.cpp
+++ b/cpp/test/Ice/optional/ServerAMD.cpp
@@ -39,7 +39,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cpp/test/Ice/optional/run.py b/cpp/test/Ice/optional/run.py
deleted file mode 100755
index a3ccc80fc2e..00000000000
--- a/cpp/test/Ice/optional/run.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "compact", message = "Running test with compact (default) format.")
-TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.",
- additionalClientOptions="--Ice.Default.SlicedFormat",
- additionalServerOptions="--Ice.Default.SlicedFormat")
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/plugin/Client.cpp b/cpp/test/Ice/plugin/Client.cpp
index 85a060f89f7..2a677456bbe 100644
--- a/cpp/test/Ice/plugin/Client.cpp
+++ b/cpp/test/Ice/plugin/Client.cpp
@@ -87,6 +87,7 @@ main(int argc, char* argv[])
if(argc < 2)
{
cerr << "usage: " << argv[0] << " <plugindir>";
+ return 1;
}
//
@@ -105,7 +106,8 @@ main(int argc, char* argv[])
cout << "testing static plugin factory... " << flush;
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
MyPluginPtr plugin = ICE_DYNAMIC_CAST(MyPlugin, communicator->getPluginManager()->getPlugin("Static1"));
test(plugin && plugin->isInitialized());
try
@@ -124,8 +126,7 @@ main(int argc, char* argv[])
}
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Static2", "1");
communicator = Ice::initialize(argc, argv, initData);
MyPluginPtr plugin = ICE_DYNAMIC_CAST(MyPlugin, communicator->getPluginManager()->getPlugin("Static1"));
@@ -144,8 +145,7 @@ main(int argc, char* argv[])
cout << "testing a simple plug-in... " << flush;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test", pluginDir + "TestPlugin:createPlugin");
communicator = Ice::initialize(argc, argv, initData);
communicator->destroy();
@@ -172,8 +172,7 @@ main(int argc, char* argv[])
os << 'a' << (patchVersion - 50);
}
os << ":createPlugin";
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test", os.str());
communicator = Ice::initialize(argc, argv, initData);
communicator->destroy();
@@ -185,8 +184,7 @@ main(int argc, char* argv[])
}
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test", pluginDir + "TestPlugin,10:createPlugin");
communicator = Ice::initialize(argc, argv, initData);
test(false);
@@ -196,8 +194,7 @@ main(int argc, char* argv[])
}
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test", "TestPlugin,1.0.0:createPlugin");
communicator = Ice::initialize(argc, argv, initData);
test(false);
@@ -207,8 +204,7 @@ main(int argc, char* argv[])
}
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test",
pluginDir + "TestPlugin:createPluginWithArgs 'C:\\Program Files\\' --DatabasePath "
"'C:\\Program Files\\Application\\db'" );
@@ -226,8 +222,7 @@ main(int argc, char* argv[])
communicator = 0;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.Test", pluginDir + "TestPlugin:createPluginInitializeFail");
communicator = Ice::initialize(argc, argv, initData);
test(false);
@@ -242,8 +237,7 @@ main(int argc, char* argv[])
cout << "testing plug-in load order... " << flush;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.PluginOne", pluginDir + "TestPlugin:createPluginOne");
initData.properties->setProperty("Ice.Plugin.PluginTwo", pluginDir + "TestPlugin:createPluginTwo");
initData.properties->setProperty("Ice.Plugin.PluginThree", pluginDir + "TestPlugin:createPluginThree");
@@ -261,8 +255,7 @@ main(int argc, char* argv[])
cout << "testing plug-in manager... " << flush;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.PluginOne", pluginDir + "TestPlugin:createPluginOne");
initData.properties->setProperty("Ice.Plugin.PluginTwo", pluginDir + "TestPlugin:createPluginTwo");
initData.properties->setProperty("Ice.Plugin.PluginThree", pluginDir + "TestPlugin:createPluginThree");
@@ -298,8 +291,7 @@ main(int argc, char* argv[])
communicator = 0;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Plugin.PluginOneFail", pluginDir + "TestPlugin:createPluginOneFail");
initData.properties->setProperty("Ice.Plugin.PluginTwoFail", pluginDir + "TestPlugin:createPluginTwoFail");
initData.properties->setProperty("Ice.Plugin.PluginThreeFail", pluginDir + "TestPlugin:createPluginThreeFail");
diff --git a/cpp/test/Ice/plugin/run.py b/cpp/test/Ice/plugin/run.py
deleted file mode 100755
index 604c9cec295..00000000000
--- a/cpp/test/Ice/plugin/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.addAdditionalBinDirectories([os.path.join(os.getcwd(), TestUtil.getTestDirectory("testplugin"))])
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-TestUtil.simpleTest(client, options=TestUtil.getTestDirectory("testplugin"))
diff --git a/cpp/test/Ice/plugin/test.py b/cpp/test/Ice/plugin/test.py
new file mode 100644
index 00000000000..407e36f05c8
--- /dev/null
+++ b/cpp/test/Ice/plugin/test.py
@@ -0,0 +1,12 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+TestSuite(__file__,
+ [ClientTestCase(client=SimpleClient(args=lambda process, current: [current.getBuildDir("testplugin")]))],
+ libDirs=["testplugin"])
diff --git a/cpp/test/Ice/properties/run.py b/cpp/test/Ice/properties/run.py
deleted file mode 100755
index c31a553ab06..00000000000
--- a/cpp/test/Ice/properties/run.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys, locale
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-if TestUtil.isAIX():
- encoding = locale.getdefaultlocale()[1]
- if encoding != "UTF-8":
- print("Please set LC_ALL to xx_xx.UTF-8, for example FR_FR.UTF-8")
- print("Skipping test")
- sys.exit(0)
-
-#
-# Write config
-#
-if sys.version_info[0] == 2:
- configPath = "./config/\xe4\xb8\xad\xe5\x9b\xbd_client.config"
- decodedPath = configPath.decode("utf-8")
-else:
- configPath = "./config/\u4e2d\u56fd_client.config"
- decodedPath = configPath # No need to decode with Python3, strings are already Unicode
-
-
-TestUtil.createFile(decodedPath,
- ["# Automatically generated by Ice test driver.",
- "Ice.Trace.Protocol=1",
- "Ice.Trace.Network=1",
- "Ice.ProgramName=PropertiesClient",
- "Config.Path=" + configPath],
- "utf-8")
-
-TestUtil.simpleTest(client)
-
-if os.path.exists(decodedPath):
- os.remove(decodedPath)
diff --git a/cpp/test/Ice/proxy/AllTests.cpp b/cpp/test/Ice/proxy/AllTests.cpp
index 03f6d87b367..25ce9ac8ffb 100644
--- a/cpp/test/Ice/proxy/AllTests.cpp
+++ b/cpp/test/Ice/proxy/AllTests.cpp
@@ -1260,10 +1260,6 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
const bool tcp = communicator->getProperties()->getProperty("Ice.Default.Protocol") == "tcp";
- if(tcp)
- {
- p1->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
- }
// Two legal TCP endpoints expressed as opaque endpoints
p1 = communicator->stringToProxy("test -e 1.0:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -e 1.0 -t 1 -v CTEyNy4wLjAuMusuAAAQJwAAAA==");
@@ -1288,23 +1284,6 @@ allTests(const Ice::CommunicatorPtr& communicator)
}
//
- // Try to invoke on the endpoint to verify that we get a
- // NoEndpointException (or ConnectionRefusedException when
- // running with SSL).
- //
- if(ssl)
- {
- try
- {
- p1->ice_encodingVersion(Ice::Encoding_1_0)->ice_ping();
- test(false);
- }
- catch(const Ice::ConnectFailedException&)
- {
- }
- }
-
- //
// Test that the proxy with an SSL endpoint and a nonsense
// endpoint (which the server doesn't understand either) can be
// sent over the wire and returned by the server without losing
diff --git a/cpp/test/Ice/proxy/Client.cpp b/cpp/test/Ice/proxy/Client.cpp
index dfd2ae3820f..9ba427230dd 100644
--- a/cpp/test/Ice/proxy/Client.cpp
+++ b/cpp/test/Ice/proxy/Client.cpp
@@ -38,7 +38,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/proxy", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/proxy/Collocated.cpp b/cpp/test/Ice/proxy/Collocated.cpp
index 2c7e91d3106..4979865f18b 100644
--- a/cpp/test/Ice/proxy/Collocated.cpp
+++ b/cpp/test/Ice/proxy/Collocated.cpp
@@ -38,8 +38,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/proxy/Server.cpp b/cpp/test/Ice/proxy/Server.cpp
index ac9b496ae68..793fb95f7a6 100644
--- a/cpp/test/Ice/proxy/Server.cpp
+++ b/cpp/test/Ice/proxy/Server.cpp
@@ -36,10 +36,8 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
-
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/proxy/ServerAMD.cpp b/cpp/test/Ice/proxy/ServerAMD.cpp
index db603a4570a..ee5d4556be9 100644
--- a/cpp/test/Ice/proxy/ServerAMD.cpp
+++ b/cpp/test/Ice/proxy/ServerAMD.cpp
@@ -36,8 +36,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
diff --git a/cpp/test/Ice/proxy/run.py b/cpp/test/Ice/proxy/run.py
deleted file mode 100755
index 38e60970744..00000000000
--- a/cpp/test/Ice/proxy/run.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.queueCollocatedTest(additionalOptions = "--Ice.ToStringMode=Compat")
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/retry/Client.cpp b/cpp/test/Ice/retry/Client.cpp
index 176071a2f71..082d50c3290 100644
--- a/cpp/test/Ice/retry/Client.cpp
+++ b/cpp/test/Ice/retry/Client.cpp
@@ -36,8 +36,7 @@ main(int argc, char* argv[])
{
initCounts();
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.observer = getObserver();
//
// This test kills connections, so we don't want warnings.
diff --git a/cpp/test/Ice/retry/Collocated.cpp b/cpp/test/Ice/retry/Collocated.cpp
index 1c83cb7c996..8802c73bf0f 100644
--- a/cpp/test/Ice/retry/Collocated.cpp
+++ b/cpp/test/Ice/retry/Collocated.cpp
@@ -46,8 +46,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.observer = getObserver();
initData.properties->setProperty("Ice.RetryIntervals", "0 1 10 1");
diff --git a/cpp/test/Ice/retry/Server.cpp b/cpp/test/Ice/retry/Server.cpp
index a0e37557fbf..ae448e377a7 100644
--- a/cpp/test/Ice/retry/Server.cpp
+++ b/cpp/test/Ice/retry/Server.cpp
@@ -36,8 +36,7 @@ main(int argc, char* argv[])
int status = EXIT_FAILURE;
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Dispatch", "0");
initData.properties->setProperty("Ice.PrintStackTraces", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
diff --git a/cpp/test/Ice/retry/run.py b/cpp/test/Ice/retry/run.py
deleted file mode 100755
index 2d96b653cfa..00000000000
--- a/cpp/test/Ice/retry/run.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/servantLocator/Client.cpp b/cpp/test/Ice/servantLocator/Client.cpp
index 2f36a63a9d0..a3805686f23 100644
--- a/cpp/test/Ice/servantLocator/Client.cpp
+++ b/cpp/test/Ice/servantLocator/Client.cpp
@@ -37,8 +37,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/servantLocator", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
diff --git a/cpp/test/Ice/servantLocator/Collocated.cpp b/cpp/test/Ice/servantLocator/Collocated.cpp
index aeb02c0e36d..abc9c70b24d 100644
--- a/cpp/test/Ice/servantLocator/Collocated.cpp
+++ b/cpp/test/Ice/servantLocator/Collocated.cpp
@@ -113,8 +113,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/servantLocator/Server.cpp b/cpp/test/Ice/servantLocator/Server.cpp
index c5c78e23881..5215bb762c0 100644
--- a/cpp/test/Ice/servantLocator/Server.cpp
+++ b/cpp/test/Ice/servantLocator/Server.cpp
@@ -113,8 +113,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/servantLocator/ServerAMD.cpp b/cpp/test/Ice/servantLocator/ServerAMD.cpp
index 740d6072b33..d2b3b82568d 100644
--- a/cpp/test/Ice/servantLocator/ServerAMD.cpp
+++ b/cpp/test/Ice/servantLocator/ServerAMD.cpp
@@ -112,8 +112,7 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
diff --git a/cpp/test/Ice/servantLocator/run.py b/cpp/test/Ice/servantLocator/run.py
deleted file mode 100755
index 7921ce9e9ff..00000000000
--- a/cpp/test/Ice/servantLocator/run.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.queueClientServerTest(configName = "amd", localOnly = True, message = "Running test with AMD server.",
- server = TestUtil.getTestExecutable("serveramd"))
-TestUtil.queueCollocatedTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/services/AllTests.cpp b/cpp/test/Ice/services/AllTests.cpp
index 7720dfaab94..3696729a06b 100644
--- a/cpp/test/Ice/services/AllTests.cpp
+++ b/cpp/test/Ice/services/AllTests.cpp
@@ -143,7 +143,7 @@ allTests(const Ice::CommunicatorPtr& communicator)
{
cout << "Testing IceGrid stub... " << flush;
- Ice::ObjectPrxPtr base = communicator->stringToProxy("test:default -p 12010");
+ Ice::ObjectPrxPtr base = communicator->stringToProxy("test:" + getTestEndpoint(communicator, 0));
IceGrid::RegistryPrxPtr registry = ICE_UNCHECKED_CAST(IceGrid::RegistryPrx, base);
IceGrid::AdminSessionPrxPtr session;
IceGrid::AdminPrxPtr admin;
diff --git a/cpp/test/Ice/services/Client.cpp b/cpp/test/Ice/services/Client.cpp
index c8268911231..b54125cf926 100644
--- a/cpp/test/Ice/services/Client.cpp
+++ b/cpp/test/Ice/services/Client.cpp
@@ -33,8 +33,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.NullHandleAbort", "0");
Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator(), initData);
diff --git a/cpp/test/Ice/services/run.py b/cpp/test/Ice/services/run.py
deleted file mode 100755
index 1a758d84c41..00000000000
--- a/cpp/test/Ice/services/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-TestUtil.simpleTest(client)
diff --git a/cpp/test/Ice/slicing/exceptions/Client.cpp b/cpp/test/Ice/slicing/exceptions/Client.cpp
index 76bbf7f7f8f..270e4e3e6b2 100644
--- a/cpp/test/Ice/slicing/exceptions/Client.cpp
+++ b/cpp/test/Ice/slicing/exceptions/Client.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
RemoteConfig rc("Ice/slicing/exceptions", argc, argv, ich.communicator());
int status = run(argc, argv, ich.communicator());
rc.finished(status);
diff --git a/cpp/test/Ice/slicing/exceptions/Server.cpp b/cpp/test/Ice/slicing/exceptions/Server.cpp
index 909b87b7fc0..c69fcfdb43e 100644
--- a/cpp/test/Ice/slicing/exceptions/Server.cpp
+++ b/cpp/test/Ice/slicing/exceptions/Server.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp
index c5534dcc207..831bb423f9c 100644
--- a/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp
+++ b/cpp/test/Ice/slicing/exceptions/ServerAMD.cpp
@@ -37,7 +37,8 @@ main(int argc, char* argv[])
#endif
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/slicing/exceptions/run.py b/cpp/test/Ice/slicing/exceptions/run.py
deleted file mode 100755
index cbec6614fa6..00000000000
--- a/cpp/test/Ice/slicing/exceptions/run.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../..", "../../../../../.."]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.")
-
-TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.",
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True,
- message = "Running test with sliced format and AMD server.", server=TestUtil.getTestExecutable("serveramd"))
-
-TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True,
- message = "Running test with 1.0 encoding and AMD server.",
- server=TestUtil.getTestExecutable("serveramd"),
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/slicing/objects/Client.cpp b/cpp/test/Ice/slicing/objects/Client.cpp
index d4c9018909b..0b0b9cce780 100644
--- a/cpp/test/Ice/slicing/objects/Client.cpp
+++ b/cpp/test/Ice/slicing/objects/Client.cpp
@@ -37,8 +37,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// For this test, we enable object collection.
//
diff --git a/cpp/test/Ice/slicing/objects/Server.cpp b/cpp/test/Ice/slicing/objects/Server.cpp
index 093997a59ef..50685cf1384 100644
--- a/cpp/test/Ice/slicing/objects/Server.cpp
+++ b/cpp/test/Ice/slicing/objects/Server.cpp
@@ -39,7 +39,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/slicing/objects/ServerAMD.cpp b/cpp/test/Ice/slicing/objects/ServerAMD.cpp
index 28e3b390606..92c679ec31b 100644
--- a/cpp/test/Ice/slicing/objects/ServerAMD.cpp
+++ b/cpp/test/Ice/slicing/objects/ServerAMD.cpp
@@ -39,7 +39,8 @@ main(int argc, char* argv[])
try
{
- Ice::CommunicatorHolder ich = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ Ice::CommunicatorHolder ich = Ice::initialize(argc, argv, initData);
return run(argc, argv, ich.communicator());
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/slicing/objects/run.py b/cpp/test/Ice/slicing/objects/run.py
deleted file mode 100755
index 6fe120a056c..00000000000
--- a/cpp/test/Ice/slicing/objects/run.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../..", "../../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(configName = "sliced", message = "Running test with sliced format.")
-
-TestUtil.queueClientServerTest(configName = "1.0", message = "Running test with 1.0 encoding.",
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-
-TestUtil.queueClientServerTest(configName = "slicedAMD", localOnly = True,
- message = "Running test with sliced format and AMD server.", server=TestUtil.getTestExecutable("serveramd"))
-
-TestUtil.queueClientServerTest(configName = "1.0AMD", localOnly = True,
- message = "Running test with 1.0 encoding and AMD server.",
- server=TestUtil.getTestExecutable("serveramd"),
- additionalClientOptions="--Ice.Default.EncodingVersion=1.0",
- additionalServerOptions="--Ice.Default.EncodingVersion=1.0")
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/stream/Client.cpp b/cpp/test/Ice/stream/Client.cpp
index eb3fb613280..c7455d7c012 100644
--- a/cpp/test/Ice/stream/Client.cpp
+++ b/cpp/test/Ice/stream/Client.cpp
@@ -1306,7 +1306,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/stream/run.py b/cpp/test/Ice/stream/run.py
deleted file mode 100755
index 06bc2ab56a0..00000000000
--- a/cpp/test/Ice/stream/run.py
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-print("Running test with default encoding...")
-TestUtil.simpleTest(client)
-
-print("Running test with 1.0 encoding...")
-TestUtil.simpleTest(client, "--Ice.Default.EncodingVersion=1.0")
diff --git a/cpp/test/Ice/stringConverter/Client.cpp b/cpp/test/Ice/stringConverter/Client.cpp
index f0d7f4df1cd..f4e0101897e 100644
--- a/cpp/test/Ice/stringConverter/Client.cpp
+++ b/cpp/test/Ice/stringConverter/Client.cpp
@@ -27,8 +27,7 @@ main(int argc, char* argv[])
Ice::registerIceStringConverter();
#endif
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
string narrowEncoding;
string wideEncoding;
diff --git a/cpp/test/Ice/stringConverter/Server.cpp b/cpp/test/Ice/stringConverter/Server.cpp
index e82f6caf0ab..63248a612ce 100644
--- a/cpp/test/Ice/stringConverter/Server.cpp
+++ b/cpp/test/Ice/stringConverter/Server.cpp
@@ -65,8 +65,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
diff --git a/cpp/test/Ice/stringConverter/run.py b/cpp/test/Ice/stringConverter/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/stringConverter/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/threadPoolPriority/Client.cpp b/cpp/test/Ice/threadPoolPriority/Client.cpp
index b3797d00feb..5ca601e09d8 100644
--- a/cpp/test/Ice/threadPoolPriority/Client.cpp
+++ b/cpp/test/Ice/threadPoolPriority/Client.cpp
@@ -36,7 +36,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/threadPoolPriority/Server.cpp b/cpp/test/Ice/threadPoolPriority/Server.cpp
index b1957badf2f..1eed7ce28c4 100644
--- a/cpp/test/Ice/threadPoolPriority/Server.cpp
+++ b/cpp/test/Ice/threadPoolPriority/Server.cpp
@@ -67,7 +67,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
index 3d67cc16c3f..559752de5f9 100644
--- a/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
+++ b/cpp/test/Ice/threadPoolPriority/ServerCustomThreadPool.cpp
@@ -71,7 +71,8 @@ main(int argc, char* argv[])
try
{
- communicator = Ice::initialize(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
+ communicator = Ice::initialize(argc, argv, initData);
status = run(argc, argv, communicator);
}
catch(const Ice::Exception& ex)
diff --git a/cpp/test/Ice/threadPoolPriority/run.py b/cpp/test/Ice/threadPoolPriority/run.py
deleted file mode 100755
index bc73b82596f..00000000000
--- a/cpp/test/Ice/threadPoolPriority/run.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest(message = "Running test with default server thread pool.")
-TestUtil.queueClientServerTest(configName = "custom", message = "Running test with custom server thread pool.",
- server = TestUtil.getTestExecutable("servercustom"))
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/threadPoolPriority/test.py b/cpp/test/Ice/threadPoolPriority/test.py
new file mode 100644
index 00000000000..350997731e9
--- /dev/null
+++ b/cpp/test/Ice/threadPoolPriority/test.py
@@ -0,0 +1,14 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+if not isinstance(platform, Darwin) and (isinstance(platform, Windows) or os.getuid() == 0):
+ TestSuite(__file__, [
+ ClientServerTestCase(),
+ ClientServerTestCase(name="client/custom server", server="servercustom")
+ ], options={ "mx" : [False] })
diff --git a/cpp/test/Ice/timeout/Client.cpp b/cpp/test/Ice/timeout/Client.cpp
index fa78aa30002..86325621840 100644
--- a/cpp/test/Ice/timeout/Client.cpp
+++ b/cpp/test/Ice/timeout/Client.cpp
@@ -34,8 +34,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
//
// For this test, we want to disable retries.
diff --git a/cpp/test/Ice/timeout/Server.cpp b/cpp/test/Ice/timeout/Server.cpp
index f355ce381fa..67294383853 100644
--- a/cpp/test/Ice/timeout/Server.cpp
+++ b/cpp/test/Ice/timeout/Server.cpp
@@ -38,8 +38,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
#if TARGET_OS_IPHONE != 0
//
diff --git a/cpp/test/Ice/timeout/run.py b/cpp/test/Ice/timeout/run.py
deleted file mode 100755
index eb60390efe1..00000000000
--- a/cpp/test/Ice/timeout/run.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-TestUtil.queueClientServerTest()
-TestUtil.runQueuedTests()
diff --git a/cpp/test/Ice/udp/AllTests.cpp b/cpp/test/Ice/udp/AllTests.cpp
index 5c63a380442..b9945f8d724 100644
--- a/cpp/test/Ice/udp/AllTests.cpp
+++ b/cpp/test/Ice/udp/AllTests.cpp
@@ -62,14 +62,14 @@ ICE_DEFINE_PTR(PingReplyIPtr, PingReplyI);
void
allTests(const CommunicatorPtr& communicator)
{
- communicator->getProperties()->setProperty("ReplyAdapter.Endpoints", "udp -p 12030");
+ communicator->getProperties()->setProperty("ReplyAdapter.Endpoints", "udp");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ReplyAdapter");
PingReplyIPtr replyI = ICE_MAKE_SHARED(PingReplyI);
PingReplyPrxPtr reply = ICE_UNCHECKED_CAST(PingReplyPrx, adapter->addWithUUID(replyI))->ice_datagram();
adapter->activate();
cout << "testing udp... " << flush;
- ObjectPrxPtr base = communicator->stringToProxy("test -d:udp -p 12010");
+ ObjectPrxPtr base = communicator->stringToProxy("test -d:" + getTestEndpoint(communicator, 0, "udp"));
TestIntfPrxPtr obj = ICE_UNCHECKED_CAST(TestIntfPrx, base);
int nRetry = 5;
@@ -87,7 +87,7 @@ allTests(const CommunicatorPtr& communicator)
}
// If the 3 datagrams were not received within the 2 seconds, we try again to
- // receive 3 new datagrams using a new object. We give up after 5 retries.
+ // receive 3 new datagrams using a new object. We give up after 5 retries.
replyI = ICE_MAKE_SHARED(PingReplyI);
reply = ICE_UNCHECKED_CAST(PingReplyPrx, adapter->addWithUUID(replyI))->ice_datagram();
}
@@ -175,7 +175,7 @@ allTests(const CommunicatorPtr& communicator)
}
#endif
- cout << "testing udp bi-dir connection... " << flush;
+ cout << "testing udp bi-dir connection... " << flush;
obj->ice_getConnection()->setAdapter(adapter);
objMcast->ice_getConnection()->setAdapter(adapter);
nRetry = 5;
@@ -192,7 +192,7 @@ allTests(const CommunicatorPtr& communicator)
}
// If the 3 datagrams were not received within the 2 seconds, we try again to
- // receive 3 new datagrams using a new object. We give up after 5 retries.
+ // receive 3 new datagrams using a new object. We give up after 5 retries.
replyI = ICE_MAKE_SHARED(PingReplyI);
reply = ICE_UNCHECKED_CAST(PingReplyPrx, adapter->addWithUUID(replyI))->ice_datagram();
}
@@ -204,8 +204,8 @@ allTests(const CommunicatorPtr& communicator)
// platform (it works for OS X Leopard but not Snow Leopard, doesn't work on SLES,
// Windows...). For Windows, see UdpTransceiver constructor for the details. So
// we don't run this test.
- //
-// cout << "testing udp bi-dir connection... " << flush;
+ //
+// cout << "testing udp bi-dir connection... " << flush;
// nRetry = 5;
// while(nRetry-- > 0)
// {
@@ -215,7 +215,7 @@ allTests(const CommunicatorPtr& communicator)
// if(ret)
// {
// break; // Success
-// }
+// }
// replyI = new PingReplyI;
// reply = PingReplyPrx::uncheckedCast(adapter->addWithUUID(replyI))->ice_datagram();
// }
diff --git a/cpp/test/Ice/udp/Client.cpp b/cpp/test/Ice/udp/Client.cpp
index b52a9cbbccd..596f7adca6d 100644
--- a/cpp/test/Ice/udp/Client.cpp
+++ b/cpp/test/Ice/udp/Client.cpp
@@ -26,7 +26,7 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
for(int i = 0; i < num; i++)
{
ostringstream os;
- os << "control:tcp -p " << (12010 + i);
+ os << "control:" << getTestEndpoint(communicator, i, "tcp");
ICE_UNCHECKED_CAST(TestIntfPrx, communicator->stringToProxy(os.str()))->shutdown();
}
return EXIT_SUCCESS;
@@ -41,8 +41,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.UDP.RcvSize", "16384");
initData.properties->setProperty("Ice.UDP.SndSize", "16384");
diff --git a/cpp/test/Ice/udp/Server.cpp b/cpp/test/Ice/udp/Server.cpp
index 9574f504ed7..0203728919a 100644
--- a/cpp/test/Ice/udp/Server.cpp
+++ b/cpp/test/Ice/udp/Server.cpp
@@ -22,16 +22,14 @@ run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator)
int num = argc == 2 ? atoi(argv[1]) : 0;
- ostringstream os;
- os << "tcp -p " << (12010 + num);
- properties->setProperty("ControlAdapter.Endpoints", os.str());
+ properties->setProperty("ControlAdapter.Endpoints", getTestEndpoint(communicator, num, "tcp"));
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("ControlAdapter");
adapter->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("control"));
adapter->activate();
if(num == 0)
{
- properties->setProperty("TestAdapter.Endpoints", "udp -p 12010");
+ properties->setProperty("TestAdapter.Endpoints", getTestEndpoint(communicator, num, "udp"));
Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("TestAdapter");
adapter2->add(ICE_MAKE_SHARED(TestIntfI), Ice::stringToIdentity("test"));
adapter2->activate();
@@ -70,8 +68,7 @@ main(int argc, char* argv[])
try
{
- Ice::InitializationData initData;
- initData.properties = Ice::createProperties(argc, argv);
+ Ice::InitializationData initData = getTestInitData(argc, argv);
initData.properties->setProperty("Ice.Warn.Connections", "0");
initData.properties->setProperty("Ice.UDP.SndSize", "16384");
initData.properties->setProperty("Ice.UDP.RcvSize", "16384");
diff --git a/cpp/test/Ice/udp/run.py b/cpp/test/Ice/udp/run.py
deleted file mode 100755
index b4bb1cde735..00000000000
--- a/cpp/test/Ice/udp/run.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-# **********************************************************************
-#
-# Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved.
-#
-# This copy of Ice is licensed to you under the terms described in the
-# ICE_LICENSE file included in this distribution.
-#
-# **********************************************************************
-
-import os, sys
-
-path = [ ".", "..", "../..", "../../..", "../../../..", "../../../../.." ]
-head = os.path.dirname(sys.argv[0])
-if len(head) > 0:
- path = [os.path.join(head, p) for p in path]
-path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
-if len(path) == 0:
- raise RuntimeError("can't find toplevel directory!")
-sys.path.append(os.path.join(path[0], "scripts"))
-import TestUtil
-
-#
-# COMPILERFIX: The server fails to start on Solaris when IPv6 is
-# enabled. It's apparently not possible to use multicast on a
-# linked-local configured link.
-#
-if TestUtil.isSolaris() and TestUtil.ipv6:
- print("test not supported on Solaris with IPv6")
- sys.exit(0)
-
-server = os.path.join(os.getcwd(), TestUtil.getTestExecutable("server"))
-client = os.path.join(os.getcwd(), TestUtil.getTestExecutable("client"))
-
-num = 5
-
-serverProc = []
-for i in range(0, num):
- sys.stdout.write("starting server #%d... " % (i + 1))
- sys.stdout.flush()
- serverProc.append(TestUtil.startServer(server, "%d" % i , adapter="McastTestAdapter"))
- print("ok")
-
-sys.stdout.write("starting client... ")
-sys.stdout.flush()
-clientProc = TestUtil.startClient(client, "%d" % num, startReader = False)
-print("ok")
-clientProc.startReader()
-
-clientProc.waitTestSuccess()
-for p in serverProc:
- p.waitTestSuccess()