test_OutPortProvider.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 # -*- Python -*-
00003 
00004 #
00005 # \file  test_OutPortProvider.py
00006 # \brief test for OutPortProvider class
00007 # \date  $Date: 2007/09/05$
00008 # \author Shinji Kurihara
00009 #
00010 # Copyright (C) 2006
00011 #     Noriaki Ando
00012 #     Task-intelligence Research Group,
00013 #     Intelligent Systems Research Institute,
00014 #     National Institute of
00015 #         Advanced Industrial Science and Technology (AIST), Japan
00016 #     All rights reserved.
00017 #
00018 
00019 import sys
00020 sys.path.insert(1,"../")
00021 
00022 import unittest
00023 
00024 from OutPortProvider import *
00025 import OpenRTM_aist
00026 
00027 
00028 class TestOutPortProvider(unittest.TestCase):
00029   def setUp(self):
00030     self._opp = OutPortProvider()
00031     return
00032 
00033   def tearDown(self):
00034     OpenRTM_aist.Manager.instance().shutdownManager()
00035     return
00036 
00037   def test_publishInterfaceProfile(self):
00038     properties = []
00039     self._opp.setInterfaceType("corba_cdr")
00040     self._opp.publishInterfaceProfile(properties)
00041     self.assertEqual("corba_cdr", 
00042          OpenRTM_aist.NVUtil.toString(properties,"dataport.interface_type"))
00043     return
00044 
00045   def test_publishInterface(self):
00046     properties = []
00047     self._opp.setInterfaceType("corba_cdr")
00048     OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
00049                  OpenRTM_aist.NVUtil.newNV("dataport.interface_type",
00050                          "corba_cdr"))
00051 
00052     OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
00053                  OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type",
00054                          "push"))
00055 
00056     OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
00057                  OpenRTM_aist.NVUtil.newNV("dataport.subscription_type",
00058                          "flush"))
00059     self.assertEqual(self._opp.publishInterface(properties),True)
00060     return
00061 
00062   def test_setPortType(self):
00063     self._opp.setPortType("out")
00064     return
00065 
00066   def test_setDataType(self):
00067     self._opp.setDataType("TimedLong")
00068     return
00069 
00070   def test_setInterfaceType(self):
00071     self._opp.setInterfaceType("corba_cdr")
00072     return
00073 
00074   def test_setDataFlowType(self):
00075     self._opp.setDataFlowType("flow")
00076     return
00077 
00078   def test_setSubscriptionType(self):
00079     self._opp.setSubscriptionType("flush")
00080 
00081   
00082 ############### test #################
00083 if __name__ == '__main__':
00084         unittest.main()


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