test_DataOutPort.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # -*- Python -*-
3 
4 #
5 # \file test_DataOutPort.py
6 # \brief test for Base class of OutPort
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 
19 import OpenRTM_aist
20 import RTC, RTC__POA
21 
22 import CORBA
23 import sys
24 sys.path.insert(1,"../")
25 
26 import unittest
27 
28 from DataOutPort import *
29 
31  def __init__(self):
32  self._orb = CORBA.ORB_init()
33  self._poa = self._orb.resolve_initial_references("RootPOA")
34  OpenRTM_aist.RTObject_impl.__init__(self, orb=self._orb, poa=self._poa)
35 
36 class TestDataOutPort(unittest.TestCase):
37  def setUp(self):
38  self._orb = CORBA.ORB_init()
39  self._poa = self._orb.resolve_initial_references("RootPOA")
40  outport = OpenRTM_aist.OutPort("out", RTC.TimedLong(RTC.Time(0,0),0),
42  self._dop = DataOutPort("out", outport, None)
43 
44 
45  def test_case(self):
46  nvlist = [OpenRTM_aist.NVUtil.newNV("dataport.interface_type","CORBA_Any"),
47  OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type","Push"),
48  OpenRTM_aist.NVUtil.newNV("dataport.subscription_type","Flush")]
49 
50  prof = RTC.ConnectorProfile("connector0","",[TestObj(),TestObj()],nvlist)
51 
52  self.assertEqual(self._dop.publishInterfaces(prof), RTC.RTC_OK)
53  self.assertEqual(self._dop.subscribeInterfaces(prof), RTC.RTC_OK)
54  self._dop.unsubscribeInterfaces(prof)
55 
56 
57 
58 
59 if __name__ == '__main__':
60  unittest.main()
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