summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/test/Glacier2/application/Client.py16
-rw-r--r--python/test/Glacier2/application/Server.py4
-rwxr-xr-xpython/test/Ice/acm/Server.py2
-rwxr-xr-xpython/test/Ice/ami/Collocated.py4
-rwxr-xr-xpython/test/Ice/blobject/Client.py4
-rwxr-xr-xpython/test/Ice/blobject/Server.py2
-rwxr-xr-xpython/test/Ice/exceptions/ServerAMD.py6
-rwxr-xr-xpython/test/Ice/facets/Client.py3
-rwxr-xr-xpython/test/Ice/facets/Server.py2
-rwxr-xr-xpython/test/Ice/faultTolerance/Client.py2
-rwxr-xr-xpython/test/Ice/faultTolerance/Server.py2
-rw-r--r--python/test/Ice/info/AllTests.py4
-rwxr-xr-xpython/test/Ice/location/Server.py19
-rw-r--r--python/test/Ice/objects/AllTests.py2
-rw-r--r--python/test/Ice/operations/AllTests.py15
-rw-r--r--python/test/Ice/operations/Oneways.py4
-rw-r--r--python/test/Ice/operations/OnewaysAMI.py4
-rw-r--r--python/test/Ice/operations/OnewaysFuture.py4
-rwxr-xr-xpython/test/Ice/operations/Server.py1
-rw-r--r--python/test/Ice/operations/Twoways.py5
-rw-r--r--python/test/Ice/operations/TwowaysAMI.py5
-rw-r--r--python/test/Ice/operations/TwowaysFuture.py5
-rw-r--r--python/test/Ice/proxy/AllTests.py4
-rwxr-xr-xpython/test/Ice/proxy/Client.py2
-rwxr-xr-xpython/test/Ice/proxy/Server.py40
-rwxr-xr-xpython/test/Ice/proxy/ServerAMD.py43
-rwxr-xr-xpython/test/Ice/scope/Server.py2
-rw-r--r--python/test/Ice/servantLocator/AllTests.py2
-rw-r--r--python/test/TestHelper.py2
29 files changed, 97 insertions, 113 deletions
diff --git a/python/test/Glacier2/application/Client.py b/python/test/Glacier2/application/Client.py
index dac74edf696..aa8ab6177b3 100644
--- a/python/test/Glacier2/application/Client.py
+++ b/python/test/Glacier2/application/Client.py
@@ -43,11 +43,12 @@ class CallbackReceiverI(Test.CallbackReceiver):
class Application(Glacier2.Application):
- def __init__(self):
+ def __init__(self, helper):
Glacier2.Application.__init__(self)
self._restart = 0
self._destroyed = False
self._receiver = CallbackReceiverI()
+ self._helper = helper
def createSession(self):
return Glacier2.SessionPrx.uncheckedCast(self.router().createSession("userid", "abc123"))
@@ -62,7 +63,8 @@ class Application(Glacier2.Application):
sys.stdout.write("testing Glacier2::Application restart... ")
sys.stdout.flush()
- base = self.communicator().stringToProxy("callback:default -p 12010");
+ base = self.communicator().stringToProxy("callback:{0}".format(
+ self._helper.getTestEndpoint(properties=self.communicator().getProperties())));
callback = Test.CallbackPrx.uncheckedCast(base)
self._restart += 1
if self._restart < 5:
@@ -87,10 +89,11 @@ class Client(TestHelper):
def run(self, args):
initData = Ice.InitializationData()
- initData.properties = self.createTestProperties(sys.argv)
- initData.properties.setProperty("Ice.Default.Router", "Glacier2/router:default -p 12060")
+ initData.properties = self.createTestProperties(args)
+ initData.properties.setProperty("Ice.Default.Router", "Glacier2/router:{0}".format(
+ self.getTestEndpoint(properties=initData.properties, num=50)))
- app = Application()
+ app = Application(self)
status = app.main(sys.argv, initData=initData)
test(status == 0)
test(app._restart == 5)
@@ -100,7 +103,8 @@ class Client(TestHelper):
with self.initialize(initData=initData) as communicator:
sys.stdout.write("testing stringToProxy for process object... ")
sys.stdout.flush()
- processBase = communicator.stringToProxy("Glacier2/admin -f Process:default -p 12061")
+ processBase = communicator.stringToProxy("Glacier2/admin -f Process:{0}".format(
+ self.getTestEndpoint(properties=initData.properties, num=51)))
print("ok")
sys.stdout.write("testing checked cast for admin object... ")
diff --git a/python/test/Glacier2/application/Server.py b/python/test/Glacier2/application/Server.py
index 7b32c1689b9..25c69c16ff7 100644
--- a/python/test/Glacier2/application/Server.py
+++ b/python/test/Glacier2/application/Server.py
@@ -27,10 +27,10 @@ class Server(TestHelper):
def run(self, args):
with self.initialize(args=args) as communicator:
- communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", "default -p 12011")
+ communicator.getProperties().setProperty("DeactivatedAdapter.Endpoints", self.getTestEndpoint(num=1))
communicator.createObjectAdapter("DeactivatedAdapter")
- communicator.getProperties().setProperty("CallbackAdapter.Endpoints", "default -p 12010")
+ communicator.getProperties().setProperty("CallbackAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("CallbackAdapter")
adapter.add(CallbackI(), Ice.stringToIdentity("callback"))
adapter.activate()
diff --git a/python/test/Ice/acm/Server.py b/python/test/Ice/acm/Server.py
index fe276128ffc..1ad6aefb346 100755
--- a/python/test/Ice/acm/Server.py
+++ b/python/test/Ice/acm/Server.py
@@ -22,7 +22,7 @@ class Server(TestHelper):
properties.setProperty("Ice.Warn.Connections", "0")
properties.setProperty("Ice.ACM.Timeout", "1")
with self.initialize(properties=properties) as communicator:
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
communicator.getProperties().setProperty("TestAdapter.ACM.Timeout", "0")
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TestI.RemoteCommunicatorI(), Ice.stringToIdentity("communicator"))
diff --git a/python/test/Ice/ami/Collocated.py b/python/test/Ice/ami/Collocated.py
index 0b449be5866..b34af35d6f2 100755
--- a/python/test/Ice/ami/Collocated.py
+++ b/python/test/Ice/ami/Collocated.py
@@ -28,8 +28,8 @@ class Collocated(TestHelper):
with self.initialize(properties=properties) as communicator:
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- communicator.getProperties().setProperty("ControllerAdapter.Endpoints", "default -p 12011")
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ communicator.getProperties().setProperty("ControllerAdapter.Endpoints", self.getTestEndpoint(num=1))
communicator.getProperties().setProperty("ControllerAdapter.ThreadPool.Size", "1")
adapter = communicator.createObjectAdapter("TestAdapter")
diff --git a/python/test/Ice/blobject/Client.py b/python/test/Ice/blobject/Client.py
index 64846c2702f..e6378f7aba7 100755
--- a/python/test/Ice/blobject/Client.py
+++ b/python/test/Ice/blobject/Client.py
@@ -24,7 +24,7 @@ def test(b):
class Client(TestHelper):
def allTests(self, communicator, sync):
- hello = Test.HelloPrx.checkedCast(communicator.stringToProxy("test:default -p 12010"))
+ hello = Test.HelloPrx.checkedCast(communicator.stringToProxy("test:{0}".format(self.getTestEndpoint())))
hello.sayHello(False)
hello.sayHello(False, {"_fwd": "o"})
test(hello.add(10, 20) == 30)
@@ -35,7 +35,7 @@ class Client(TestHelper):
pass
try:
- Test.HelloPrx.checkedCast(communicator.stringToProxy("unknown:default -p 12010 -t 10000"))
+ Test.HelloPrx.checkedCast(communicator.stringToProxy("unknown:{0} -t 10000".format(self.getTestEndpoint())))
test(False)
except Ice.ObjectNotExistException:
pass
diff --git a/python/test/Ice/blobject/Server.py b/python/test/Ice/blobject/Server.py
index b1bd3095f81..cc8dc28440a 100755
--- a/python/test/Ice/blobject/Server.py
+++ b/python/test/Ice/blobject/Server.py
@@ -41,7 +41,7 @@ class Server(TestHelper):
#
properties.setProperty("Ice.Warn.Dispatch", "0")
with self.initialize(properties=properties) as communicator:
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TestI(), Ice.stringToIdentity("test"))
adapter.activate()
diff --git a/python/test/Ice/exceptions/ServerAMD.py b/python/test/Ice/exceptions/ServerAMD.py
index 3c229492356..2a94ecf057d 100755
--- a/python/test/Ice/exceptions/ServerAMD.py
+++ b/python/test/Ice/exceptions/ServerAMD.py
@@ -150,10 +150,10 @@ class ServerAMD(TestHelper):
properties.setProperty("Ice.Warn.Connections", "0")
properties.setProperty("Ice.MessageSizeMax", "10")
with self.initialize(properties=properties) as communicator:
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- communicator.getProperties().setProperty("TestAdapter2.Endpoints", "default -p 12011")
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ communicator.getProperties().setProperty("TestAdapter2.Endpoints", self.getTestEndpoint(num=1))
communicator.getProperties().setProperty("TestAdapter2.MessageSizeMax", "0")
- communicator.getProperties().setProperty("TestAdapter3.Endpoints", "default -p 12012")
+ communicator.getProperties().setProperty("TestAdapter3.Endpoints", self.getTestEndpoint(num=2))
communicator.getProperties().setProperty("TestAdapter3.MessageSizeMax", "1")
adapter = communicator.createObjectAdapter("TestAdapter")
diff --git a/python/test/Ice/facets/Client.py b/python/test/Ice/facets/Client.py
index 2a378682942..e68dd08a3f8 100755
--- a/python/test/Ice/facets/Client.py
+++ b/python/test/Ice/facets/Client.py
@@ -16,7 +16,6 @@ import AllTests
class Client(TestHelper):
def run(self, args):
-
- with self.initialize(args) as communicator:
+ with self.initialize(args=args) as communicator:
g = AllTests.allTests(self, communicator)
g.shutdown()
diff --git a/python/test/Ice/facets/Server.py b/python/test/Ice/facets/Server.py
index b0ac848d50c..547c631e98f 100755
--- a/python/test/Ice/facets/Server.py
+++ b/python/test/Ice/facets/Server.py
@@ -17,7 +17,7 @@ import TestI
class Server(TestHelper):
def run(self, args):
- with self.initialize(args) as communicator:
+ with self.initialize(args=args) as communicator:
communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TestI.DI(), Ice.stringToIdentity("d"))
diff --git a/python/test/Ice/faultTolerance/Client.py b/python/test/Ice/faultTolerance/Client.py
index b1f9d8cb981..d7fe484e12f 100755
--- a/python/test/Ice/faultTolerance/Client.py
+++ b/python/test/Ice/faultTolerance/Client.py
@@ -27,7 +27,7 @@ class Client(TestHelper):
ports = []
for arg in args:
if arg[0] == '-':
- raise RuntimeError("unknown option `" + arg + "'")
+ continue
ports.append(int(arg))
if len(ports) == 0:
diff --git a/python/test/Ice/faultTolerance/Server.py b/python/test/Ice/faultTolerance/Server.py
index 3da4d0fdd4f..90634469ec0 100755
--- a/python/test/Ice/faultTolerance/Server.py
+++ b/python/test/Ice/faultTolerance/Server.py
@@ -46,7 +46,7 @@ class Server(TestHelper):
for arg in args:
if arg[0] == '-':
- raise RuntimeError("unknown option `" + arg + "'")
+ continue
if port > 0:
raise RuntimeError("only one port can be specified")
diff --git a/python/test/Ice/info/AllTests.py b/python/test/Ice/info/AllTests.py
index 9bec16441f3..e7d4f14054a 100644
--- a/python/test/Ice/info/AllTests.py
+++ b/python/test/Ice/info/AllTests.py
@@ -148,7 +148,7 @@ def allTests(helper, communicator):
test(port > 0)
udp = base.ice_datagram().ice_getConnection().getEndpoint().getInfo()
- test(udp.port == 12010)
+ test(udp.port == port)
test(udp.host == defaultHost)
print("ok")
@@ -163,7 +163,7 @@ def allTests(helper, communicator):
tcpinfo = getTCPConnectionInfo(info)
test(not info.incoming)
test(len(info.adapterName) == 0)
- test(tcpinfo.remotePort == 12010)
+ test(tcpinfo.remotePort == port)
if defaultHost == '127.0.0.1':
test(tcpinfo.remoteAddress == defaultHost)
test(tcpinfo.localAddress == defaultHost)
diff --git a/python/test/Ice/location/Server.py b/python/test/Ice/location/Server.py
index 52475e42314..a9c6c10d78f 100755
--- a/python/test/Ice/location/Server.py
+++ b/python/test/Ice/location/Server.py
@@ -75,11 +75,12 @@ class ServerLocator(Test.TestLocator):
class ServerManagerI(Test.ServerManager):
- def __init__(self, registry, initData):
+ def __init__(self, registry, initData, helper):
self._registry = registry
self._communicators = []
self._initData = initData
self._nextPort = 1
+ self._helper = helper;
self._initData.properties.setProperty("TestAdapter.AdapterId", "TestAdapter")
self._initData.properties.setProperty("TestAdapter.ReplicaGroupId", "ReplicatedAdapter")
self._initData.properties.setProperty("TestAdapter2.AdapterId", "TestAdapter2")
@@ -97,22 +98,22 @@ class ServerManagerI(Test.ServerManager):
serverCommunicator = Ice.initialize(self._initData)
self._communicators.append(serverCommunicator)
- def getTestEndpoint():
- self._nextPort += 1
- return "default -p {}".format(12010 + self._nextPort)
-
nRetry = 10
while --nRetry > 0:
adapter = None
adapter2 = None
try:
- serverCommunicator.getProperties().setProperty("TestAdapter.Endpoints", getTestEndpoint())
- serverCommunicator.getProperties().setProperty("TestAdapter2.Endpoints", getTestEndpoint())
+ serverCommunicator.getProperties().setProperty("TestAdapter.Endpoints",
+ self._helper.getTestEndpoint(num=self._nextPort))
+ self._nextPort += 1
+ serverCommunicator.getProperties().setProperty("TestAdapter2.Endpoints",
+ self._helper.getTestEndpoint(num=self._nextPort))
+ self._nextPort += 1
adapter = serverCommunicator.createObjectAdapter("TestAdapter")
adapter2 = serverCommunicator.createObjectAdapter("TestAdapter2")
- locator = serverCommunicator.stringToProxy("locator:default -p 12010")
+ locator = serverCommunicator.stringToProxy("locator:{0}".format(self._helper.getTestEndpoint()))
adapter.setLocator(Ice.LocatorPrx.uncheckedCast(locator))
adapter2.setLocator(Ice.LocatorPrx.uncheckedCast(locator))
@@ -195,7 +196,7 @@ class Server(TestHelper):
#
registry = ServerLocatorRegistry()
registry.addObject(adapter.createProxy(Ice.stringToIdentity("ServerManager")))
- adapter.add(ServerManagerI(registry, initData), Ice.stringToIdentity("ServerManager"))
+ adapter.add(ServerManagerI(registry, initData, self), Ice.stringToIdentity("ServerManager"))
registryPrx = Ice.LocatorRegistryPrx.uncheckedCast(adapter.add(registry, Ice.stringToIdentity("registry")))
diff --git a/python/test/Ice/objects/AllTests.py b/python/test/Ice/objects/AllTests.py
index 5c254de44de..b8dde23b1b4 100644
--- a/python/test/Ice/objects/AllTests.py
+++ b/python/test/Ice/objects/AllTests.py
@@ -269,7 +269,7 @@ def allTests(helper, communicator):
if initial.ice_getConnection():
sys.stdout.write("testing UnexpectedObjectException... ")
sys.stdout.flush()
- ref = "uoet:default -p 12010"
+ ref = "uoet:{0}".format(helper.getTestEndpoint())
base = communicator.stringToProxy(ref)
test(base)
uoet = Test.UnexpectedObjectExceptionTestPrx.uncheckedCast(base)
diff --git a/python/test/Ice/operations/AllTests.py b/python/test/Ice/operations/AllTests.py
index b63362ff341..8be399def8e 100644
--- a/python/test/Ice/operations/AllTests.py
+++ b/python/test/Ice/operations/AllTests.py
@@ -16,40 +16,41 @@ def test(b):
def allTests(helper, communicator):
ref = "test:{0}".format(helper.getTestEndpoint())
+ print("Client endpoint: {}".format(ref))
base = communicator.stringToProxy(ref)
cl = Test.MyClassPrx.checkedCast(base)
derived = Test.MyDerivedClassPrx.checkedCast(cl)
sys.stdout.write("testing twoway operations... ")
sys.stdout.flush()
- Twoways.twoways(communicator, cl)
- Twoways.twoways(communicator, derived)
+ Twoways.twoways(helper, cl)
+ Twoways.twoways(helper, derived)
derived.opDerived()
print("ok")
sys.stdout.write("testing oneway operations... ")
sys.stdout.flush()
- Oneways.oneways(communicator, cl)
+ Oneways.oneways(helper, cl)
print("ok")
sys.stdout.write("testing twoway operations with futures... ")
sys.stdout.flush()
- TwowaysFuture.twowaysFuture(communicator, cl)
+ TwowaysFuture.twowaysFuture(helper, cl)
print("ok")
sys.stdout.write("testing twoway operations with AMI... ")
sys.stdout.flush()
- TwowaysAMI.twowaysAMI(communicator, cl)
+ TwowaysAMI.twowaysAMI(helper, cl)
print("ok")
sys.stdout.write("testing oneway operations with futures... ")
sys.stdout.flush()
- OnewaysFuture.onewaysFuture(communicator, cl)
+ OnewaysFuture.onewaysFuture(helper, cl)
print("ok")
sys.stdout.write("testing oneway operations with AMI... ")
sys.stdout.flush()
- OnewaysAMI.onewaysAMI(communicator, cl)
+ OnewaysAMI.onewaysAMI(helper, cl)
print("ok")
sys.stdout.write("testing batch oneway operations... ")
diff --git a/python/test/Ice/operations/Oneways.py b/python/test/Ice/operations/Oneways.py
index 74cbd93ff4f..7d87c1eb718 100644
--- a/python/test/Ice/operations/Oneways.py
+++ b/python/test/Ice/operations/Oneways.py
@@ -13,8 +13,8 @@ def test(b):
if not b:
raise RuntimeError('test assertion failed')
-def oneways(communicator, p):
-
+def oneways(helper, p):
+ communicator = helper.communicator()
p = Test.MyClassPrx.uncheckedCast(p.ice_oneway())
#
diff --git a/python/test/Ice/operations/OnewaysAMI.py b/python/test/Ice/operations/OnewaysAMI.py
index 5c5a134be0d..05e00f8a89f 100644
--- a/python/test/Ice/operations/OnewaysAMI.py
+++ b/python/test/Ice/operations/OnewaysAMI.py
@@ -36,8 +36,8 @@ class Callback(CallbackBase):
def noException(self, ex):
test(False)
-def onewaysAMI(communicator, proxy):
-
+def onewaysAMI(helper, proxy):
+ communicator = helper.communicator()
p = Test.MyClassPrx.uncheckedCast(proxy.ice_oneway())
cb = Callback()
diff --git a/python/test/Ice/operations/OnewaysFuture.py b/python/test/Ice/operations/OnewaysFuture.py
index c17d0e04624..f6ab5aaaebe 100644
--- a/python/test/Ice/operations/OnewaysFuture.py
+++ b/python/test/Ice/operations/OnewaysFuture.py
@@ -13,8 +13,8 @@ def test(b):
if not b:
raise RuntimeError('test assertion failed')
-def onewaysFuture(communicator, proxy):
-
+def onewaysFuture(helper, proxy):
+ communicator = helper.communicator()
p = Test.MyClassPrx.uncheckedCast(proxy.ice_oneway())
f = p.ice_pingAsync()
diff --git a/python/test/Ice/operations/Server.py b/python/test/Ice/operations/Server.py
index f5de973acb6..de09f31ba7e 100755
--- a/python/test/Ice/operations/Server.py
+++ b/python/test/Ice/operations/Server.py
@@ -26,6 +26,7 @@ class Server(TestHelper):
properties.setProperty("Ice.Warn.Dispatch", "0")
with self.initialize(properties=properties) as communicator:
+ print("Server endpoint: {}".format(self.getTestEndpoint()))
communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test"))
diff --git a/python/test/Ice/operations/Twoways.py b/python/test/Ice/operations/Twoways.py
index a441ee9ef6a..5eb179f33e9 100644
--- a/python/test/Ice/operations/Twoways.py
+++ b/python/test/Ice/operations/Twoways.py
@@ -14,8 +14,9 @@ def test(b):
if not b:
raise RuntimeError('test assertion failed')
-def twoways(communicator, p):
+def twoways(helper, p):
+ communicator = helper.communicator()
literals = p.opStringLiterals()
test(Test.s0 == "\\")
@@ -1341,7 +1342,7 @@ def twoways(communicator, p):
ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
- p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:default -p 12010'))
+ p1 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy('test:{0}'.format(helper.getTestEndpoint())))
ic.getImplicitContext().setContext(ctx)
test(ic.getImplicitContext().getContext() == ctx)
diff --git a/python/test/Ice/operations/TwowaysAMI.py b/python/test/Ice/operations/TwowaysAMI.py
index 1c6de0274e5..6189d5255ff 100644
--- a/python/test/Ice/operations/TwowaysAMI.py
+++ b/python/test/Ice/operations/TwowaysAMI.py
@@ -751,7 +751,8 @@ class Callback(CallbackBase):
def exCB(self, ex):
test(False)
-def twowaysAMI(communicator, p):
+def twowaysAMI(helper, p):
+ communicator = helper.communicator()
cb = Callback()
p.begin_ice_ping(cb.ping, cb.exCB)
cb.check()
@@ -1128,7 +1129,7 @@ def twowaysAMI(communicator, p):
ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
- p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010"))
+ p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:{0}".format(helper.getTestEndpoint())))
ic.getImplicitContext().setContext(ctx)
test(ic.getImplicitContext().getContext() == ctx)
diff --git a/python/test/Ice/operations/TwowaysFuture.py b/python/test/Ice/operations/TwowaysFuture.py
index 86e4c86077c..70279725bb1 100644
--- a/python/test/Ice/operations/TwowaysFuture.py
+++ b/python/test/Ice/operations/TwowaysFuture.py
@@ -898,7 +898,8 @@ class Callback(CallbackBase):
def opDerived(self, f):
self.called()
-def twowaysFuture(communicator, p):
+def twowaysFuture(helper, p):
+ communicator = helper.communicator()
f = p.ice_pingAsync()
test(f.result() is None)
@@ -1271,7 +1272,7 @@ def twowaysFuture(communicator, p):
ctx = {'one': 'ONE', 'two': 'TWO', 'three': 'THREE'}
- p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:default -p 12010"))
+ p3 = Test.MyClassPrx.uncheckedCast(ic.stringToProxy("test:{0}".format(helper.getTestEndpoint())))
ic.getImplicitContext().setContext(ctx)
test(ic.getImplicitContext().getContext() == ctx)
diff --git a/python/test/Ice/proxy/AllTests.py b/python/test/Ice/proxy/AllTests.py
index 20a2a7176ae..0b84e30993c 100644
--- a/python/test/Ice/proxy/AllTests.py
+++ b/python/test/Ice/proxy/AllTests.py
@@ -241,7 +241,7 @@ def allTests(helper, communicator, collocated):
#test(b1.ice_getLocatorCacheTimeout() == 60)
#prop.setProperty("Ice.Default.LocatorCacheTimeout", "")
- prop.setProperty(propertyPrefix, "test:default -p 12010")
+ prop.setProperty(propertyPrefix, "test:{0}".format(helper.getTestEndpoint()))
property = propertyPrefix + ".Router"
test(not b1.ice_getRouter())
@@ -810,8 +810,6 @@ def allTests(helper, communicator, collocated):
# Working?
ssl = communicator.getProperties().getProperty("Ice.Default.Protocol") == "ssl"
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 -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMusuAAAQJwAAAA==")
diff --git a/python/test/Ice/proxy/Client.py b/python/test/Ice/proxy/Client.py
index 1bde5dc2a0e..6ea11c0de81 100755
--- a/python/test/Ice/proxy/Client.py
+++ b/python/test/Ice/proxy/Client.py
@@ -16,6 +16,6 @@ import AllTests
class Client(TestHelper):
def run(self, args):
- with self.initialize(args) as communicator:
+ with self.initialize(args=args) as communicator:
myClass = AllTests.allTests(self, communicator, False)
myClass.shutdown()
diff --git a/python/test/Ice/proxy/Server.py b/python/test/Ice/proxy/Server.py
index df82bf7bb87..c36572d2a4d 100755
--- a/python/test/Ice/proxy/Server.py
+++ b/python/test/Ice/proxy/Server.py
@@ -8,34 +8,24 @@
#
# **********************************************************************
-import os, sys, traceback
import Ice
-slice_dir = Ice.getSliceDir()
-if not slice_dir:
- print(sys.argv[0] + ': Slice directory not found.')
- sys.exit(1)
+from TestHelper import TestHelper
+TestHelper.loadSlice("Test.ice")
+import Test
+import TestI
-Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
-import Test, TestI
+class Server(TestHelper):
-def run(args, communicator):
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- adapter = communicator.createObjectAdapter("TestAdapter")
+ def run(self, args):
+ properties = self.createTestProperties(args)
+ properties.setProperty("Ice.Warn.Dispatch", "0")
+ properties.setProperty("Ice.Warn.Connections", "0")
+ with self.initialize(properties=properties) as communicator:
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ adapter = communicator.createObjectAdapter("TestAdapter")
- adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test"))
- adapter.activate()
- communicator.waitForShutdown()
- return True
+ adapter.add(TestI.MyDerivedClassI(), Ice.stringToIdentity("test"))
+ adapter.activate()
+ communicator.waitForShutdown()
-try:
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
- initData.properties.setProperty("Ice.Warn.Dispatch", "0")
- with Ice.initialize(sys.argv, initData) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
-
-sys.exit(not status)
diff --git a/python/test/Ice/proxy/ServerAMD.py b/python/test/Ice/proxy/ServerAMD.py
index 2d130fa9aa8..b6fa4715d09 100755
--- a/python/test/Ice/proxy/ServerAMD.py
+++ b/python/test/Ice/proxy/ServerAMD.py
@@ -8,16 +8,11 @@
#
# **********************************************************************
-import os, sys, traceback, time
-
import Ice
-slice_dir = Ice.getSliceDir()
-if not slice_dir:
- print(sys.argv[0] + ': Slice directory not found.')
- sys.exit(1)
-
-Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
+from TestHelper import TestHelper
+TestHelper.loadSlice("Test.ice")
import Test
+import TestI
class MyDerivedClassI(Test.MyDerivedClass):
def __init__(self):
@@ -36,23 +31,15 @@ class MyDerivedClassI(Test.MyDerivedClass):
self.ctx = current.ctx
return Test.MyDerivedClass.ice_isA(self, s, current)
-def run(args, communicator):
- communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
- adapter = communicator.createObjectAdapter("TestAdapter")
- adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test"))
- adapter.activate()
- communicator.waitForShutdown()
- return True
-
-try:
- initData = Ice.InitializationData()
- initData.properties = Ice.createProperties(sys.argv)
- initData.properties.setProperty("Ice.Warn.Connections", "0")
- initData.properties.setProperty("Ice.Warn.Dispatch", "0")
- with Ice.initialize(sys.argv, initData) as communicator:
- status = run(sys.argv, communicator)
-except:
- traceback.print_exc()
- status = False
-
-sys.exit(not status)
+
+class ServerAMD(TestHelper):
+ def run(self, args):
+ properties = self.createTestProperties(args)
+ properties.setProperty("Ice.Warn.Connections", "0")
+ properties.setProperty("Ice.Warn.Dispatch", "0")
+ with self.initialize(properties=properties) as communicator:
+ communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
+ adapter = communicator.createObjectAdapter("TestAdapter")
+ adapter.add(MyDerivedClassI(), Ice.stringToIdentity("test"))
+ adapter.activate()
+ communicator.waitForShutdown()
diff --git a/python/test/Ice/scope/Server.py b/python/test/Ice/scope/Server.py
index 9d708d843d4..529b8c42ac3 100755
--- a/python/test/Ice/scope/Server.py
+++ b/python/test/Ice/scope/Server.py
@@ -114,7 +114,7 @@ class I4(Inner.Test.Inner2.I):
class Server(TestHelper):
def run(self, args):
- with self.initialize(args) as communicator:
+ with self.initialize(args=args) as communicator:
communicator.getProperties().setProperty("TestAdapter.Endpoints", self.getTestEndpoint())
adapter = communicator.createObjectAdapter("TestAdapter")
adapter.add(I1(), Ice.stringToIdentity("i1"))
diff --git a/python/test/Ice/servantLocator/AllTests.py b/python/test/Ice/servantLocator/AllTests.py
index 4c860a80c31..58b4b9d9b74 100644
--- a/python/test/Ice/servantLocator/AllTests.py
+++ b/python/test/Ice/servantLocator/AllTests.py
@@ -174,7 +174,7 @@ def allTests(helper, communicator):
sys.stdout.flush()
base = communicator.stringToProxy("anothercat/locate:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
- base = communicator.stringToProxy("locate:default -p 12010")
+ base = communicator.stringToProxy("locate:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
try:
Test.TestIntfPrx.checkedCast(
diff --git a/python/test/TestHelper.py b/python/test/TestHelper.py
index c4ffb17f32a..8fd35ad9d4b 100644
--- a/python/test/TestHelper.py
+++ b/python/test/TestHelper.py
@@ -55,7 +55,7 @@ class TestHelper:
def createTestProperties(self, args=[]):
properties = Ice.createProperties(args)
- properties.parseCommandLineOptions("Test", args)
+ args = properties.parseCommandLineOptions("Test", args)
return properties
def initialize(self, initData=None, properties=None, args=[]):