test_NamingManager.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 #
5 # \file test_NamingManager.py
6 # \brief test for naming Service helper class
7 # \date $Date: 2007/08/27$
8 # \author Shinji Kurihara
9 #
10 # Copyright (C) 2006
11 # Task-intelligence Research Group,
12 # Intelligent Systems Research Institute,
13 # National Institute of
14 # Advanced Industrial Science and Technology (AIST), Japan
15 # All rights reserved.
16 #
17 
18 import sys
19 sys.path.insert(1,"../")
20 from omniORB import CORBA
21 
22 import unittest
23 
24 import OpenRTM_aist
25 
26 from NamingManager import *
27 
28 
30  def __init__(self):
31  pass
32 
33  def echo(self, msg):
34  print msg
35  return msg
36 
37 class TestNamingManager(unittest.TestCase):
38 
39  def setUp(self):
40  self._mgr = OpenRTM_aist.Manager.init(sys.argv)
41  self._nm = NamingManager(self._mgr)
42  self._obj = test_comp()
44  def __del__(self):
45  pass
46 
47  def test_bindObject(self):
48  self._noc.bindObject("test_comp",self._obj)
49  return
50 
51  def test_unbindObject(self):
52  self._noc.unbindObject("test_comp")
53  return
54 
55 
57  self._nm.registerNameServer("test_comp","localhost")
58  return
59 
60  def test_bindObject(self):
61  self._nm.bindObject("test_comp",self._obj)
62  self._nm.registerNameServer("test_comp","localhost")
63  self._nm.bindObject("test_comp",self._obj)
64  return
65 
67  self._nm.bindManagerObject("test_mgr",self._mgrservant)
68  self._nm.registerNameServer("test_comp","localhost")
69  self._nm.bindManagerObject("test_mgr",self._mgrservant)
70 
71  def test_update(self):
72  self._nm.update()
73  self._nm.registerNameServer("test_comp","localhost")
74  self._nm.update()
75  return
76 
77  def test_unbindObject(self):
78  self._nm.unbindObject("test_comp")
79  self._nm.registerNameServer("test_comp","localhost")
80  self._nm.unbindObject("test_comp")
81  return
82 
83  def test_unbindAll(self):
84  self._nm.unbindAll()
85  self._nm.registerCompName("rest",self._obj)
86  self._nm.unbindAll()
87  self._nm.registerMgrName("rest",self._mgrservant)
88  self._nm.unbindAll()
89  return
90 
91  def test_getObjects(self):
92  self._nm.bindObject("test_comp",self._obj)
93  self.assertEqual(len(self._nm.getObjects()),1)
94  return
95 
97  self._nm.createNamingObj("test", "localhost")
98  return
99 
100  def test_bindCompsTo(self):
101  self._nm.bindCompsTo(self._obj)
102  return
103 
105  self._nm.registerCompName("rest",self._obj)
106  return
107 
109  self._nm.registerMgrName("rest",self._mgrservant)
110  return
111 
113  self._nm.registerCompName("rest",self._obj)
114  self._nm.unregisterCompName("rest")
115  return
116 
118  self._nm.registerMgrName("rest",self._mgrservant)
119  self._nm.unregisterMgrName("rest")
120  return
121 
122 
123 
124 if __name__ == '__main__':
125  unittest.main()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:07