Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
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
00083 if __name__ == '__main__':
00084 unittest.main()