summaryrefslogtreecommitdiff
path: root/TAO/tests/ORB_Local_Config
diff options
context:
space:
mode:
authorvzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-10-15 11:09:34 +0000
committervzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-10-15 11:09:34 +0000
commit5cb85f20a47da8254f2918f76cdf179d2b10ba4c (patch)
tree2ab1fea05b85064291163fa5f73ce866a193ea69 /TAO/tests/ORB_Local_Config
parentf33eac389a70fa98df491843bcf68f630f0c2bb0 (diff)
downloadATCD-5cb85f20a47da8254f2918f76cdf179d2b10ba4c.tar.gz
ChangeLogTag: Wed Oct 15 10:29:36 UTC 2008 Vladimir Zykov <vzykov@prismtech.com>
Diffstat (limited to 'TAO/tests/ORB_Local_Config')
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_1459/Test.cpp297
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_1459/d.conf2
2 files changed, 174 insertions, 125 deletions
diff --git a/TAO/tests/ORB_Local_Config/Bug_1459/Test.cpp b/TAO/tests/ORB_Local_Config/Bug_1459/Test.cpp
index 01e654fb0cf..7cbd4bf1b07 100644
--- a/TAO/tests/ORB_Local_Config/Bug_1459/Test.cpp
+++ b/TAO/tests/ORB_Local_Config/Bug_1459/Test.cpp
@@ -6,39 +6,35 @@
// bugzilla 1459) and the different scenarios minus the creation of
// the servant the service manager or threads even without the servant
// to demonstrate that the server is capable of responding (which in
-// some cases it isnt) problems can allready be seen in the multiple
-// orb scenarios AB b isnt prompted for a new certificate password, MA
-// ssliop isnt loaded at all etc
+// some cases it isnt) problems can already be seen in the multiple
+// orb scenarios
#include "tao/corba.h"
#include "ace/ARGV.h"
#include "ace/Dynamic_Service.h"
-
-/// The combination of orb instances and their configurations to test
-#define MORB_MA
+#include "Service_Configuration_Per_ORB.h"
ACE_RCSID (tests, server, "$Id$")
+// Currently there is no way to test SSLIOP in this test due to a problem
+// described in bug 3418.
+//#define DO_1459_SSLIOP_TEST 1
-#include "Service_Configuration_Per_ORB.h"
-
-const char argA[] = "AAA -ORBGestalt LOCAL -ORBId ORB-A -ORBSvcConf a.conf";
-
-// dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:server_key.pem -SSLCertificate PEM:server_cert.pem";
-// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+// UIOP
+const char argStrA[] = "AAA -ORBGestalt LOCAL -ORBId ORB-A -ORBSvcConf a.conf";
-const char argB[] = "BBB -ORBGestalt LOCAL -ORBId ORB-A -ORBSvcConf b.conf";
+// SSLIOP
+const char argStrB[] = "BBB -ORBGestalt LOCAL -ORBId ORB-B -ORBSvcConf b.conf";
-// dynamic SSLIOP_Factory Service_Object * TAO_SSLIOP:_make_TAO_SSLIOP_Protocol_Factory() "-SSLAuthenticate SERVER_AND_CLIENT -SSLPrivateKey PEM:client_key.pem -SSLCertificate PEM:client_cert.pem"
-// static Resource_Factory "-ORBProtocolFactory SSLIOP_Factory"
+// UIPMC
+const char argStrC[] = "CCC -ORBGestalt LOCAL -ORBId ORB-C -ORBSvcConf m1.conf";
-const char argM[] = "MMM -ORBGestalt LOCAL -ORBId ORB-M -ORBSvcConf m.conf";
+// DIOP
+const char argStrD[] = "DDD -ORBGestalt LOCAL -ORBId ORB-D -ORBSvcConf d.conf";
-// dynamic UIPMC_Factory Service_Object * TAO_PortableGroup:_make_TAO_UIPMC_Protocol_Factory() ""
-// static Resource_Factory "-ORBProtocolFactory IIOP_Factory -ORBProtocolFactory UIPMC_Factory"
-// #static PortableGroup_Loader ""
-// dynamic PortableGroup_Loader Service_Object * TAO_PortableGroup:_make_TAO_PortableGroup_Loader() ""
+// empty file
+const char argStrM[] = "MMM -ORBGestalt LOCAL -ORBId ORB-M -ORBSvcConf m.conf";
int
testBug1459 (int , ACE_TCHAR *[])
@@ -46,116 +42,167 @@ testBug1459 (int , ACE_TCHAR *[])
ACE_TRACE ("testBug1459");
try
- {
-
-#ifdef MORB_AB
- ACE_ARGV arg0(argA);
- int n = arg0.argc();
- CORBA::ORB_var ORBA = CORBA::ORB_init(n,arg0.argv());
-
- ACE_ARGV arg1(argB);
- n = arg1.argc();
- CORBA::ORB_var ORBB = CORBA::ORB_init(n,arg1.argv());
-#else
- ACE_UNUSED_ARG (argA);
- ACE_UNUSED_ARG (argB);
-#endif /* MORB_AB */
-
-
-
-#ifdef MORB_AM
- ACE_ARGV arg0(argA);
- int n = arg0.argc();
- CORBA::ORB_var ORBA = CORBA::ORB_init(n,arg0.argv());
-
- ACE_ARGV arg1(argM);
- n = arg1.argc();
- CORBA::ORB_var ORBB = CORBA::ORB_init(n,arg1.argv());
-#else
- ACE_UNUSED_ARG (argA);
- ACE_UNUSED_ARG (argM);
-#endif /* MORB_AM */
-
-#ifdef MORB_MB
- int n = 0;
- ACE_ARGV arg0(argM);
- n = arg0.argc();
- CORBA::ORB_var ORBA = CORBA::ORB_init(n, arg0.argv());
- if (ORBA.in () == 0)
- ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to get an ORB\n")), -1);
-
- ACE_ARGV arg1(argB);
- n = arg1.argc();
- CORBA::ORB_var ORBB = CORBA::ORB_init(n, arg1.argv());
-#else
- ACE_UNUSED_ARG (argB);
- ACE_UNUSED_ARG (argM);
-#endif /* MORB_MB */
-
-#ifdef MORB_MA
- int n = 0;
- ACE_ARGV arg0(argM);
- n = arg0.argc();
- CORBA::ORB_var ORBA = CORBA::ORB_init(n, arg0.argv());
- if (ORBA.in () == 0)
- ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to get an ORB\n")), -1);
-
- ACE_ARGV arg1(argA);
- n = arg1.argc();
- CORBA::ORB_var ORBB = CORBA::ORB_init(n, arg1.argv());
-#else
- ACE_UNUSED_ARG (argA);
- ACE_UNUSED_ARG (argM);
-#endif /* MORB_MA */
-
- if (ORBB.in () == 0)
- ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Expected to get a second ORB\n")), -1);
-
- if (ORBA.in () == ORBB.in ())
- ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Unexpected to find the two ORBs the same\n")), -1);
-
- // Look ma!! No ... services?!
-
- ACE_Service_Object *so = 0;
- int error = 0;
- so = ACE_Dynamic_Service<ACE_Service_Object>::instance ("SSLIOP_Factory");
- if (so != 0)
- {
- error++;
- ACE_ERROR ((LM_DEBUG,
- ACE_TEXT("Unexpected to find SSLIOP_Factory globally\n")));
- }
-
- so = ACE_Dynamic_Service<ACE_Service_Object>::instance ("UIPMC_Factory");
- if (so != 0)
- {
- error++;
- ACE_ERROR ((LM_DEBUG,
- ACE_TEXT("Unexpected to find ")
- ACE_TEXT("UIPMC_Factory globally\n")));
- }
-
- // Since each svc conf file causes the ORB to load the services in
- // its own service space no services are reachable through the
- // global service repo
-
- ORBA->destroy();
-
- ORBB->destroy();
-
- if (error > 0)
- return -1;
-
- }
+ {
+ int n, error = 0;
+
+ ACE_ARGV argM (argStrM);
+ n = argM.argc ();
+ CORBA::ORB_var ORBM =
+ CORBA::ORB_init (n, argM.argv ());
+
+ if (CORBA::is_nil (ORBM.in ()))
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Expected to get an ORB\n")),
+ -1);
+
+#if TAO_HAS_UIOP == 1
+ // UIOP
+ ACE_ARGV argA (argStrA);
+ n = argA.argc ();
+ CORBA::ORB_var ORBA =
+ CORBA::ORB_init (n, argA.argv ());
+
+ if (CORBA::is_nil (ORBA.in ()))
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Expected to get an ORB\n")),
+ -1);
+#endif /* TAO_HAS_UIOP */
+
+#if defined (DO_1459_SSLIOP_TEST)
+ // SSLIOP
+ ACE_ARGV argB (argStrB);
+ n = argB.argc ();
+ CORBA::ORB_var ORBB =
+ CORBA::ORB_init (n, argB.argv ());
+
+ if (CORBA::is_nil (ORBB.in ()))
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Expected to get an ORB\n")),
+ -1);
+#endif
+
+ // MIOP
+ ACE_ARGV argC (argStrC);
+ n = argC.argc ();
+ CORBA::ORB_var ORBC =
+ CORBA::ORB_init (n, argC.argv ());
+
+ if (CORBA::is_nil (ORBC.in ()))
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Expected to get an ORB\n")),
+ -1);
+
+ // DIOP
+ ACE_ARGV argD (argStrD);
+ n = argD.argc ();
+ CORBA::ORB_var ORBD =
+ CORBA::ORB_init (n, argD.argv ());
+
+ if (CORBA::is_nil (ORBD.in ()))
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Expected to get an ORB\n")),
+ -1);
+
+ if (
+// SSLIOP
+#if defined (DO_1459_SSLIOP_TEST)
+ ORBM.in () == ORBB.in () ||
+#if TAO_HAS_UIOP == 1
+ ORBA.in () == ORBB.in () ||
+#endif
+ ORBC.in () == ORBB.in () ||
+ ORBD.in () == ORBB.in () ||
+#endif
+// UIOP
+#if TAO_HAS_UIOP
+ ORBM.in () == ORBA.in () ||
+ ORBC.in () == ORBA.in () ||
+ ORBD.in () == ORBA.in () ||
+#endif
+// MIOP
+ ORBM.in () == ORBC.in () ||
+ ORBD.in () == ORBC.in () ||
+// DIOP
+ ORBM.in () == ORBD.in ()
+ )
+ ACE_ERROR_RETURN ((LM_DEBUG,
+ ACE_TEXT("Unexpected to find the two ORBs are the same\n")),
+ -1);
+
+ // Since each svc conf file causes the ORB to load the services in
+ // its own service space no services are reachable through the
+ // global service repo
+
+#if TAO_HAS_UIOP == 1
+ // UIOP
+ ACE_Service_Object *uiop_so =
+ ACE_Dynamic_Service<ACE_Service_Object>::instance ("UIOP_Factory");
+ if (uiop_so != 0)
+ {
+ ++error;
+ ACE_ERROR ((LM_DEBUG,
+ ACE_TEXT("Unexpected to find ")
+ ACE_TEXT("UIOP_Factory globally\n")));
+ }
+#endif /* TAO_HAS_UIOP */
+
+#if defined (DO_1459_SSLIOP_TEST)
+ // SSLIOP
+ ACE_Service_Object *ssliop_so =
+ ACE_Dynamic_Service<ACE_Service_Object>::instance ("SSLIOP_Factory");
+ if (ssliop_so != 0)
+ {
+ ++error;
+ ACE_ERROR ((LM_DEBUG,
+ ACE_TEXT("Unexpected to find ")
+ ACE_TEXT("SSLIOP_Factory globally\n")));
+ }
+#endif
+
+ // MIOP
+ ACE_Service_Object *uipmc_so =
+ ACE_Dynamic_Service<ACE_Service_Object>::instance ("UIPMC_Factory");
+ if (uipmc_so != 0)
+ {
+ ++error;
+ ACE_ERROR ((LM_DEBUG,
+ ACE_TEXT("Unexpected to find ")
+ ACE_TEXT("UIPMC_Factory globally\n")));
+ }
+
+ // DIOP
+ ACE_Service_Object *diop_so =
+ ACE_Dynamic_Service<ACE_Service_Object>::instance ("DIOP_Factory");
+ if (diop_so != 0)
+ {
+ ++error;
+ ACE_ERROR ((LM_DEBUG,
+ ACE_TEXT("Unexpected to find ")
+ ACE_TEXT("DIOP_Factory globally\n")));
+ }
+
+ ORBM->destroy();
+
+#if TAO_HAS_UIOP == 1
+ ORBA->destroy();
+#endif /* TAO_HAS_UIOP */
+
+#if defined (DO_1459_SSLIOP_TEST)
+ ORBB->destroy();
+#endif
+
+ ORBC->destroy();
+
+ ORBD->destroy();
+
+ if (error > 0)
+ return -1;
+ }
catch(const CORBA::Exception& ex)
{
ex._tao_print_exception ("Unhandled exception caught");
return -1;
}
- catch(...)
- {
- ACE_ERROR_RETURN ((LM_DEBUG, ACE_TEXT("Unexpected exception\n")), -1);
- }
return 0;
}
diff --git a/TAO/tests/ORB_Local_Config/Bug_1459/d.conf b/TAO/tests/ORB_Local_Config/Bug_1459/d.conf
new file mode 100644
index 00000000000..93678ab8146
--- /dev/null
+++ b/TAO/tests/ORB_Local_Config/Bug_1459/d.conf
@@ -0,0 +1,2 @@
+dynamic DIOP_Factory Service_Object * TAO_Strategies:_make_TAO_DIOP_Protocol_Factory() ""
+dynamic Advanced_Resource_Factory Service_Object * TAO_Strategies:_make_TAO_Advanced_Resource_Factory() "-ORBProtocolFactory DIOP_Factory"