2 #include "tao/ORB_Core.h"
3 #include "tao/Client_Strategy_Factory.h"
4 #include "ace/Get_Opt.h"
5 #include "ace/Log_Msg.h"
6 #include "ace/OS_NS_stdio.h"
10 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
14 int second_extra_argc
= 3;
16 int second_largc
= argc
;
20 ACE_TCHAR
**extra
= 0;
21 ACE_TCHAR
**second_extra
= 0;
22 ACE_NEW_RETURN (extra
, ACE_TCHAR
*[extra_argc
], -1);
23 ACE_NEW_RETURN (second_extra
, ACE_TCHAR
*[second_extra_argc
], -1);
24 extra
[0] = ACE::strnew (ACE_TEXT ("-ORBGestalt"));
25 extra
[1] = ACE::strnew (ACE_TEXT ("Local"));
26 extra
[2] = ACE::strnew (ACE_TEXT ("-ORBSvcConfDirective"));
27 extra
[3] = ACE::strnew (ACE_TEXT ("static Client_Strategy_Factory '-ORBReplyDispatcherTableSize 333'"));
29 second_extra
[0] = ACE::strnew (ACE_TEXT ("-ORBGestalt"));
30 second_extra
[1] = ACE::strnew (ACE_TEXT ("Local"));
31 second_extra
[2] = ACE::strnew (ACE_TEXT ("-ORBSvcConfDirective \"static Client_Strategy_Factory '-ORBReplyDispatcherTableSize 666'\""));
33 ACE_TCHAR
**largv
= new ACE_TCHAR
*[largc
+extra_argc
];
34 for (int i
= 0; i
< largc
; i
++)
37 ACE_TCHAR
**second_largv
= new ACE_TCHAR
*[second_largc
+second_extra_argc
];
38 for (int i
= 0; i
< second_largc
; i
++)
39 second_largv
[i
] = argv
[i
];
41 for (int i
= 0; i
< extra_argc
; i
++)
43 largv
[argc
+i
] = extra
[i
];
45 for (int i
= 0; i
< second_extra_argc
; i
++)
47 second_largv
[argc
+i
] = second_extra
[i
];
51 second_largc
+= second_extra_argc
;
53 CORBA::ORB_var orb
= CORBA::ORB_init (largc
, largv
, "FirstORB");
55 if (orb
->orb_core()->client_factory()->reply_dispatcher_table_size () != 333)
61 orb
= CORBA::ORB::_nil ();
63 CORBA::ORB_var second_orb
= CORBA::ORB_init (second_largc
, second_largv
, "SecondORB");
65 if (second_orb
->orb_core()->client_factory()->reply_dispatcher_table_size () != 666)
70 second_orb
->destroy ();
71 second_orb
= CORBA::ORB::_nil ();
73 for (int i
= 0; i
< extra_argc
; i
++)
74 ACE::strdelete (extra
[i
]);
75 for (int i2
= 0; i2
< second_extra_argc
; i2
++)
76 ACE::strdelete (second_extra
[i2
]);
79 delete [] second_extra
;
80 delete [] second_largv
;
82 catch (const CORBA::Exception
& ex
)
84 ex
._tao_print_exception ("Exception caught:");
89 ACE_TEXT ("Test passed!")));
92 ACE_TEXT ("Test failed. Result: %d\n"),