summaryrefslogtreecommitdiff
path: root/python/test/Ice/servantLocator/AllTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/servantLocator/AllTests.py')
-rw-r--r--python/test/Ice/servantLocator/AllTests.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/python/test/Ice/servantLocator/AllTests.py b/python/test/Ice/servantLocator/AllTests.py
index 930aa7bb889..4c860a80c31 100644
--- a/python/test/Ice/servantLocator/AllTests.py
+++ b/python/test/Ice/servantLocator/AllTests.py
@@ -13,7 +13,7 @@ def test(b):
if not b:
raise RuntimeError('test assertion failed')
-def testExceptions(obj, collocated):
+def testExceptions(obj):
try:
obj.requestFailedException()
@@ -64,10 +64,7 @@ def testExceptions(obj, collocated):
obj.localException()
test(False)
except Ice.UnknownLocalException as ex:
- test(not collocated)
test(ex.unknown.find("Ice.SocketException") >= 0 or ex.unknown.find("Ice::SocketException") >= 0)
- except SocketException:
- test(collocated)
except:
test(False)
@@ -127,10 +124,10 @@ def testExceptions(obj, collocated):
except:
test(False)
-def allTests(communicator, collocated):
+def allTests(helper, communicator):
sys.stdout.write("testing stringToProxy... ")
sys.stdout.flush()
- base = communicator.stringToProxy("asm:default -p 12010")
+ base = communicator.stringToProxy("asm:{0}".format(helper.getTestEndpoint()))
test(base)
print("ok")
@@ -144,7 +141,7 @@ def allTests(communicator, collocated):
sys.stdout.write("testing ice_ids... ")
sys.stdout.flush()
try:
- obj = communicator.stringToProxy("category/locate:default -p 12010")
+ obj = communicator.stringToProxy("category/locate:{0}".format(helper.getTestEndpoint()))
obj.ice_ids()
test(False)
except Ice.UnknownUserException as ex:
@@ -153,7 +150,7 @@ def allTests(communicator, collocated):
test(False)
try:
- obj = communicator.stringToProxy("category/finished:default -p 12010")
+ obj = communicator.stringToProxy("category/finished:{0}".format(helper.getTestEndpoint()))
obj.ice_ids()
test(False)
except Ice.UnknownUserException as ex:
@@ -164,47 +161,49 @@ def allTests(communicator, collocated):
sys.stdout.write("testing servant locator... ")
sys.stdout.flush()
- base = communicator.stringToProxy("category/locate:default -p 12010")
+ base = communicator.stringToProxy("category/locate:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
try:
- Test.TestIntfPrx.checkedCast(communicator.stringToProxy("category/unknown:default -p 12010"))
+ Test.TestIntfPrx.checkedCast(
+ communicator.stringToProxy("category/unknown:{0}".format(helper.getTestEndpoint())))
except Ice.ObjectNotExistException:
pass
print("ok")
sys.stdout.write("testing default servant locator... ")
sys.stdout.flush()
- base = communicator.stringToProxy("anothercat/locate:default -p 12010")
+ base = communicator.stringToProxy("anothercat/locate:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
base = communicator.stringToProxy("locate:default -p 12010")
obj = Test.TestIntfPrx.checkedCast(base)
try:
- Test.TestIntfPrx.checkedCast(communicator.stringToProxy("anothercat/unknown:default -p 12010"))
+ Test.TestIntfPrx.checkedCast(
+ communicator.stringToProxy("anothercat/unknown:{0}".format(helper.getTestEndpoint())))
except Ice.ObjectNotExistException:
pass
try:
- Test.TestIntfPrx.checkedCast(communicator.stringToProxy("unknown:default -p 12010"))
+ Test.TestIntfPrx.checkedCast(communicator.stringToProxy("unknown:{0}".format(helper.getTestEndpoint())))
except Ice.ObjectNotExistException:
pass
print("ok")
sys.stdout.write("testing locate exceptions... ")
sys.stdout.flush()
- base = communicator.stringToProxy("category/locate:default -p 12010")
+ base = communicator.stringToProxy("category/locate:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
- testExceptions(obj, collocated)
+ testExceptions(obj)
print("ok")
sys.stdout.write("testing finished exceptions... ")
sys.stdout.flush()
- base = communicator.stringToProxy("category/finished:default -p 12010")
+ base = communicator.stringToProxy("category/finished:{0}".format(helper.getTestEndpoint()))
obj = Test.TestIntfPrx.checkedCast(base)
- testExceptions(obj, collocated)
+ testExceptions(obj)
print("ok")
sys.stdout.write("testing servant locator removal... ")
sys.stdout.flush()
- base = communicator.stringToProxy("test/activation:default -p 12010")
+ base = communicator.stringToProxy("test/activation:{0}".format(helper.getTestEndpoint()))
activation = Test.TestActivationPrx.checkedCast(base)
activation.activateServantLocator(False)
try: