class TestExtTrigExecutionContext(unittest.TestCase):
	def setUp(self):
		self._dfp = DFP()
		self._dfp._poa._get_the_POAManager().activate()
		self.etec = ExtTrigExecutionContext()
		#self.etec = ExtTrigExecutionContext(self._dfp._ref)

	def test_tick(self):
		pass

	def test_run(self):
		self.assertEqual(self.etec.start(),RTC.RTC_OK)
		self.assertEqual(self.etec.add_component(self._dfp._this()),RTC.RTC_OK)
		self.assertEqual(self.etec.activate_component(self._dfp._this()),RTC.RTC_OK)
		import time
		time.sleep(3)
		self.etec.tick()
		self.etec.tick()
		time.sleep(3)
 def setUp(self):
   self._dfp = DFP()
   self._dfp._poa._get_the_POAManager().activate()
   self.etec = ExtTrigExecutionContext()
class TestExtTrigExecutionContext(unittest.TestCase):
  def setUp(self):
    self._dfp = DFP()
    self._dfp._poa._get_the_POAManager().activate()
    self.etec = ExtTrigExecutionContext()
    #self.etec = ExtTrigExecutionContext(self._dfp._ref)

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

  def test_tick(self):
    pass

  def test_run(self):
    self.assertEqual(self.etec.start(),RTC.RTC_OK)
    self.assertEqual(self.etec.add_component(self._dfp._this()),RTC.RTC_OK)
    self.assertEqual(self.etec.activate_component(self._dfp._this()),RTC.RTC_OK)
    import time
    time.sleep(1)
    self.etec.tick()
    self.etec.tick()
    time.sleep(1)
    self.assertEqual(self.etec.deactivate_component(self._dfp._this()),RTC.RTC_OK)
    time.sleep(1)
    self.assertEqual(self.etec.remove_component(self._dfp._this()),RTC.RTC_OK)
    th = threading.Thread(target=self.stop)
    th.start()
    self.etec.tick()
    if th:
      th.join()
    self._dfp._poa.deactivate_object(self._dfp._poa.servant_to_id(self.etec))
    self._dfp._poa.deactivate_object(self._dfp._poa.servant_to_id(self._dfp))

  def stop(self):
    self.etec.stop()
Example #4
0
 def setUp(self):
     self._dfp = DFP()
     self._dfp._poa._get_the_POAManager().activate()
     self.etec = ExtTrigExecutionContext()
Example #5
0
class TestExtTrigExecutionContext(unittest.TestCase):
    def setUp(self):
        self._dfp = DFP()
        self._dfp._poa._get_the_POAManager().activate()
        self.etec = ExtTrigExecutionContext()
        #self.etec = ExtTrigExecutionContext(self._dfp._ref)

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

    def test_tick(self):
        pass

    def test_run(self):
        self.assertEqual(self.etec.start(), RTC.RTC_OK)
        self.assertEqual(self.etec.add_component(self._dfp._this()),
                         RTC.RTC_OK)
        self.assertEqual(self.etec.activate_component(self._dfp._this()),
                         RTC.RTC_OK)
        import time
        time.sleep(1)
        self.etec.tick()
        self.etec.tick()
        time.sleep(1)
        self.assertEqual(self.etec.deactivate_component(self._dfp._this()),
                         RTC.RTC_OK)
        time.sleep(1)
        self.assertEqual(self.etec.remove_component(self._dfp._this()),
                         RTC.RTC_OK)
        th = threading.Thread(target=self.stop)
        th.start()
        self.etec.tick()
        if th:
            th.join()
        self._dfp._poa.deactivate_object(
            self._dfp._poa.servant_to_id(self.etec))
        self._dfp._poa.deactivate_object(
            self._dfp._poa.servant_to_id(self._dfp))

    def stop(self):
        self.etec.stop()