def setUp(self):
		self._opp = OutPortProvider()
		return
Пример #2
0
 def setUp(self):
   self._opp = OutPortProvider()
   return
class TestOutPortProvider(unittest.TestCase):
	def setUp(self):
		self._opp = OutPortProvider()
		return

	def test_publishInterfaceProfile(self):
		properties = []
		self._opp.setInterfaceType("corba_cdr")
		self._opp.publishInterfaceProfile(properties)
		self.assertEqual("corba_cdr", 
				 OpenRTM_aist.NVUtil.toString(properties,"dataport.interface_type"))
		return

	def test_publishInterface(self):
		properties = []
		self._opp.setInterfaceType("corba_cdr")
		OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
						     OpenRTM_aist.NVUtil.newNV("dataport.interface_type",
									       "corba_cdr"))

		OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
						     OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type",
									       "push"))

		OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
						     OpenRTM_aist.NVUtil.newNV("dataport.subscription_type",
									       "flush"))
		self.assertEqual(self._opp.publishInterface(properties),True)
		return

	def test_setPortType(self):
		self._opp.setPortType("out")
		return

	def test_setDataType(self):
		self._opp.setDataType("TimedLong")
		return

	def test_setInterfaceType(self):
		self._opp.setInterfaceType("corba_cdr")
		return

	def test_setDataFlowType(self):
		self._opp.setDataFlowType("flow")
		return

	def test_setSubscriptionType(self):
		self._opp.setSubscriptionType("flush")
Пример #4
0
class TestOutPortProvider(unittest.TestCase):
  def setUp(self):
    self._opp = OutPortProvider()
    return

  def tearDown(self):
    OpenRTM_aist.Manager.instance().shutdownManager()
    return

  def test_publishInterfaceProfile(self):
    properties = []
    self._opp.setInterfaceType("corba_cdr")
    self._opp.publishInterfaceProfile(properties)
    self.assertEqual("corba_cdr", 
         OpenRTM_aist.NVUtil.toString(properties,"dataport.interface_type"))
    return

  def test_publishInterface(self):
    properties = []
    self._opp.setInterfaceType("corba_cdr")
    OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
                 OpenRTM_aist.NVUtil.newNV("dataport.interface_type",
                         "corba_cdr"))

    OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
                 OpenRTM_aist.NVUtil.newNV("dataport.dataflow_type",
                         "push"))

    OpenRTM_aist.CORBA_SeqUtil.push_back(properties,
                 OpenRTM_aist.NVUtil.newNV("dataport.subscription_type",
                         "flush"))
    self.assertEqual(self._opp.publishInterface(properties),True)
    return

  def test_setPortType(self):
    self._opp.setPortType("out")
    return

  def test_setDataType(self):
    self._opp.setDataType("TimedLong")
    return

  def test_setInterfaceType(self):
    self._opp.setInterfaceType("corba_cdr")
    return

  def test_setDataFlowType(self):
    self._opp.setDataFlowType("flow")
    return

  def test_setSubscriptionType(self):
    self._opp.setSubscriptionType("flush")