diff options
author | Jose <jose@zeroc.com> | 2018-06-28 15:46:50 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2018-06-28 15:46:50 +0200 |
commit | b3763409f91afc54bf8f014d6e92772d6fc34dcb (patch) | |
tree | cdefc610ff161953073337ce0503e505078b4f9a /python | |
parent | Fixed dispatcher test hang (fixes #123) (diff) | |
download | ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.tar.bz2 ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.tar.xz ice-b3763409f91afc54bf8f014d6e92772d6fc34dcb.zip |
Add support cs:namespace metadata
Add support to map Slice modules to different namespaces
using cs:namespace metadata
Fixes #122 slice2cs generates invalid namespace qualification
Diffstat (limited to 'python')
-rw-r--r-- | python/test/Ice/scope/AllTests.py | 41 | ||||
-rwxr-xr-x | python/test/Ice/scope/Server.py | 26 | ||||
-rw-r--r-- | python/test/Ice/scope/Test.ice | 26 |
3 files changed, 92 insertions, 1 deletions
diff --git a/python/test/Ice/scope/AllTests.py b/python/test/Ice/scope/AllTests.py index 2eef2c349a3..b7552d179d5 100644 --- a/python/test/Ice/scope/AllTests.py +++ b/python/test/Ice/scope/AllTests.py @@ -7,7 +7,7 @@ # # ********************************************************************** -import sys, string, re, traceback, Ice, Test +import sys, string, re, traceback, Ice, Test, Inner def test(b): @@ -135,5 +135,44 @@ def allTests(communicator): test(cmap2["a"].s == s1) test(cmap3["a"].s == s1) + i4 = Inner.Test.Inner2.IPrx.checkedCast(communicator.stringToProxy("i4:default -p 12010")) + + s1 = Test.S(0) + + s2, s3 = i4.opS(s1) + + test(s2 == s1) + test(s3 == s1) + + sseq1 = [s1] + + sseq2, sseq3 = i4.opSSeq(sseq1) + + test(sseq2[0] == s1) + test(sseq3[0] == s1) + + smap1 = {"a": s1} + smap2, smap3 = i4.opSMap(smap1) + test(smap2["a"] == s1) + test(smap3["a"] == s1) + + c1 = Test.C(s1) + + c2, c3 = i4.opC(c1) + + test(c2.s == s1) + test(c3.s == s1) + + cseq1 = [c1] + cseq2, cseq3 = i4.opCSeq(cseq1) + + test(cseq2[0].s == s1) + test(cseq3[0].s == s1) + + cmap1 = {"a": c1} + cmap2, cmap3 = i4.opCMap(cmap1) + test(cmap2["a"].s == s1) + test(cmap3["a"].s == s1) + i1.shutdown() print("ok") diff --git a/python/test/Ice/scope/Server.py b/python/test/Ice/scope/Server.py index 895d26cf0bf..c3a70e62c03 100755 --- a/python/test/Ice/scope/Server.py +++ b/python/test/Ice/scope/Server.py @@ -13,6 +13,7 @@ import os, sys, traceback import Ice Ice.loadSlice('Test.ice') import Test +import Inner class I1(Test.I): @@ -87,12 +88,37 @@ class I3(Test.Inner.I): current.adapter.getCommunicator().shutdown() +class I4(Inner.Test.Inner2.I): + + def opS(self, s1, current=None): + return (s1, s1) + + def opSSeq(self, sseq1, current=None): + return (sseq1, sseq1) + + def opSMap(self, smap1, current=None): + return (smap1, smap1) + + def opC(self, c1, current=None): + return (c1, c1) + + def opCSeq(self, cseq1, current=None): + return (cseq1, cseq1) + + def opCMap(self, cmap1, current=None): + return (cmap1, cmap1) + + def shutdown(self, current=None): + current.adapter.getCommunicator().shutdown() + + def run(args, communicator): communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") adapter = communicator.createObjectAdapter("TestAdapter") adapter.add(I1(), Ice.stringToIdentity("i1")) adapter.add(I2(), Ice.stringToIdentity("i2")) adapter.add(I3(), Ice.stringToIdentity("i3")) + adapter.add(I4(), Ice.stringToIdentity("i4")) adapter.activate() communicator.waitForShutdown() return True diff --git a/python/test/Ice/scope/Test.ice b/python/test/Ice/scope/Test.ice index fbd505e2ee4..e40116886d3 100644 --- a/python/test/Ice/scope/Test.ice +++ b/python/test/Ice/scope/Test.ice @@ -113,3 +113,29 @@ module Test sequence<I*> ISeq; } } + +module Inner +{ + +module Test +{ + +module Inner2 +{ + interface I + { + Test::S opS(Test::S s1, out Test::S s2); + Test::SSeq opSSeq(Test::SSeq s1, out Test::SSeq s2); + Test::SMap opSMap(Test::SMap s1, out Test::SMap s2); + + Test::C opC(Test::C c1, out Test::C c2); + Test::CSeq opCSeq(Test::CSeq c1, out Test::CSeq c2); + Test::CMap opCMap(Test::CMap c1, out Test::CMap c2); + + void shutdown(); + } +} + +} + +} |