1 // @author Jeff Mirwaisi <jeff_mirwaisi@yahoo.com>
2 // @author Iliyan Jeliazkov <iliyan2ociweb.com>
4 // the following is a simplification of the above problems (see
5 // bugzilla 1459) and the different scenarios minus the creation of
6 // the servant the service manager or threads even without the servant
7 // to demonstrate that the server is capable of responding (which in
8 // some cases it isnt) problems can already be seen in the multiple
12 #include "tao/corba.h"
14 #include "ace/Dynamic_Service.h"
15 #include "Service_Configuration_Per_ORB.h"
17 // Currently there is no way to test SSLIOP in this test due to a problem
18 // described in bug 3418.
19 //#define DO_1459_SSLIOP_TEST 1
22 const ACE_TCHAR argStrA
[] = ACE_TEXT ("AAA -ORBGestalt LOCAL -ORBId ORB-A -ORBSvcConf a.conf");
24 #if defined (DO_1459_SSLIOP_TEST)
26 const ACE_TCHAR argStrB
[] = ACE_TEXT ("BBB -ORBGestalt LOCAL -ORBId ORB-B -ORBSvcConf b.conf");
30 const ACE_TCHAR argStrC
[] = ACE_TEXT ("CCC -ORBGestalt LOCAL -ORBId ORB-C -ORBSvcConf m1.conf");
33 const ACE_TCHAR argStrD
[] = ACE_TEXT ("DDD -ORBGestalt LOCAL -ORBId ORB-D -ORBSvcConf d.conf");
36 const ACE_TCHAR argStrM
[] = ACE_TEXT ("MMM -ORBGestalt LOCAL -ORBId ORB-M -ORBSvcConf m.conf");
39 testBug1459 (int, ACE_TCHAR
*[])
41 ACE_TRACE ("testBug1459");
47 ACE_ARGV
argM (argStrM
);
50 CORBA::ORB_init (n
, argM
.argv ());
52 if (CORBA::is_nil (ORBM
.in ()))
53 ACE_ERROR_RETURN ((LM_DEBUG
,
54 ACE_TEXT("Expected to get an ORB\n")),
59 ACE_ARGV
argA (argStrA
);
62 CORBA::ORB_init (n
, argA
.argv ());
64 if (CORBA::is_nil (ORBA
.in ()))
65 ACE_ERROR_RETURN ((LM_DEBUG
,
66 ACE_TEXT("Expected to get an ORB\n")),
68 #endif /* TAO_HAS_UIOP */
70 #if defined (DO_1459_SSLIOP_TEST)
72 ACE_ARGV
argB (argStrB
);
75 CORBA::ORB_init (n
, argB
.argv ());
77 if (CORBA::is_nil (ORBB
.in ()))
78 ACE_ERROR_RETURN ((LM_DEBUG
,
79 ACE_TEXT("Expected to get an ORB\n")),
84 ACE_ARGV
argC (argStrC
);
87 CORBA::ORB_init (n
, argC
.argv ());
89 if (CORBA::is_nil (ORBC
.in ()))
90 ACE_ERROR_RETURN ((LM_DEBUG
,
91 ACE_TEXT("Expected to get an ORB\n")),
95 ACE_ARGV
argD (argStrD
);
98 CORBA::ORB_init (n
, argD
.argv ());
100 if (CORBA::is_nil (ORBD
.in ()))
101 ACE_ERROR_RETURN ((LM_DEBUG
,
102 ACE_TEXT("Expected to get an ORB\n")),
107 #if defined (DO_1459_SSLIOP_TEST)
108 ORBM
.in () == ORBB
.in () ||
109 #if TAO_HAS_UIOP == 1
110 ORBA
.in () == ORBB
.in () ||
112 ORBC
.in () == ORBB
.in () ||
113 ORBD
.in () == ORBB
.in () ||
117 ORBM
.in () == ORBA
.in () ||
118 ORBC
.in () == ORBA
.in () ||
119 ORBD
.in () == ORBA
.in () ||
122 ORBM
.in () == ORBC
.in () ||
123 ORBD
.in () == ORBC
.in () ||
125 ORBM
.in () == ORBD
.in ()
127 ACE_ERROR_RETURN ((LM_DEBUG
,
128 ACE_TEXT("Unexpected to find the two ORBs are the same\n")),
131 // Since each svc conf file causes the ORB to load the services in
132 // its own service space no services are reachable through the
133 // global service repo
135 #if TAO_HAS_UIOP == 1
137 ACE_Service_Object
*uiop_so
=
138 ACE_Dynamic_Service
<ACE_Service_Object
>::instance ("UIOP_Factory");
142 ACE_ERROR ((LM_DEBUG
,
143 ACE_TEXT("Unexpected to find ")
144 ACE_TEXT("UIOP_Factory globally\n")));
146 #endif /* TAO_HAS_UIOP */
148 #if defined (DO_1459_SSLIOP_TEST)
150 ACE_Service_Object
*ssliop_so
=
151 ACE_Dynamic_Service
<ACE_Service_Object
>::instance ("SSLIOP_Factory");
155 ACE_ERROR ((LM_DEBUG
,
156 ACE_TEXT("Unexpected to find ")
157 ACE_TEXT("SSLIOP_Factory globally\n")));
162 ACE_Service_Object
*uipmc_so
=
163 ACE_Dynamic_Service
<ACE_Service_Object
>::instance ("UIPMC_Factory");
167 ACE_ERROR ((LM_DEBUG
,
168 ACE_TEXT("Unexpected to find ")
169 ACE_TEXT("UIPMC_Factory globally\n")));
173 ACE_Service_Object
*diop_so
=
174 ACE_Dynamic_Service
<ACE_Service_Object
>::instance ("DIOP_Factory");
178 ACE_ERROR ((LM_DEBUG
,
179 ACE_TEXT("Unexpected to find ")
180 ACE_TEXT("DIOP_Factory globally\n")));
185 #if TAO_HAS_UIOP == 1
187 #endif /* TAO_HAS_UIOP */
189 #if defined (DO_1459_SSLIOP_TEST)
200 catch(const CORBA::Exception
& ex
)
202 ex
._tao_print_exception ("Unhandled exception caught");
209 // @brief the main driver
212 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
214 return testBug1459(argc
, argv
);