diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-10-24 13:59:59 -0700 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-10-24 13:59:59 -0700 |
commit | a2d0c97dffa640c7359bf7f5fb824ee84bf4020a (patch) | |
tree | 42d682fc761c514523c9b5e77f39bf1b3b22632e /python/test/Ice/packagemd/Server.py | |
parent | Fixed generated code warnings showing up with Objective-C and Xcode 9.0 (ICE-... (diff) | |
download | ice-a2d0c97dffa640c7359bf7f5fb824ee84bf4020a.tar.bz2 ice-a2d0c97dffa640c7359bf7f5fb824ee84bf4020a.tar.xz ice-a2d0c97dffa640c7359bf7f5fb824ee84bf4020a.zip |
ICE-8545 - add test for python package metadata
Diffstat (limited to 'python/test/Ice/packagemd/Server.py')
-rwxr-xr-x | python/test/Ice/packagemd/Server.py | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/python/test/Ice/packagemd/Server.py b/python/test/Ice/packagemd/Server.py new file mode 100755 index 00000000000..a71ef1bfb8f --- /dev/null +++ b/python/test/Ice/packagemd/Server.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2017 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('--all -I. Test.ice') +import Test, Test1, testpkg + +class InitialI(Test.Initial): + + def getTest1C2AsObject(self, current): + return Test1.C2() + + def getTest1C2AsC1(self, current): + return Test1.C2() + + def getTest1C2AsC2(self, current): + return Test1.C2() + + def throwTest1E2AsE1(self, current): + raise Test1.E2() + + def throwTest1E2AsE2(self, current): + raise Test1.E2() + + def throwTest1Def(self, current): + raise Test1._def() + + def getTest2C2AsObject(self, current): + return testpkg.Test2.C2() + + def getTest2C2AsC1(self, current): + return testpkg.Test2.C2() + + def getTest2C2AsC2(self, current): + return testpkg.Test2.C2() + + def throwTest2E2AsE1(self, current): + raise testpkg.Test2.E2() + + def throwTest2E2AsE2(self, current): + raise testpkg.Test2.E2() + + def getTest3C2AsObject(self, current): + return testpkg.Test3.C2() + + def getTest3C2AsC1(self, current): + return testpkg.Test3.C2() + + def getTest3C2AsC2(self, current): + return testpkg.Test3.C2() + + def throwTest3E2AsE1(self, current): + raise testpkg.Test3.E2() + + def throwTest3E2AsE2(self, current): + raise testpkg.Test3.E2() + + def shutdown(self, current): + current.adapter.getCommunicator().shutdown() + +def run(args, communicator): + communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010") + adapter = communicator.createObjectAdapter("TestAdapter") + initial = InitialI() + adapter.add(initial, Ice.stringToIdentity("initial")) + adapter.activate() + + communicator.waitForShutdown() + return True + +try: + with Ice.initialize(sys.argv) as communicator: + status = run(sys.argv, communicator) +except: + traceback.print_exc() + status = False + +sys.exit(not status) |