test_NamingManager.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- Python -*-
00003 
00004 #
00005 # \file test_NamingManager.py
00006 # \brief test for naming Service helper class
00007 # \date $Date: 2007/08/27$
00008 # \author Shinji Kurihara
00009 #
00010 # Copyright (C) 2006
00011 #     Task-intelligence Research Group,
00012 #     Intelligent Systems Research Institute,
00013 #     National Institute of
00014 #         Advanced Industrial Science and Technology (AIST), Japan
00015 #     All rights reserved.
00016 #
00017 
00018 import sys
00019 sys.path.insert(1,"../")
00020 from omniORB import CORBA
00021 
00022 import unittest
00023 
00024 import OpenRTM_aist
00025 
00026 from NamingManager import *
00027 
00028 
00029 class test_comp(OpenRTM_aist.RTObject_impl):
00030         def __init__(self):
00031                 pass
00032                 
00033         def echo(self, msg):
00034                 print msg
00035                 return msg
00036 
00037 class TestNamingManager(unittest.TestCase):
00038 
00039         def setUp(self):
00040                 self._mgr = OpenRTM_aist.Manager.init(sys.argv)
00041                 self._nm  = NamingManager(self._mgr)
00042                 self._obj = test_comp()
00043                 self._mgrservant = OpenRTM_aist.ManagerServant()
00044         def __del__(self):
00045                 pass
00046 
00047         def test_bindObject(self):
00048                 self._noc.bindObject("test_comp",self._obj)
00049                 return
00050 
00051         def test_unbindObject(self):
00052                 self._noc.unbindObject("test_comp")
00053                 return
00054 
00055 
00056         def test_registerNameServer(self):
00057                 self._nm.registerNameServer("test_comp","localhost")
00058                 return
00059 
00060         def test_bindObject(self):
00061                 self._nm.bindObject("test_comp",self._obj)
00062                 self._nm.registerNameServer("test_comp","localhost")
00063                 self._nm.bindObject("test_comp",self._obj)
00064                 return
00065 
00066         def test_bindManagerObject(self):
00067                 self._nm.bindManagerObject("test_mgr",self._mgrservant)
00068                 self._nm.registerNameServer("test_comp","localhost")
00069                 self._nm.bindManagerObject("test_mgr",self._mgrservant)
00070                 
00071         def test_update(self):
00072                 self._nm.update()
00073                 self._nm.registerNameServer("test_comp","localhost")
00074                 self._nm.update()
00075                 return
00076         
00077         def test_unbindObject(self):
00078                 self._nm.unbindObject("test_comp")
00079                 self._nm.registerNameServer("test_comp","localhost")
00080                 self._nm.unbindObject("test_comp")
00081                 return
00082 
00083         def test_unbindAll(self):
00084                 self._nm.unbindAll()
00085                 self._nm.registerCompName("rest",self._obj)
00086                 self._nm.unbindAll()
00087                 self._nm.registerMgrName("rest",self._mgrservant)
00088                 self._nm.unbindAll()
00089                 return
00090 
00091         def test_getObjects(self):
00092                 self._nm.bindObject("test_comp",self._obj)
00093                 self.assertEqual(len(self._nm.getObjects()),1)
00094                 return
00095 
00096         def test_createNamingObj(self):
00097                 self._nm.createNamingObj("test", "localhost")
00098                 return
00099 
00100         def test_bindCompsTo(self):
00101                 self._nm.bindCompsTo(self._obj)
00102                 return
00103 
00104         def test_registerCompName(self):
00105                 self._nm.registerCompName("rest",self._obj)
00106                 return
00107 
00108         def test_registerMgrName(self):
00109                 self._nm.registerMgrName("rest",self._mgrservant)
00110                 return
00111 
00112         def test_unregisterCompName(self):
00113                 self._nm.registerCompName("rest",self._obj)
00114                 self._nm.unregisterCompName("rest")
00115                 return
00116 
00117         def test_unregisterMgrName(self):
00118                 self._nm.registerMgrName("rest",self._mgrservant)
00119                 self._nm.unregisterMgrName("rest")
00120                 return
00121 
00122 
00123 ############### test #################
00124 if __name__ == '__main__':
00125         unittest.main()


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Thu Aug 27 2015 14:17:28