1 // @author Phil Mesnier <mesnier_p@ociweb.com>
3 // This test scenario is documented in bugzilla bug 3049. This test
4 // creates 3 ORBs. ORB-A becomes the default ORB, which shares the
5 // global config context, ORB-B initializes a local configuration
6 // context which loads a service. ORB-C finally shares the configuration
7 // from ORB-B. The demonstration is to show that a service is avialable
8 // to ORB-C from the configuration initalized by ORB-B.
10 #include "tao/corba.h"
11 #include "tao/ORB_Core.h"
13 #include "ace/Dynamic_Service.h"
14 #include "Service_Configuration_Per_ORB.h"
16 const ACE_TCHAR argA
[] = ACE_TEXT ("AAA -ORBGestalt LOCAL -ORBId ORB-A");
17 const ACE_TCHAR argB
[] = ACE_TEXT ("BBB -ORBGestalt LOCAL -ORBId ORB-B -ORBSvcConf a.conf");
18 const ACE_TCHAR argC
[] = ACE_TEXT ("BBB -ORBGestalt ORB:ORB-B -ORBId ORB-C");
21 testBug3049 (int , ACE_TCHAR
*[])
23 ACE_TRACE ("testBug3049");
29 CORBA::ORB_var ORBA
= CORBA::ORB_init(n
,arg0
.argv());
33 CORBA::ORB_var ORBB
= CORBA::ORB_init(n
,arg1
.argv());
37 CORBA::ORB_var ORBC
= CORBA::ORB_init(n
,arg2
.argv());
39 // Confirm that ORBC has SHMIOP, which it inherits from ORBB, and
40 // that SHMIOP is not available in the global context
42 ACE_Service_Object
*so
= 0;
44 so
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance ("SHMIOP_Factory");
49 ACE_TEXT("Unexpected to find SHMIOP_Factory globally\n")));
52 so
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance
53 (ORBC
->orb_core()->configuration(), "SHMIOP_Factory");
58 ACE_TEXT("Failed to find ")
59 ACE_TEXT("SHMIOP_Factory in ORBC\n")));
71 catch(const CORBA::Exception
& ex
)
73 ex
._tao_print_exception ("Unhandled exception caught");
78 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Unexpected exception\n")), -1);
84 // @brief the main driver
87 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
89 return testBug3049(argc
, argv
);