1 #include "tao/CORBANAME_Parser.h"
2 #include "tao/CORBALOC_Parser.h"
3 #include "tao/IIOP_Factory.h"
5 #include "ace/Service_Config.h"
6 #include "ace/Intrusive_Auto_Ptr.h"
7 #include "ace/Dynamic_Service.h"
9 #include "Service_Configuration_Per_ORB.h"
11 // @brief Services registered with separate repositories must remain separate
12 // and inaccesible through anyone but the one they were gegistered with
15 testSeparation (int , ACE_TCHAR
*[])
17 ACE_TRACE ("testSeparation");
19 ACE_Intrusive_Auto_Ptr
<ACE_Service_Gestalt
> one (new ACE_Service_Gestalt_Test (10));
20 one
->process_directive (ace_svc_desc_TAO_CORBANAME_Parser
);
22 ACE_Intrusive_Auto_Ptr
<ACE_Service_Gestalt
> two (new ACE_Service_Gestalt_Test (10));
23 two
->process_directive (ace_svc_desc_TAO_CORBALOC_Parser
);
25 const ACE_TCHAR
*svcname
= ACE_TEXT ("IIOP_Factory");
27 TAO_Protocol_Factory
* p10
= ACE_Dynamic_Service
<TAO_Protocol_Factory
>::instance (one
.get (), svcname
);
29 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Not expected %s locally in one\n"), svcname
), -1);
31 TAO_Protocol_Factory
* p11
= ACE_Dynamic_Service
<TAO_Protocol_Factory
>::instance (two
.get (), "IIOP_Factory");
33 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Not expected %s locally in two\n"), svcname
), -1);
35 svcname
= ACE_TEXT ("CORBANAME_Parser");
37 ACE_Service_Object
* p20
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (one
.get (), svcname
);
39 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Expected %s locally, in one\n"), svcname
), -1);
41 ACE_Service_Object
* p31
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (two
.get (), svcname
);
43 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Not expected %s locally, in two\n"), svcname
), -1);
45 svcname
= ACE_TEXT ("CORBALOC_Parser");
47 ACE_Service_Object
* p21
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (one
.get (), svcname
);
49 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Not expected %s locally, in one\n"), svcname
), -1);
51 ACE_Service_Object
* p30
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (two
.get (), svcname
);
53 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Expected %s locally, in two\n"), svcname
), -1);
59 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
61 return testSeparation (argc
, argv
);