summaryrefslogtreecommitdiff
path: root/python/test/Ice/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/proxy')
-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
4 files changed, 32 insertions, 57 deletions
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()