PortServiceProxyTests.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
12 /*
13  * $Log$
14  *
15  */
16 
17 #ifndef PortServiceProxy_cpp
18 #define PortServiceProxy_cpp
19 
20 #include <cppunit/ui/text/TestRunner.h>
21 #include <cppunit/TextOutputter.h>
22 #include <cppunit/extensions/TestFactoryRegistry.h>
23 #include <cppunit/extensions/HelperMacros.h>
24 #include <cppunit/TestAssert.h>
25 #include <string>
26 #include <sstream>
27 #include <iostream>
28 #include <idl/RTCSkel.h>
29 #include <PortServiceProxy.h>
30 #include <PortServiceServant.h>
31 #include <IPortService.h>
33 
39 {
45  class Logger
46  {
47  public:
48  void log(const std::string& msg)
49  {
50  m_log.push_back(msg);
51  }
52 
53  int countLog(const std::string& msg)
54  {
55  int count = 0;
56  for (int i = 0; i < (int) m_log.size(); ++i)
57  {
58  if (m_log[i] == msg) ++count;
59  }
60  return count;
61  }
62 
63  private:
64  std::vector<std::string> m_log;
65  };
66 
73  : public virtual ::POA_RTC::PortService,
74  public virtual ::doil::CORBA::CORBAServantBase
75  {
76  public:
78  : ::doil::CORBA::CORBAServantBase(impl), m_impl(NULL)
79  {
80  m_impl = dynamic_cast< ::RTC::Local::IPortService* >(impl);
81  }
83 
84  virtual ::RTC::PortProfile* get_port_profile()
85  {
86  ::RTC::PortProfile* corba_ret = new ::RTC::PortProfile ();
87  return corba_ret;
88  }
90  {
91  ::RTC::ConnectorProfileList* corba_ret
93  return corba_ret;
94  }
95  virtual ::RTC::ConnectorProfile* get_connector_profile(
96  const char* connector_id)
97  {
98  ::RTC::ConnectorProfile* corba_ret = new ::RTC::ConnectorProfile ();
99  return corba_ret;
100  }
102  ::RTC::ConnectorProfile& connector_profile)
103  {
105  }
106  virtual ::RTC::ReturnCode_t disconnect(const char* connector_id)
107  {
109  }
111  {
113  }
115  ::RTC::ConnectorProfile& connector_profile)
116  {
118  }
120  {
122  }
123 
124  private:
126  };
133  : public virtual ::RTC::Local::IPortService
134  {
135  public:
137  : m_refcount(0)
138  {}
139  virtual ~IPortServiceMock(){}
140  const char* id() {return "IPortServiceMock";}
141  const char* name() {return "IPortServiceMock";}
142  void incRef()
143  {
144  ++m_refcount;
145  }
146  void decRef()
147  {
148  --m_refcount;
149  if (m_refcount == 0)
150  delete this;
151  }
152  virtual ::RTC::Local::PortProfile get_port_profile()
153  throw ()
154  {
155  ::RTC::Local::PortProfile corba_ret;
156  return corba_ret;
157  }
159  throw ()
160  {
162  return corba_ret;
163  }
164  virtual ::RTC::Local::ConnectorProfile get_connector_profile(
165  const ::std::string& connector_id)
166  throw ()
167  {
169  return corba_ret;
170  }
171 
172 
174  ::RTC::Local::ConnectorProfile& connector_profile)
175  throw ()
176  {
178  }
179 
181  const ::std::string& connector_id)
182  throw ()
183  {
185  }
186 
188  throw ()
189  {
191  }
192 
194  ::RTC::Local::ConnectorProfile& connector_profile)
195  throw ()
196  {
198  }
199 
201  const ::std::string& connector_id)
202  throw()
203  {
205  }
206 
207  private:
208  std::string m_name;
210  };
217  : public virtual ::POA_RTC::PortService {
218  protected:
219  std::vector<std::string> m_log;
220  ::RTC::PortProfile m_profile;
221  public :
224 
226  {
227  m_logger = logger;
228  }
232  ::RTC::PortProfile* get_port_profile()
233  throw (CORBA::SystemException)
234  {
235  if (m_logger != NULL)
236  {
237  m_logger->log("get_port_profile");
238  }
239  ::RTC::PortProfile_var prof;
240  m_profile.name = "name of port";
241  m_profile.interfaces.length(1);
242  m_profile.interfaces[0].instance_name = "MyService (provided)";
243  m_profile.interfaces[0].type_name = "Generic (provided)";
244  m_profile.interfaces[0].polarity = ::RTC::PROVIDED;
245  prof = new ::RTC::PortProfile(m_profile);
246  return prof._retn();
247  }
252  throw (CORBA::SystemException)
253  {
254  if (m_logger != NULL)
255  {
256  m_logger->log("get_connector_profiles");
257  }
258  m_profile.connector_profiles.length(1);
259  m_profile.connector_profiles[0].name = "ConnectorProfile-name";
260  m_profile.connector_profiles[0].connector_id = "connect_id0";
261  m_profile.connector_profiles[0].properties.length(1);
262  m_profile.connector_profiles[0].properties[0].name
263  = "ConnectorProfile-properties0-name";
264  m_profile.connector_profiles[0].properties[0].value
265  <<= (::CORBA::Float)1.1;
266  m_profile.connector_profiles[0].ports.length(1);
267 // PortServiceRtmMock* obj = new PortServiceRtmMock();
268 // m_profile.connector_profiles[0].ports[0] = obj->_this();
269 
270  ::RTC::ConnectorProfileList_var conn_prof;
271  conn_prof
272  = new ::RTC::ConnectorProfileList(m_profile.connector_profiles);
273  return conn_prof._retn();
274  }
278  ::RTC::ConnectorProfile* get_connector_profile(const char* connector_id)
279  throw (CORBA::SystemException)
280  {
281  if (m_logger != NULL)
282  {
283  m_logger->log("get_connector_profile");
284  m_logger->log(connector_id);
285  }
286  m_profile.connector_profiles.length(1);
287  m_profile.connector_profiles[0].name = "ConnectorProfile-name";
288  m_profile.connector_profiles[0].connector_id = "connect_id0";
289  m_profile.connector_profiles[0].properties.length(1);
290  m_profile.connector_profiles[0].properties[0].name
291  = "ConnectorProfile-properties0-name";
292  m_profile.connector_profiles[0].properties[0].value
293  <<= (::CORBA::Float)1.1;
294  m_profile.connector_profiles[0].ports.length(1);
295  ::RTC::ConnectorProfile_var conn_prof;
296 // PortServiceRtmMock* obj = new PortServiceRtmMock();
297 // m_profile.connector_profiles[0].ports[0] = obj->_this();
298  conn_prof = new ::RTC::ConnectorProfile(
299  m_profile.connector_profiles[0]);
300  return conn_prof._retn();
301  }
305  ::RTC::ReturnCode_t connect(::RTC::ConnectorProfile& connector_profile)
306  throw (CORBA::SystemException)
307  {
308  if (m_logger != NULL)
309  {
310 
311  m_logger->log("connect");
312  m_logger->log(::std::string(connector_profile.name));
313  m_logger->log(::std::string(connector_profile.connector_id));
314  m_logger->log(
315  ::std::string(connector_profile.properties[0].name));
316  const char* ch;
317  ::CORBA::ULong ul = 3;
318  ::CORBA::Any::to_string to_str(ch, ul);
319  connector_profile.properties[0].value >>= to_str;
320  m_logger->log(to_str.val);
321  }
322  connector_profile.name = "ConnectorProfile-name";
323  connector_profile.connector_id = "connect_id0";
324  connector_profile.properties.length(1);
325  connector_profile.properties[0].name
326  = "ConnectorProfile-properties0-name";
327  connector_profile.properties[0].value
328  <<= (::CORBA::Float)1.1;
329  connector_profile.ports.length(1);
330 // PortServiceRtmMock* obj = new PortServiceRtmMock();
331 // m_profile.connector_profiles[0].ports[0] = obj->_this();
332  return RTC::RTC_OK;
333  }
337  ::RTC::ReturnCode_t notify_connect(::RTC::ConnectorProfile& connector_profile)
338  throw (CORBA::SystemException)
339  {
340  if (m_logger != NULL)
341  {
342  m_logger->log("notify_connect");
343  m_logger->log(::std::string(connector_profile.name));
344  m_logger->log(::std::string(connector_profile.connector_id));
345  m_logger->log(
346  ::std::string(connector_profile.properties[0].name));
347  const char* ch;
348  ::CORBA::ULong ul = 3;
349  ::CORBA::Any::to_string to_str(ch, ul);
350  connector_profile.properties[0].value >>= to_str;
351  m_logger->log(to_str.val);
352  }
353  connector_profile.name = "ConnectorProfile-name";
354  connector_profile.connector_id = "connect_id0";
355  connector_profile.properties.length(1);
356  connector_profile.properties[0].name
357  = "ConnectorProfile-properties0-name";
358  connector_profile.properties[0].value
359  <<= (::CORBA::Float)1.1;
360  connector_profile.ports.length(1);
361 // PortServiceRtmMock* obj = new PortServiceRtmMock();
362 // m_profile.connector_profiles[0].ports[0] = obj->_this();
363  return RTC::RTC_OK;
364  }
368  ::RTC::ReturnCode_t disconnect(const char* connector_id)
369  throw (CORBA::SystemException)
370  {
371  if (m_logger != NULL)
372  {
373  m_logger->log("disconnect");
374  m_logger->log(connector_id);
375  }
376  return RTC::RTC_OK;
377  }
381  ::RTC::ReturnCode_t notify_disconnect(const char* connector_id)
382  throw (CORBA::SystemException)
383  {
384  if (m_logger != NULL)
385  {
386  m_logger->log("notify_disconnect");
387  m_logger->log(connector_id);
388  }
389  return RTC::RTC_OK;
390  }
395  throw (CORBA::SystemException)
396  {
397  if (m_logger != NULL)
398  {
399  m_logger->log("disconnect_all");
400  }
401  return RTC::RTC_OK;
402  }
403 
404  private:
406 
407  };
408 
410  : public CppUnit::TestFixture
411  {
412  CPPUNIT_TEST_SUITE(PortServiceProxyTests);
413  CPPUNIT_TEST(test_get_port_profile);
414  CPPUNIT_TEST(test_get_connector_profiles);
415  CPPUNIT_TEST(test_get_connector_profile);
416  CPPUNIT_TEST(test_connect);
417  CPPUNIT_TEST(test_disconnect);
418  CPPUNIT_TEST(test_disconnect_all);
419  CPPUNIT_TEST(test_notify_connect);
420  CPPUNIT_TEST(test_notify_disconnect);
421  CPPUNIT_TEST_SUITE_END();
422 
423  private:
424  CORBA::ORB_ptr m_pORB;
425  PortableServer::POA_ptr m_pPOA;
426 
427  public:
428 
433  {
434  int argc = 0;
435  char** argv = NULL;
436  m_pORB = CORBA::ORB_init(argc, argv);
437  m_pPOA = PortableServer::POA::_narrow(
438  m_pORB->resolve_initial_references("RootPOA"));
439  m_pPOA->the_POAManager()->activate();
440  }
441 
446  {
447  }
448 
452  virtual void setUp()
453  {
454  }
455 
459  virtual void tearDown()
460  {
461  }
462 
469  {
471  ::CORBA::Object_ptr ref = obj->_this();
472  if(::CORBA::is_nil(ref))
473  {
474  std::cout<<"ref is nil.Abort test."<<std::endl;
475  return;
476  }
477  ::RTC::CORBA::PortServiceProxy* ap
478  = new ::RTC::CORBA::PortServiceProxy(ref);
479 
480  Logger logger;
481  obj->setLogger(&logger);
482 
483  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("get_port_profile"));
485  prof = ap->get_port_profile();
486  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("get_port_profile"));
487  CPPUNIT_ASSERT_EQUAL(::std::string("name of port"),
488  prof.name);
489  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
490  prof.interfaces.size());
491  CPPUNIT_ASSERT_EQUAL(::std::string("MyService (provided)"),
492  prof.interfaces[0].instance_name);
493  CPPUNIT_ASSERT_EQUAL(::RTC::Local::PROVIDED,
494  prof.interfaces[0].polarity);
495 
496  delete ap;
497  CORBA::release(ref);
498 
499 
500  }
507  {
509  ::CORBA::Object_ptr ref = obj->_this();
510  if(::CORBA::is_nil(ref))
511  {
512  std::cout<<"ref is nil.Abort test."<<std::endl;
513  return;
514  }
515  ::RTC::CORBA::PortServiceProxy* ap
516  = new ::RTC::CORBA::PortServiceProxy(ref);
517 
518  Logger logger;
519  obj->setLogger(&logger);
520 
521  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("get_connector_profiles"));
523  proflist = ap->get_connector_profiles();
524  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("get_connector_profiles"));
525 
526  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
527  proflist.size());
528 
529  CPPUNIT_ASSERT_EQUAL(::std::string("ConnectorProfile-name"),
530  proflist[0].name);
531 
532  CPPUNIT_ASSERT_EQUAL(::std::string("connect_id0"),
533  proflist[0].connector_id);
534 
535 ::std::cout<<proflist[0].properties.size()<<::std::endl;
536  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
537  proflist[0].properties.size());
538  CPPUNIT_ASSERT_EQUAL(::std::string(
539  "ConnectorProfile-properties0-name"),
540  proflist[0].properties[0].name);
541  CPPUNIT_ASSERT_EQUAL(::std::string("1.1"),
542  proflist[0].properties[0].value);
543  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
544  proflist[0].ports.size());
545 
546  delete ap;
547  CORBA::release(ref);
548 
549 
550  }
557  {
559  ::CORBA::Object_ptr ref = obj->_this();
560  if(::CORBA::is_nil(ref))
561  {
562  std::cout<<"ref is nil.Abort test."<<std::endl;
563  return;
564  }
565  ::RTC::CORBA::PortServiceProxy* ap
566  = new ::RTC::CORBA::PortServiceProxy(ref);
567 
568  Logger logger;
569  obj->setLogger(&logger);
570 
571  ::std::string str = "test_get_connector_profile";
572  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("get_connector_profile"));
573  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str));
575  prof = ap->get_connector_profile(str);
576  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("get_connector_profile"));
577  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str));
578 
579  CPPUNIT_ASSERT_EQUAL(::std::string("ConnectorProfile-name"),
580  prof.name);
581 
582  CPPUNIT_ASSERT_EQUAL(::std::string("connect_id0"),
583  prof.connector_id);
584 
585  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
586  prof.properties.size());
587  CPPUNIT_ASSERT_EQUAL(::std::string(
588  "ConnectorProfile-properties0-name"),
589  prof.properties[0].name);
590  CPPUNIT_ASSERT_EQUAL(::std::string("1.1"),
591  prof.properties[0].value);
592  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
593  prof.ports.size());
594 
595 
596  delete ap;
597  CORBA::release(ref);
598 
599 
600  }
607  {
610  std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
611 
613  ::CORBA::Object_ptr ref = obj->_this();
614  if(::CORBA::is_nil(ref))
615  {
616  std::cout<<"ref is nil.Abort test."<<std::endl;
617  return;
618  }
619  ::RTC::CORBA::PortServiceProxy* ap
620  = new ::RTC::CORBA::PortServiceProxy(ref);
621 
622  Logger logger;
623  obj->setLogger(&logger);
624 
626  ::std::string str1 = "in_ConnectorProfile-name";
627  ::std::string str2 = "in_connect_id0";
628  ::std::string str3 = "in_ConnectorProfile-properties0-name";
629  ::std::string str4 = "2.2";
630  prof.name = str1;
631  prof.connector_id = str2;
632  ::SDOPackage::Local::NameValue nv;
633  nv.name = str3;
634  nv.value = str4;
635  prof.properties.push_back(nv);
636  IPortServiceMock portservice;
637 
638  mgr.registerFactory(portservice.id(),
639  doil::New<PortServiceServantMock>,
640  doil::Delete<PortServiceServantMock>);
641  mgr.activateObject(&portservice);
642  prof.ports.push_back(&portservice);
643 
644 
645  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("connect"));
646  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str1));
647  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str2));
648  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str3));
649  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str4));
651  ret = ap->connect(prof);
652  mgr.deactivateObject(&portservice);
653  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("connect"));
654  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str1));
655  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str2));
656  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str3));
657  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str4));
658  CPPUNIT_ASSERT_EQUAL(::RTC::Local::RTC_OK, ret);
659  CPPUNIT_ASSERT_EQUAL(::std::string("ConnectorProfile-name"),
660  prof.name);
661 
662  CPPUNIT_ASSERT_EQUAL(::std::string("connect_id0"),
663  prof.connector_id);
664 
665  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
666  prof.properties.size());
667  CPPUNIT_ASSERT_EQUAL(::std::string(
668  "ConnectorProfile-properties0-name"),
669  prof.properties[0].name);
670  CPPUNIT_ASSERT_EQUAL(::std::string("1.1"),
671  prof.properties[0].value);
672  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
673  prof.ports.size());
674 
675 
676  delete ap;
677  CORBA::release(ref);
678 
679 
680  }
687  {
689  ::CORBA::Object_ptr ref = obj->_this();
690  if(::CORBA::is_nil(ref))
691  {
692  std::cout<<"ref is nil.Abort test."<<std::endl;
693  return;
694  }
695  ::RTC::CORBA::PortServiceProxy* ap
696  = new ::RTC::CORBA::PortServiceProxy(ref);
697 
698  Logger logger;
699  obj->setLogger(&logger);
700 
701  ::std::string str = "test_disconnect";
702  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("disconnect"));
703  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str));
705  ret = ap->disconnect(str);
706  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("disconnect"));
707  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str));
708  CPPUNIT_ASSERT_EQUAL(::RTC::Local::RTC_OK, ret);
709 
710  delete ap;
711  CORBA::release(ref);
712 
713 
714  }
721  {
723  ::CORBA::Object_ptr ref = obj->_this();
724  if(::CORBA::is_nil(ref))
725  {
726  std::cout<<"ref is nil.Abort test."<<std::endl;
727  return;
728  }
729  ::RTC::CORBA::PortServiceProxy* ap
730  = new ::RTC::CORBA::PortServiceProxy(ref);
731 
732  Logger logger;
733  obj->setLogger(&logger);
734 
735  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("disconnect_all"));
737  ret = ap->disconnect_all();
738  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("disconnect_all"));
739  CPPUNIT_ASSERT_EQUAL(::RTC::Local::RTC_OK, ret);
740 
741 
742  delete ap;
743  CORBA::release(ref);
744 
745 
746  }
753  {
756  std::cout <<"Manager Name==>"<< mgr.name() << std::endl;
758  ::CORBA::Object_ptr ref = obj->_this();
759  if(::CORBA::is_nil(ref))
760  {
761  std::cout<<"ref is nil.Abort test."<<std::endl;
762  return;
763  }
764  ::RTC::CORBA::PortServiceProxy* ap
765  = new ::RTC::CORBA::PortServiceProxy(ref);
766 
767  Logger logger;
768  obj->setLogger(&logger);
769 
771  ::std::string str1 = "in_ConnectorProfile-name";
772  ::std::string str2 = "in_connect_id0";
773  ::std::string str3 = "in_ConnectorProfile-properties0-name";
774  ::std::string str4 = "2.2";
775  prof.name = str1;
776  prof.connector_id = str2;
777  ::SDOPackage::Local::NameValue nv;
778  nv.name = str3;
779  nv.value = str4;
780  prof.properties.push_back(nv);
781  IPortServiceMock portservice;
782 
783  mgr.registerFactory(portservice.id(),
784  doil::New<PortServiceServantMock>,
785  doil::Delete<PortServiceServantMock>);
786  mgr.activateObject(&portservice);
787  prof.ports.push_back(&portservice);
788  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("notify_connect"));
789  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str1));
790  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str2));
791  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str3));
792  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str4));
794  ret = ap->notify_connect(prof);
795  mgr.deactivateObject(&portservice);
796  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("notify_connect"));
797  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str1));
798  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str2));
799  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str3));
800  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str4));
801  CPPUNIT_ASSERT_EQUAL(::RTC::Local::RTC_OK, ret);
802  CPPUNIT_ASSERT_EQUAL(::std::string("ConnectorProfile-name"),
803  prof.name);
804 
805  CPPUNIT_ASSERT_EQUAL(::std::string("connect_id0"),
806  prof.connector_id);
807 
808  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
809  prof.properties.size());
810  CPPUNIT_ASSERT_EQUAL(::std::string(
811  "ConnectorProfile-properties0-name"),
812  prof.properties[0].name);
813  CPPUNIT_ASSERT_EQUAL(::std::string("1.1"),
814  prof.properties[0].value);
815  CPPUNIT_ASSERT_EQUAL((::std::string::size_type)1,
816  prof.ports.size());
817 
818 
819 
820 
821  delete ap;
822  CORBA::release(ref);
823 
824 
825  }
832  {
834  ::CORBA::Object_ptr ref = obj->_this();
835  if(::CORBA::is_nil(ref))
836  {
837  std::cout<<"ref is nil.Abort test."<<std::endl;
838  return;
839  }
840  ::RTC::CORBA::PortServiceProxy* ap
841  = new ::RTC::CORBA::PortServiceProxy(ref);
842 
843  Logger logger;
844  obj->setLogger(&logger);
845 
846  ::std::string str = "test_notify_disconnect";
847  CPPUNIT_ASSERT_EQUAL(0, logger.countLog("notify_disconnect"));
848  CPPUNIT_ASSERT_EQUAL(0, logger.countLog(str));
850  ret = ap->notify_disconnect(str);
851  CPPUNIT_ASSERT_EQUAL(1, logger.countLog("notify_disconnect"));
852  CPPUNIT_ASSERT_EQUAL(1, logger.countLog(str));
853  CPPUNIT_ASSERT_EQUAL(::RTC::Local::RTC_OK, ret);
854 
855 
856 
857  delete ap;
858  CORBA::release(ref);
859 
860 
861  }
862  /* test case */
863  void test_case0()
864  {
865  }
866  };
867 }; // namespace PortServiceProxy
868 
869 /*
870  * Register test suite
871  */
873 
874 #ifdef LOCAL_MAIN
875 int main(int argc, char* argv[])
876 {
877  CppUnit::TextUi::TestRunner runner;
878  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
879  CppUnit::Outputter* outputter =
880  new CppUnit::TextOutputter(&runner.result(), std::cout);
881  runner.setOutputter(outputter);
882  bool retcode = runner.run();
883  return !retcode;
884 }
885 #endif // MAIN
886 #endif // PortServiceProxy_cpp
int countLog(const std::string &msg)
virtual ::RTC::Local::ReturnCode_t disconnect(const ::std::string &connector_id)
int main(int argc, char **argv)
virtual const char * name()
Getting ORB&#39;s name.
virtual ::RTC::ReturnCode_t disconnect(const char *connector_id)
virtual ::RTC::ReturnCode_t notify_disconnect(const char *connector_id)
::RTC::ReturnCode_t notify_disconnect(const char *connector_id)
IPortService interface class.
virtual ::RTC::Local::ReturnCode_t connect(::RTC::Local::ConnectorProfile &connector_profile)
virtual ReturnCode_t registerFactory(const char *id, doil::ServantNewFunc new_func, doil::ServantDeleteFunc delete_func)
Register servant&#39;s factory.
ReturnCode_t
Definition: doil.h:53
virtual ::RTC::ConnectorProfile * get_connector_profile(const char *connector_id)
::RTC::ReturnCode_t disconnect(const char *connector_id)
static CORBAManager & instance()
getting instance
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
virtual void setUp()
Test initialization.
UniqueIdentifier connector_id
Definition: IPortService.h:45
virtual ::RTC::ReturnCode_t connect(::RTC::ConnectorProfile &connector_profile)
virtual ::RTC::PortProfile * get_port_profile()
virtual ::RTC::Local::ReturnCode_t disconnect_all()
IPortService itnerface class.
Definition: IPortService.h:74
virtual ::RTC::Local::PortProfile get_port_profile()
std::vector< ConnectorProfile * > ConnectorProfileList
Definition: IPortService.h:50
virtual ::RTC::ConnectorProfileList * get_connector_profiles()
CORBA manager for doil.
virtual ::RTC::Local::ConnectorProfileList get_connector_profiles()
CPPUNIT_TEST_SUITE_REGISTRATION(PortServiceProxy::PortServiceProxyTests)
ReturnCode_t
Definition: IRTC.h:30
::RTC::ConnectorProfile * get_connector_profile(const char *connector_id)
::RTC::ConnectorProfileList * get_connector_profiles()
::OutPortBase::Logger logger
virtual ::RTC::Local::ReturnCode_t notify_disconnect(const ::std::string &connector_id)
virtual ReturnCode_t deactivateObject(doil::ImplBase *impl)
Deactivate object.
std::vector< std::string > m_log
void log(const std::string &msg)
::RTC::ReturnCode_t notify_connect(::RTC::ConnectorProfile &connector_profile)
virtual ::RTC::ReturnCode_t notify_connect(::RTC::ConnectorProfile &connector_profile)
virtual ReturnCode_t activateObject(doil::ImplBase *impl)
Activate object.
::RTC::ReturnCode_t connect(::RTC::ConnectorProfile &connector_profile)
virtual void tearDown()
Test finalization.
virtual ::RTC::Local::ReturnCode_t notify_connect(::RTC::Local::ConnectorProfile &connector_profile)
virtual ::RTC::Local::ConnectorProfile get_connector_profile(const ::std::string &connector_id)


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:44