19 sys.path.insert(1,
"../")
24 from omniORB
import CORBA, PortableServer
26 import OpenRTM, OpenRTM__POA
30 from ComponentObserverConsumer
import *
37 print "update_status: ", status_kind,
", ", hint
43 self.
_orb = CORBA.ORB_init()
44 self.
_poa = self.
_orb.resolve_initial_references(
"RootPOA")
45 OpenRTM_aist.RTObject_impl.__init__(self, orb=self.
_orb, poa=self.
_poa)
58 self.
_orb = CORBA.ORB_init(sys.argv)
59 self.
_poa = self.
_orb.resolve_initial_references(
"RootPOA")
60 self.
_poa._get_the_POAManager().activate()
63 mgr_ = OpenRTM_aist.Manager.instance()
64 oid_ = mgr_.getPOA().servant_to_id(servant_)
65 self.
_provider = mgr_.getPOA().id_to_reference(oid_)
70 self.
_sprof = SDOPackage.ServiceProfile(
"test_id",
"interface_type",
80 OpenRTM_aist.Manager.instance().shutdownManager()
85 self.assertEqual(self.
coc.reinit(self.
_sprof),
True)
100 self.
coc.updateStatus(OpenRTM.COMPONENT_PROFILE,
"update Component profile")
105 self.assertEqual(
"COMPONENT_PROFILE",self.
coc.
toString(OpenRTM.COMPONENT_PROFILE))
106 self.assertEqual(
"RTC_STATUS",self.
coc.
toString(OpenRTM.RTC_STATUS))
107 self.assertEqual(
"EC_STATUS",self.
coc.
toString(OpenRTM.EC_STATUS))
108 self.assertEqual(
"PORT_PROFILE",self.
coc.
toString(OpenRTM.PORT_PROFILE))
109 self.assertEqual(
"CONFIGURATION",self.
coc.
toString(OpenRTM.CONFIGURATION))
110 self.assertEqual(
"HEARTBEAT",self.
coc.
toString(OpenRTM.HEARTBEAT))
116 prop.setProperty(
"observed_status",
117 "component_profile, rtc_status, port_profile, \ 118 ec_status, port_profile , configuration")
119 self.
coc.setListeners(prop)
132 self.
coc.switchListeners(
True, [
True], 0, self.
setfunc, self. unsetfunc)
133 self.
coc.switchListeners(
True, [
False], 0, self.
setfunc, self. unsetfunc)
134 self.
coc.switchListeners(
False, [
True], 0, self.
setfunc, self. unsetfunc)
135 self.
coc.switchListeners(
False, [
False], 0, self.
setfunc, self. unsetfunc)
146 prop.setProperty(
"heartbeat.enable",
"NO")
147 prop.setProperty(
"heartbeat.interval",
"1.0")
148 self.
coc.setHeartbeat(prop)
150 prop.setProperty(
"heartbeat.enable",
"YES")
151 prop.setProperty(
"heartbeat.interval",
"0.01")
152 self.
coc.setHeartbeat(prop)
154 prop.setProperty(
"heartbeat.enable",
"YES")
155 self.
coc.setHeartbeat(prop)
160 self.
coc.unsetHeartbeat()
165 self.
coc.setComponentStatusListeners()
170 self.
coc.unsetComponentStatusListeners()
175 self.
coc.setPortProfileListeners()
180 self.
coc.unsetPortProfileListeners()
185 self.
coc.setExecutionContextListeners()
190 self.
coc.unsetExecutionContextListeners()
195 self.
coc.setConfigurationListeners()
200 self.
coc.unsetConfigurationListeners()
205 if __name__ ==
'__main__':
def test_setListeners(self)
def update_status(self, status_kind, hint)
def test_unsetHeartbeat(self)
def test_unsetConfigurationListeners(self)
The Properties class represents a persistent set of properties.
def test_setHeartbeat(self)
def test_setConfigurationListeners(self)
def test_switchListeners(self)
def test_unsetExecutionContextListeners(self)
def test_setPortProfileListeners(self)
def test_unsetPortProfileListeners(self)
def toString(nv, name=None)
Get string value in NVList specified by name.
def test_getProfile(self)
def test_setExecutionContextListeners(self)
def test_unsetComponentStatusListeners(self)
def newNV(name, value)
Create NameVale.
def test_setComponentStatusListeners(self)
def test_updateStatus(self)