2 # **********************************************************************
4 # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
6 # This copy of Ice is licensed to you under the terms described in the
7 # ICE_LICENSE file included in this distribution.
9 # **********************************************************************
11 import os
, sys
, traceback
14 Ice
.loadSlice('Test.ice')
20 raise RuntimeError('test assertion failed')
22 def run(args
, communicator
, sync
):
23 hello
= Test
.HelloPrx
.checkedCast(communicator
.stringToProxy("test:default -p 12010"))
25 hello
.sayHello(False, { "_fwd":"o" } )
26 test(hello
.add(10, 20) == 30)
34 Test
.HelloPrx
.checkedCast(communicator
.stringToProxy("unknown:default -p 12010 -t 10000"))
36 except Ice
.ObjectNotExistException
:
39 # First try an object at a non-existent endpoint.
41 Test
.HelloPrx
.checkedCast(communicator
.stringToProxy("missing:default -p 12000 -t 10000"))
43 except Ice
.UnknownLocalException
, e
:
44 test(e
.unknown
.find('ConnectionRefusedException'))
49 argv
= sys
.argv
[:] # Clone the arguments to use again later
52 initData
= Ice
.InitializationData()
53 initData
.properties
= Ice
.createProperties(argv
)
54 initData
.properties
.setProperty('Ice.Warn.Dispatch', '0')
55 communicator
= Ice
.initialize(argv
, initData
)
56 router
= RouterI
.RouterI(communicator
, False)
57 print "testing async blobject...",
59 status
= run(sys
.argv
, communicator
, False)
68 communicator
.destroy()
75 initData
= Ice
.InitializationData()
76 initData
.properties
= Ice
.createProperties(sys
.argv
)
77 initData
.properties
.setProperty('Ice.Warn.Dispatch', '0')
78 communicator
= Ice
.initialize(sys
.argv
, initData
)
79 router
= RouterI
.RouterI(communicator
, True)
80 print "testing sync blobject...",
82 status
= run(sys
.argv
, communicator
, True)
91 communicator
.destroy()