diff options
Diffstat (limited to 'trunk/TAO/tests/ORB_Local_Config/Simple/Test.cpp')
-rw-r--r-- | trunk/TAO/tests/ORB_Local_Config/Simple/Test.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/trunk/TAO/tests/ORB_Local_Config/Simple/Test.cpp b/trunk/TAO/tests/ORB_Local_Config/Simple/Test.cpp new file mode 100644 index 00000000000..a93e129d932 --- /dev/null +++ b/trunk/TAO/tests/ORB_Local_Config/Simple/Test.cpp @@ -0,0 +1,40 @@ +// $Id$ + +#include "tao/CORBANAME_Parser.h" +#include "tao/CORBALOC_Parser.h" +#include "tao/Protocol_Factory.h" +#include "ace/Dynamic_Service.h" + +#include "Service_Configuration_Per_ORB.h" + + +// @brief Dynamic services loading + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_Service_Gestalt_Test one; // Use the ACE_Service_Repository::instance () + + one.process_directive (ace_svc_desc_TAO_CORBANAME_Parser); + one.process_directive (ace_svc_desc_TAO_CORBALOC_Parser); + + TAO_Protocol_Factory* p1 = + ACE_Dynamic_Service<TAO_Protocol_Factory>::instance (&one, "IIOP_Factory"); + + if (p1 != 0) + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Unexpected to find IIOP_Factory\n")), -1); + + ACE_Service_Object* p2 = + ACE_Dynamic_Service<ACE_Service_Object>::instance (&one, "CORBANAME_Parser"); + + if (p2 == 0) + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to find CORBANAME_Parser\n")), -1); + + ACE_Service_Object* p3 = + ACE_Dynamic_Service<ACE_Service_Object>::instance (&one, "CORBALOC_Parser"); + + if (p3 == 0) + ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to find CORBALOC_Parser\n")), -1); + + return 0; +} |