def test_pushNew(self): _pn = PublisherNew() prop = OpenRTM_aist.Properties() cinfo = OpenRTM_aist.ConnectorInfo("", "", [], prop) self.assertEqual(_pn.setListener(cinfo,OpenRTM_aist.ConnectorListeners()), OpenRTM_aist.DataPortStatus.PORT_OK) prop = OpenRTM_aist.Properties() prop.setProperty("publisher.push_policy","new") prop.setProperty("publisher.skip_count","0") prop.setProperty("thread_type","default") prop.setProperty("measurement.exec_time","enable") prop.setProperty("measurement.exec_count","0") prop.setProperty("measurement.period_time","enable") prop.setProperty("measurement.period_count","0") retcode = _pn.init(prop) cons = ConsumerMock() self.assertEqual(_pn.setConsumer(cons),OpenRTM_aist.DataPortStatus.PORT_OK) _pn.setBuffer(OpenRTM_aist.CdrRingBuffer()) _pn.activate() self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) _pn.deactivate() _pn.__del__() return
def test_write(self): _pn = PublisherNew() prop = OpenRTM_aist.Properties() retcode = _pn.init(prop) _pn.setBuffer(OpenRTM_aist.RingBuffer()) #self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) return
def test_write(self): _pn = PublisherNew() prop = OpenRTM_aist.Properties() retcode = _pn.init(prop) _pn.setBuffer(OpenRTM_aist.RingBuffer()) #self.assertEqual(_pn.write(123,0,0),OpenRTM_aist.DataPortStatus.PORT_OK) _pn.__del__() return
def test_setBuffer(self): _pn = PublisherNew() self.assertEqual(_pn.setBuffer(None),OpenRTM_aist.DataPortStatus.INVALID_ARGS) self.assertEqual(_pn.setBuffer(OpenRTM_aist.RingBuffer()),OpenRTM_aist.DataPortStatus.PORT_OK) _pn.__del__() return