19 sys.path.insert(1,
"../")
28 testcomp_spec = [
"implementation_id",
"TestComp",
29 "type_name",
"TestComp",
30 "description",
"Test example component",
32 "vendor",
"Shinji Kurihara, AIST",
33 "category",
"example",
34 "activity_type",
"DataFlowComponent",
37 "lang_type",
"compile",
39 "conf.default.int_param0",
"0",
40 "conf.default.int_param1",
"1",
41 "conf.default.double_param0",
"0.11",
42 "conf.default.double_param1",
"9.9",
43 "conf.default.str_param0",
"hoge",
44 "conf.default.str_param1",
"dara",
45 "conf.default.vector_param0",
"0.0,1.0,2.0,3.0,4.0",
50 OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
56 manager.registerFactory(profile,
63 com = manager.createComponent(
"TestComp")
67 manager.registerECFactory(
"Art",
70 manager.createComponent(
"TestEc")
79 self.
manager = OpenRTM_aist.Manager.init(sys.argv)
82 self.manager.shutdownManager()
104 self.assertEqual(OpenRTM_aist.Manager.instance(), self.manager)
109 self.manager.load(
"hoge",
"echo")
110 self.manager.unload(
"hoge")
111 self.manager.unloadAll()
112 self.manager.load(
"hoge",
"echo")
113 self.assertEqual(len(self.manager.getLoadedModules()), 1)
118 self.manager.activateManager()
119 self.assertEqual(self.manager.getLoadedModules(),[])
123 self.manager.activateManager()
130 self.assertEqual(self.manager.registerFactory(profile,
132 OpenRTM_aist.Delete),
137 self.manager.getFactoryProfiles()
142 self.assertEqual(self.manager.registerECFactory(
"Art",
144 OpenRTM_aist.Delete),
149 self.assertEqual(self.manager.getModulesFactories()[0],
'PeriodicECSharedComposite')
153 self.manager.activateManager()
155 self.manager.registerFactory(profile,
158 com = self.manager.createComponent(
"TestComp")
159 self.assertNotEqual(com,
None)
162 self.manager.shutdownComponents()
167 self.manager.getORB()
171 self.manager.getPOA()
175 self.manager.getPOAManager()
180 self.manager.activateManager()
182 self.manager.registerFactory(profile,
185 com = self.manager.createComponent(
"TestComp")
186 self.assertEqual(self.manager.registerComponent(com),
True)
187 self.manager.shutdownComponents()
202 ec_args =
"PeriodicExecutionContext?rate=" 203 self.manager.activateManager()
204 ec = self.manager.createContext(ec_args)
205 self.assertNotEqual(ec,
None)
207 self.manager.getPOA().deactivate_object(self.manager.getPOA().servant_to_id(ec))
227 self.manager.activateManager()
228 self.manager.createORBEndpointOption(
"",[])
242 self.manager.activateManager()
244 self.manager.registerFactory(profile,
247 com = self.manager.createComponent(
"TestComp")
248 self.assertEqual(self.manager.registerComponent(com),
True)
249 self.manager.cleanupComponent(com)
251 self.manager.shutdownComponents()
256 self.manager.activateManager()
258 self.manager.registerFactory(profile,
261 com = self.manager.createComponent(
"TestComp")
264 self.manager.shutdownComponents()
269 self.manager.initManager(sys.argv)
274 self.manager.initLogger()
285 self.assertEqual(self.manager.initNaming(),
True)
291 self.assertEqual(self.manager.initExecContext(),
True)
295 self.assertEqual(self.manager.initComposite(),
True)
300 self.assertEqual(self.manager.initFactories(),
True)
304 self.assertEqual(self.manager.initManagerServant(),
True)
312 self.assertEqual(self.manager.procComponentArgs(
"TestComp?instance_name=test&exported_ports=ConsoleIn0.out,ConsoleOut0.in",comp_id,comp_conf),
True)
313 self.assertEqual(comp_id.getProperty(
"implementation_id"),
"TestComp")
314 self.assertEqual(comp_conf.getProperty(
"instance_name"),
"test")
315 self.assertEqual(comp_conf.getProperty(
"exported_ports"),
"ConsoleIn0.out,ConsoleOut0.in")
321 self.assertEqual(self.manager.procContextArgs(
"PeriodicExecutionContext?rate=1000",ec_id,ec_conf),
True)
322 self.assertEqual(ec_id[0],
"PeriodicExecutionContext")
323 self.assertEqual(ec_conf.getProperty(
"rate"),
"1000")
327 self.manager.activateManager()
329 self.manager.registerFactory(profile,
332 com = self.manager.createComponent(
"TestComp")
334 self.manager.configureComponent(com,prop)
335 self.manager.cleanupComponent(com)
337 self.manager.shutdownComponents()
342 self.assertEqual(self.manager.formatString(
"rtc.log",profile),
"rtc.log")
343 print self.manager.formatString(
"$(PWD)",profile)
344 print self.manager.formatString(
"%n.%t.%m.%v.%V.%c.%h.%M.%p",profile)
348 self.manager.getLogbuf()
352 self.manager.getConfig()
359 if __name__ ==
'__main__':
def test_createContext(self)
def COMMENTtest_unregisterComponent(self): self.manager.activateManager() profile = OpenRTM_aist...
def test_formatString(self)
def test_initManager(self)
def test_getLoadableModules(self)
def test_initLogger(self)
def test_initFactories(self)
def test_configureComponent(self)
def test_initExecContext(self)
def test_createORBEndpointOption(self)
def test_shutdownManager(self): return
def test_registerECFactory(self)
The Properties class represents a persistent set of properties.
def test_initNaming(self)
def test_init(self)
def COMMENTtest_terminate(self): self.manager.activateManager() self.manager.runManager(True) self...
def TestCompInit(manager)
def test_getPOAManager(self)
def test_notifyFinalized(self)
def __init__(self, manager)
def test_registerFactory(self)
def MyModuleInit(manager)
def test_initManagerServant(self)
def test_cleanupComponent(self)
def test_shutdownORB(self): return
def test_procComponentArgs(self)
def test_initComposite(self)
def test_getLoadedModules(self)
def test_load_unload(self)
def test_procContextArgs(self)
def test_createComponent(self)
DataFlowComponentBase class.
def test_getFactoryProfiles(self)
def test_getModulesFactories(self)
def test_registerComponent(self)