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 InPortCorbaProvider import *
00025
00026 from omniORB import CORBA
00027 import RTC, RTC__POA
00028 import SDOPackage,SDOPackage__POA
00029 from omniORB import any
00030
00031 import OpenRTM_aist
00032
00033
00034 class TestInPortCorbaProvider(unittest.TestCase):
00035 def setUp(self):
00036 self.orb = CORBA.ORB_init()
00037 self.poa = self.orb.resolve_initial_references("RootPOA")
00038 poaManager = self.poa._get_the_POAManager()
00039 poaManager.activate()
00040
00041 ringbuf = OpenRTM_aist.RingBuffer(8)
00042 ringbuf.init(RTC.TimedLong(RTC.Time(0,0), 0))
00043 self._ipcp = InPortCorbaProvider(OpenRTM_aist.InPort("in",
00044 RTC.TimedLong(RTC.Time(0,0), 0),
00045 ringbuf))
00046
00047 def test_publishInterface(self):
00048 prop = [SDOPackage.NameValue("dataport.interface_type", "CORBA_Any")]
00049 self._ipcp.publishInterface(prop)
00050
00051
00052 def test_put(self):
00053 data = any.to_any(RTC.TimedLong(RTC.Time(0,0),123))
00054 self._ipcp.put(data)
00055
00056
00057
00058 if __name__ == '__main__':
00059 unittest.main()