diff options
author | Mark Spruiell <mes@zeroc.com> | 2012-09-14 15:30:12 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2012-09-14 15:30:12 -0700 |
commit | c912d30d47799bbba77d0f2532704d8aaba12a4a (patch) | |
tree | 8611fdb0b73a9a78f7c319ca4bb08f1f9d2e9cd0 /py/test/Ice/optional/ServerAMD.py | |
parent | Fixed optional test issues (diff) | |
download | ice-c912d30d47799bbba77d0f2532704d8aaba12a4a.tar.bz2 ice-c912d30d47799bbba77d0f2532704d8aaba12a4a.tar.xz ice-c912d30d47799bbba77d0f2532704d8aaba12a4a.zip |
Python support for optionals
Diffstat (limited to 'py/test/Ice/optional/ServerAMD.py')
-rwxr-xr-x | py/test/Ice/optional/ServerAMD.py | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/py/test/Ice/optional/ServerAMD.py b/py/test/Ice/optional/ServerAMD.py new file mode 100755 index 00000000000..bfdfa7369f6 --- /dev/null +++ b/py/test/Ice/optional/ServerAMD.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import os, sys, traceback + +import Ice +Ice.loadSlice('TestAMD.ice') +import Test + +class InitialI(Test.Initial): + + def shutdown_async(self, cb, current=None): + current.adapter.getCommunicator().shutdown() + cb.ice_response() + + def pingPong_async(self, cb, o, current=None): + cb.ice_response(o) + + def opOptionalException_async(self, cb, a, b, o, current=None): + cb.ice_exception(Test.OptionalException(a, b, o)) + + def opDerivedException_async(self, cb, a, b, o, current=None): + cb.ice_exception(Test.DerivedException(a, b, o, b, o)) + + def opRequiredException_async(self, cb, a, b, o, current=None): + if b == Ice.Unset: + ss = "none" + else: + ss = b + if o == Ice.Unset: + o2 = None + else: + o2 = o + cb.ice_exception(Test.RequiredException(a, b, o, ss, o2)) + + def opByte_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opBool_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opShort_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opInt_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opLong_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opFloat_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opDouble_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opString_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opMyEnum_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opSmallStruct_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opFixedStruct_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opVarStruct_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opOneOptional_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opOneOptionalProxy_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opByteSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opBoolSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opShortSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opIntSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opLongSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opFloatSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opDoubleSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opStringSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opSmallStructSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opSmallStructList_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opFixedStructSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opFixedStructList_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opVarStructSeq_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opIntIntDict_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opStringIntDict_async(self, cb, p1, current=None): + cb.ice_response(p1, p1) + + def opClassAndUnknownOptional_async(self, cb, p, current=None): + cb.ice_response() + +def run(args, communicator): + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp") + adapter = communicator.createObjectAdapter("TestAdapter") + initial = InitialI() + adapter.add(initial, communicator.stringToIdentity("initial")) + adapter.activate() + + communicator.waitForShutdown() + return True + +try: + communicator = Ice.initialize(sys.argv) + status = run(sys.argv, communicator) +except: + traceback.print_exc() + status = False + +if communicator: + try: + communicator.destroy() + except: + traceback.print_exc() + status = False + +sys.exit(not status) |