~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to py/test/Ice/info/Server.py

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
# **********************************************************************
 
3
#
 
4
# Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
 
5
#
 
6
# This copy of Ice is licensed to you under the terms described in the
 
7
# ICE_LICENSE file included in this distribution.
 
8
#
 
9
# **********************************************************************
 
10
 
 
11
import os, sys, traceback
 
12
 
 
13
import Ice
 
14
slice_dir = Ice.getSliceDir()
 
15
if not slice_dir:
 
16
    print sys.argv[0] + ': Slice directory not found.'
 
17
    sys.exit(1)
 
18
 
 
19
Ice.loadSlice("'-I" + slice_dir + "' Test.ice")
 
20
import Test, TestI
 
21
 
 
22
def run(args, communicator):
 
23
    communicator.getProperties().setProperty("TestAdapter.Endpoints", "default -p 12010:udp -p 12010")
 
24
    adapter = communicator.createObjectAdapter("TestAdapter")
 
25
    adapter.add(TestI.MyDerivedClassI(), communicator.stringToIdentity("test"))
 
26
    adapter.activate()
 
27
    communicator.waitForShutdown()
 
28
    return True
 
29
 
 
30
try:
 
31
    initData = Ice.InitializationData()
 
32
    initData.properties = Ice.createProperties(sys.argv)
 
33
    communicator = Ice.initialize(sys.argv, initData)
 
34
    status = run(sys.argv, communicator)
 
35
except:
 
36
    traceback.print_exc()
 
37
    status = False
 
38
 
 
39
if communicator:
 
40
    try:
 
41
        communicator.destroy()
 
42
    except:
 
43
        traceback.print_exc()
 
44
        status = False
 
45
 
 
46
sys.exit(not status)