summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/FaultTolerance/IOGR
diff options
context:
space:
mode:
authorbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-23 16:43:25 +0000
committerbala <bala@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-09-23 16:43:25 +0000
commitc0f67e0c746bbd38ca7678b150183303d05024dd (patch)
tree304b4791ec57918bd4c55a006a4474a5f1bc4670 /TAO/orbsvcs/tests/FaultTolerance/IOGR
parent61361e4ce09a9ad5dcd559fc12d9ad4129efa073 (diff)
downloadATCD-c0f67e0c746bbd38ca7678b150183303d05024dd.tar.gz
*** empty log message ***
Diffstat (limited to 'TAO/orbsvcs/tests/FaultTolerance/IOGR')
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/README10
-rw-r--r--TAO/orbsvcs/tests/FaultTolerance/IOGR/client.cpp138
2 files changed, 4 insertions, 144 deletions
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/README b/TAO/orbsvcs/tests/FaultTolerance/IOGR/README
index 9f3ce4901d4..40c06616930 100644
--- a/TAO/orbsvcs/tests/FaultTolerance/IOGR/README
+++ b/TAO/orbsvcs/tests/FaultTolerance/IOGR/README
@@ -3,16 +3,14 @@ a primary server and see whether the client gives preference to
contact a primary for its first invocation. When the primary is killed
it contacts the secondary for next invocation.
-To aid this we have three executables. Two copies of the server are
-started. A manager is then to merge these two iors and designate the
-second as primary. The merged IOR is then written to another file.
+Two copies of the server are started. A manager is then to merge these
+two iors and designate the second as primary. The merged IOR is then
+written to another file. This merged IOR is then used to make
+invocations on the server.
-The client is started with an option to read the merged IOR. Then
-invocations are then made.
Run the application as follows:
$./server -o <file1.ior>
$./server -o <file2.ior>
$./Manager -a file://<file1.ior> -b file://<file2.ior> -c <output.ior>
-$./client -k file://output.ior \ No newline at end of file
diff --git a/TAO/orbsvcs/tests/FaultTolerance/IOGR/client.cpp b/TAO/orbsvcs/tests/FaultTolerance/IOGR/client.cpp
deleted file mode 100644
index 9f3f53d036c..00000000000
--- a/TAO/orbsvcs/tests/FaultTolerance/IOGR/client.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// $Id$
-
-#include "ace/SString.h"
-#include "ace/Get_Opt.h"
-#include "testC.h"
-#include "orbsvcs/FT_CORBAC.h"
-
-
-ACE_RCSID(IOGR,client, "$Id$")
-
-const char *ior = 0;
-int do_shutdown = 0;
-
-const char *name = "file://amba.ior";
-
-int
-parse_args (int argc, char *argv[])
-{
- ACE_Get_Opt get_opts (argc, argv, "k:");
- int c;
-
- while ((c = get_opts ()) != -1)
- switch (c)
- {
- case 'k':
- ior = get_opts.optarg;
- break;
- case '?':
- default:
- ACE_ERROR_RETURN ((LM_ERROR,
- "usage: %s "
- "-k <ior> "
- "\n",
- argv [0]),
- -1);
- }
- // Indicates sucessful parsing of the command line
- return 0;
-}
-
-void
-run_test (Simple_Server_ptr server,
- CORBA::Environment &ACE_TRY_ENV);
-
-int
-main (int argc, char *argv[])
-{
- ACE_DECLARE_NEW_CORBA_ENV;
-
- ACE_TRY
- {
- CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "", ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- if (parse_args (argc, argv) != 0)
- return 1;
-
- CORBA::Object_var object =
- orb->string_to_object (ior, ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- // Combined IOR stuff
- Simple_Server_var server =
- Simple_Server::_narrow (object.in (), ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- FT::ObjectGroupId jk;
-
- if (CORBA::is_nil (server.in ()))
- {
- ACE_ERROR_RETURN ((LM_ERROR,
- "Object reference <%s> is nil\n",
- ior),
- 1);
- }
-
- run_test (server.in (), ACE_TRY_ENV);
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught an exception \n");
- return -1;
- }
- ACE_ENDTRY;
- return 0;
-}
-
-void run_test (Simple_Server_ptr server,
- CORBA::Environment &ACE_TRY_ENV)
-{
- for (CORBA::ULong i = 0;
- i < 10;
- i++)
- {
- ACE_TRY
- {
- // Make a remote call
- server->remote_call (ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- ACE_DEBUG ((LM_DEBUG,
- "I am going to shutdown \n"));
- server->shutdown (ACE_TRY_ENV);
- ACE_TRY_CHECK;
- ACE_OS::sleep (25);
- }
- ACE_CATCH (CORBA::TRANSIENT, t)
- {
- if (t.completed () != CORBA::COMPLETED_NO)
- {
- ACE_PRINT_EXCEPTION (t, "Unexpected kind of TRANSIENT");
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG,
- "The completed status %d\n", t.completed ()));
- ACE_DEBUG ((LM_DEBUG,
- "Automagically re-issuing request on TRANSIENT\n"));
- ACE_OS::sleep (1);
- }
- }
- ACE_CATCH (CORBA::COMM_FAILURE, f)
- {
- ACE_PRINT_EXCEPTION (f, "A (sort of) expected COMM_FAILURE");
- ACE_DEBUG ((LM_DEBUG,
- "Automagically re-issuing request on COMM_FAILURE\n"));
- }
- ACE_CATCHANY
- {
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Unexpected exception");
- ACE_RE_THROW;
- }
- ACE_ENDTRY;
- ACE_CHECK;
- }
-}