diff options
Diffstat (limited to 'py/test/Ice/proxy/AllTests.py')
-rw-r--r-- | py/test/Ice/proxy/AllTests.py | 71 |
1 files changed, 28 insertions, 43 deletions
diff --git a/py/test/Ice/proxy/AllTests.py b/py/test/Ice/proxy/AllTests.py index 7d8e684d22d..bda80313217 100644 --- a/py/test/Ice/proxy/AllTests.py +++ b/py/test/Ice/proxy/AllTests.py @@ -285,26 +285,6 @@ def allTests(communicator, collocated): #test(not b1.ice_isCollocationOptimized()) #prop.setProperty(property, "") - property = propertyPrefix + ".EncodingVersion" - test(b1.ice_getEncodingVersion() == Ice.currentEncoding()) - prop.setProperty(property, "1.0") - b1 = communicator.propertyToProxy(propertyPrefix) - test(b1.ice_getEncodingVersion().major == 1 and b1.ice_getEncodingVersion().minor == 0) - prop.setProperty(property, "6.5") - try: - communicator.propertyToProxy(propertyPrefix) - test(False) - except Ice.UnsupportedEncodingException: - pass - - prop.setProperty(property, "1.2") - try: - communicator.propertyToProxy(propertyPrefix) - test(False) - except Ice.UnsupportedEncodingException: - pass - prop.setProperty(property, "") - print("ok") sys.stdout.write("testing proxyToProperty... ") @@ -336,38 +316,29 @@ def allTests(communicator, collocated): b1 = b1.ice_locator(Ice.LocatorPrx.uncheckedCast(locator)) proxyProps = communicator.proxyToProperty(b1, "Test") - test(len(proxyProps) == 21) + test(len(proxyProps) == 18) test(proxyProps["Test"] == "test -t") #test(proxyProps["Test.CollocationOptimized"] == "1") - test(proxyProps["Test.EncodingVersion"] == "1.0") test(proxyProps["Test.ConnectionCached"] == "1") test(proxyProps["Test.PreferSecure"] == "0") test(proxyProps["Test.EndpointSelection"] == "Ordered") test(proxyProps["Test.LocatorCacheTimeout"] == "100") - test(proxyProps["Test.Locator"] == "locator -t") + test(proxyProps["Test.Locator"] == "locator -t -e " + Ice.encodingVersionToString(Ice.currentEncoding())) #test(proxyProps["Test.Locator.CollocationOptimized"] == "1") - test(proxyProps["Test.Locator.EncodingVersion"] == Ice.encodingVersionToString(Ice.currentEncoding())) test(proxyProps["Test.Locator.ConnectionCached"] == "0") test(proxyProps["Test.Locator.PreferSecure"] == "1") test(proxyProps["Test.Locator.EndpointSelection"] == "Random") test(proxyProps["Test.Locator.LocatorCacheTimeout"] == "300") - test(proxyProps["Test.Locator.Router"] == "router -t") - test(proxyProps["Test.Locator.Router.EncodingVersion"] == Ice.encodingVersionToString(Ice.currentEncoding())) + test(proxyProps["Test.Locator.Router"] == "router -t -e " + Ice.encodingVersionToString(Ice.currentEncoding())) #test(proxyProps["Test.Locator.Router.CollocationOptimized"] == "0") test(proxyProps["Test.Locator.Router.ConnectionCached"] == "1") test(proxyProps["Test.Locator.Router.PreferSecure"] == "1") test(proxyProps["Test.Locator.Router.EndpointSelection"] == "Random") test(proxyProps["Test.Locator.Router.LocatorCacheTimeout"] == "200") - try: - b1.ice_encodingVersion(Ice.EncodingVersion(3, 4)) - test(False) - except Ice.UnsupportedEncodingException: - pass - print("ok") sys.stdout.write("testing ice_getCommunicator... ") @@ -582,6 +553,24 @@ def allTests(communicator, collocated): test(c == c2) print("ok") + sys.stdout.write("testing encoding versioning... ") + sys.stdout.flush() + ref20 = "test -e 2.0:default -p 12010"; + cl20 = Test.MyClassPrx.uncheckedCast(communicator.stringToProxy(ref20)); + try: + cl20.ice_ping(); + test(false); + except Ice.UnsupportedEncodingException: + # Server 2.0 endpoint doesn't support 1.1 version. + pass + + ref10 = "test -e 1.0:default -p 12010"; + cl10 = Test.MyClassPrx.uncheckedCast(communicator.stringToProxy(ref10)); + cl10.ice_ping(); + cl10.ice_encodingVersion(Ice.Encoding_1_0).ice_ping(); + cl.ice_encodingVersion(Ice.Encoding_1_0).ice_ping(); + print("ok") + sys.stdout.write("testing opaque endpoints... ") sys.stdout.flush() @@ -663,17 +652,13 @@ def allTests(communicator, collocated): pass # Legal TCP endpoint expressed as opaque endpoint - p1 = communicator.stringToProxy("test:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==") + p1 = communicator.stringToProxy("test -e 1.1:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==") pstr = communicator.proxyToString(p1) - test(pstr == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000") - - # 1.1 TCP endpoint encoded with 1.1 encoding. - p2 = communicator.stringToProxy("test:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAAEAAQE=") - test(communicator.proxyToString(p2) == "test -t:tcp -e 1.1 -h 127.0.0.1 -p 12010 -t 10000") + test(pstr == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000") - # 1.0 TCP endpoint encoded with 1.1 encoding. - p2 = communicator.stringToProxy("test: opaque -t 1 -e 1.1 -v CTEyNy4wLjAuMeouAAAQJwAAAAEAAQA=") - test(communicator.proxyToString(p2) == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000") + # Opaque endpoint encoded with 1.1 encoding. + p2 = communicator.stringToProxy("test -e 1.1:opaque -e 1.1 -t 1 -v CTEyNy4wLjAuMeouAAAQJwAAAA==") + test(communicator.proxyToString(p2) == "test -t -e 1.1:tcp -h 127.0.0.1 -p 12010 -t 10000") if communicator.getProperties().getPropertyAsInt("Ice.IPv6") == 0: # Working? @@ -682,7 +667,7 @@ def allTests(communicator, collocated): p1.ice_encodingVersion(Ice.Encoding_1_0).ice_ping() # Two legal TCP endpoints expressed as opaque endpoints - p1 = communicator.stringToProxy("test:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMusuAAAQJwAAAA==") + p1 = communicator.stringToProxy("test -e 1.0:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMeouAAAQJwAAAA==:opaque -t 1 -e 1.0 -v CTEyNy4wLjAuMusuAAAQJwAAAA==") pstr = communicator.proxyToString(p1) test(pstr == "test -t:tcp -h 127.0.0.1 -p 12010 -t 10000:tcp -h 127.0.0.2 -p 12011 -t 10000") @@ -690,7 +675,7 @@ def allTests(communicator, collocated): # Test that an SSL endpoint and a nonsense endpoint get written # back out as an opaque endpoint. # - p1 = communicator.stringToProxy("test:opaque -t 2 -e 1.0 -v CTEyNy4wLjAuMREnAAD/////AA==:opaque -t 99 -e 1.0 -v abch") + p1 = communicator.stringToProxy("test -e 1.0:opaque -t 2 -e 1.0 -v CTEyNy4wLjAuMREnAAD/////AA==:opaque -t 99 -e 1.0 -v abch") pstr = communicator.proxyToString(p1) if not ssl: test(pstr == "test -t:opaque -t 2 -e 1.0 -v CTEyNy4wLjAuMREnAAD/////AA==:opaque -t 99 -e 1.0 -v abch") |