test_DataInPort.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 #
5 # \file test_DataInPort.py
6 # \brief RTC::Port implementation for Data InPort
7 # \date $Date: 2007/09/27 $
8 # \author Shinji Kurihara
9 #
10 # Copyright (C) 2006
11 # Noriaki Ando
12 # Task-intelligence Research Group,
13 # Intelligent Systems Research Institute,
14 # National Institute of
15 # Advanced Industrial Science and Technology (AIST), Japan
16 # All rights reserved.
17 
18 import OpenRTM_aist
19 import RTC, RTC__POA
20 
21 import CORBA
22 import sys
23 sys.path.insert(1,"../")
24 
25 import unittest
26 
27 from DataInPort import *
28 
30  def __init__(self):
31  self._orb = CORBA.ORB_init()
32  self._poa = self._orb.resolve_initial_references("RootPOA")
33  OpenRTM_aist.RTObject_impl.__init__(self, orb=self._orb, poa=self._poa)
34 
35 
36 class TestDataInPort(unittest.TestCase):
37  def setUp(self):
38  self._orb = CORBA.ORB_init()
39  self._poa = self._orb.resolve_initial_references("RootPOA")
40  inport = OpenRTM_aist.InPort("in", RTC.TimedLong(RTC.Time(0,0),0),
42  self._dip = DataInPort("in", inport, None)
43 
44  def test_case(self):
45  nvlist = [OpenRTM_aist.NVUtil.newNV("dataport.interface_type","CORBA_Any"),
46  OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type","Push"),
47  OpenRTM_aist.NVUtil.newNV("dataport.subscription_type","Flush")]
48 
49  prof = RTC.ConnectorProfile("connector0","",[TestObj(),TestObj()],nvlist)
50 
51  self.assertEqual(self._dip.publishInterfaces(prof), RTC.RTC_OK)
52  self.assertEqual(self._dip.subscribeInterfaces(prof), RTC.RTC_OK)
53  self._dip.unsubscribeInterfaces(prof)
54 
55 
56 
57 if __name__ == '__main__':
58  unittest.main()
InPort template class.
Definition: InPort.py:58
def newNV(name, value)
Create NameVale.
Definition: NVUtil.py:50


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