ICE 3.4.2
[php5-ice-freebsdport.git] / py / test / Ice / facets / Collocated.py
blobacbe9b0c0fab89da1f611ee91696e8d61eb18480
1 #!/usr/bin/env python
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
13 import Ice
14 Ice.loadSlice('Test.ice')
15 import Test, TestI, AllTests
17 def run(args, communicator):
18 communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010")
19 adapter = communicator.createObjectAdapter("TestAdapter")
20 d = TestI.DI()
21 adapter.add(d, communicator.stringToIdentity("d"))
22 adapter.addFacet(d, communicator.stringToIdentity("d"), "facetABCD")
23 f = TestI.FI()
24 adapter.addFacet(f, communicator.stringToIdentity("d"), "facetEF")
25 h = TestI.HI(communicator)
26 adapter.addFacet(h, communicator.stringToIdentity("d"), "facetGH")
28 adapter.activate()
30 AllTests.allTests(communicator)
32 return True
34 try:
35 communicator = Ice.initialize(sys.argv)
36 status = run(sys.argv, communicator)
37 except:
38 traceback.print_exc()
39 status = False
41 if communicator:
42 try:
43 communicator.destroy()
44 except:
45 traceback.print_exc()
46 status = False
48 sys.exit(not status)