summaryrefslogtreecommitdiff
path: root/python/test/Ice/optional/ServerAMD.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
committerMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
commit3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5 (patch)
treea8edbf5d1043527cc50880b34ee83458ed7e4855 /python/test/Ice/optional/ServerAMD.py
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.bz2
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.xz
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.zip
ICE-7138 - new Python AMI mapping based on futures and modified AMD mapping
Diffstat (limited to 'python/test/Ice/optional/ServerAMD.py')
-rwxr-xr-xpython/test/Ice/optional/ServerAMD.py221
1 files changed, 113 insertions, 108 deletions
diff --git a/python/test/Ice/optional/ServerAMD.py b/python/test/Ice/optional/ServerAMD.py
index 15f4ca42867..a9bbda70c9b 100755
--- a/python/test/Ice/optional/ServerAMD.py
+++ b/python/test/Ice/optional/ServerAMD.py
@@ -16,20 +16,23 @@ import Test
class InitialI(Test.Initial):
- def shutdown_async(self, cb, current=None):
+ def shutdown(self, current=None):
current.adapter.getCommunicator().shutdown()
- cb.ice_response()
- def pingPong_async(self, cb, o, current=None):
- cb.ice_response(o)
+ def pingPong(self, o, current=None):
+ return Ice.Future.completed(o)
- def opOptionalException_async(self, cb, a, b, o, current=None):
- cb.ice_exception(Test.OptionalException(False, a, b, o))
+ def opOptionalException(self, a, b, o, current=None):
+ f = Ice.Future()
+ f.set_exception(Test.OptionalException(False, a, b, o))
+ return f
- def opDerivedException_async(self, cb, a, b, o, current=None):
- cb.ice_exception(Test.DerivedException(False, a, b, o, b, o))
+ def opDerivedException(self, a, b, o, current=None):
+ f = Ice.Future()
+ f.set_exception(Test.DerivedException(False, a, b, o, b, o))
+ return f
- def opRequiredException_async(self, cb, a, b, o, current=None):
+ def opRequiredException(self, a, b, o, current=None):
e = Test.RequiredException()
e.a = a
e.b = b
@@ -38,154 +41,156 @@ class InitialI(Test.Initial):
e.ss = b
if o is not Ice.Unset:
e.o2 = o
- cb.ice_exception(e)
+ f = Ice.Future()
+ f.set_exception(e)
+ return f
- def opByte_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opByte(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opBool_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opBool(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opShort_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opShort(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opInt_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opInt(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opLong_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opLong(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opFloat_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opFloat(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opDouble_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opDouble(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opString_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opString(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opMyEnum_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opMyEnum(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opSmallStruct_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opSmallStruct(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opFixedStruct_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opFixedStruct(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opVarStruct_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opVarStruct(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opOneOptional_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opOneOptional(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opOneOptionalProxy_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opOneOptionalProxy(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opByteSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opByteSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opBoolSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opBoolSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opShortSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opShortSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opIntSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opIntSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opLongSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opLongSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opFloatSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opFloatSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opDoubleSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opDoubleSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opStringSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opStringSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opSmallStructSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opSmallStructSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opSmallStructList_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opSmallStructList(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opFixedStructSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opFixedStructSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opFixedStructList_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opFixedStructList(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opVarStructSeq_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opVarStructSeq(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opSerializable_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opSerializable(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opIntIntDict_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opIntIntDict(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opStringIntDict_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opStringIntDict(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opIntOneOptionalDict_async(self, cb, p1, current=None):
- cb.ice_response(p1, p1)
+ def opIntOneOptionalDict(self, p1, current=None):
+ return Ice.Future.completed((p1, p1))
- def opClassAndUnknownOptional_async(self, cb, p, current=None):
- cb.ice_response()
+ def opClassAndUnknownOptional(self, p, current=None):
+ return Ice.Future.completed(None)
- def sendOptionalClass_async(self, cb, req, o, current=None):
- cb.ice_response()
+ def sendOptionalClass(self, req, o, current=None):
+ return Ice.Future.completed(None)
- def returnOptionalClass_async(self, cb, req, current=None):
- cb.ice_response(Test.OneOptional(53))
+ def returnOptionalClass(self, req, current=None):
+ return Ice.Future.completed(Test.OneOptional(53))
- def opG_async(self, cb, g, current=None):
- cb.ice_response(g)
+ def opG(self, g, current=None):
+ return Ice.Future.completed(g)
- def opVoid_async(self, cb, current=None):
- cb.ice_response()
+ def opVoid(self, current=None):
+ return Ice.Future.completed(None)
- def opMStruct1_async(self, cb, current):
- cb.ice_response(Test.SmallStruct())
+ def opMStruct1(self, current):
+ return Ice.Future.completed(Test.SmallStruct())
- def opMStruct2_async(self, cb, p1, current):
- cb.ice_response(p1, p1)
+ def opMStruct2(self, p1, current):
+ return Ice.Future.completed((p1, p1))
- def opMSeq1_async(self, cb, current):
- cb.ice_response([])
+ def opMSeq1(self, current):
+ return Ice.Future.completed([])
- def opMSeq2_async(self, cb, p1, current):
- cb.ice_response(p1, p1)
+ def opMSeq2(self, p1, current):
+ return Ice.Future.completed((p1, p1))
- def opMDict1_async(self, cb, current):
- cb.ice_response({})
+ def opMDict1(self, current):
+ return Ice.Future.completed({})
- def opMDict2_async(self, cb, p1, current):
- cb.ice_response(p1, p1)
+ def opMDict2(self, p1, current):
+ return Ice.Future.completed((p1, p1))
- def opMG1_async(self, cb, current):
- cb.ice_response(Test.G())
+ def opMG1(self, current):
+ return Ice.Future.completed(Test.G())
- def opMG2_async(self, cb, p1, current):
- cb.ice_response(p1, p1)
+ def opMG2(self, p1, current):
+ return Ice.Future.completed((p1, p1))
- def supportsRequiredParams_async(self, cb, current=None):
- cb.ice_response(False)
+ def supportsRequiredParams(self, current=None):
+ return Ice.Future.completed(False)
- def supportsJavaSerializable_async(self, cb, current=None):
- cb.ice_response(True)
+ def supportsJavaSerializable(self, current=None):
+ return Ice.Future.completed(True)
- def supportsCsharpSerializable_async(self, cb, current=None):
- cb.ice_response(False)
+ def supportsCsharpSerializable(self, current=None):
+ return Ice.Future.completed(False)
- def supportsCppStringView_async(self, cb, current=None):
- cb.ice_response(False)
+ def supportsCppStringView(self, current=None):
+ return Ice.Future.completed(False)
- def supportsNullOptional_async(self, cb, current=None):
- cb.ice_response(True)
+ def supportsNullOptional(self, current=None):
+ return Ice.Future.completed(True)
def run(args, communicator):
communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp")