summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Security/Crash_Test/server.cpp')
-rw-r--r--TAO/orbsvcs/tests/Security/Crash_Test/server.cpp61
1 files changed, 19 insertions, 42 deletions
diff --git a/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp b/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
index c880f1e4858..dea2f849101 100644
--- a/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
+++ b/TAO/orbsvcs/tests/Security/Crash_Test/server.cpp
@@ -6,8 +6,8 @@
#include "ace/SString.h"
#include "test_i.h"
-ACE_RCSID (Send_File,
- server,
+ACE_RCSID (Send_File,
+ server,
"$Id$")
const char *ior_output_file = 0;
@@ -41,21 +41,18 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
ACE_TString env ("SSL_CERT_FILE=");
env += cert_file;
ACE_OS::putenv (env.c_str ());
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var poa_object =
- orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->resolve_initial_references ("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -63,12 +60,10 @@ main (int argc, char *argv[])
1);
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ PortableServer::POA::_narrow (poa_object.in ());
PortableServer::POAManager_var poa_manager =
- root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->the_POAManager ();
if (parse_args (argc, argv) != 0)
return 1;
@@ -79,41 +74,29 @@ main (int argc, char *argv[])
policies.length (2);
policies[0] =
- root_poa->create_id_assignment_policy (PortableServer::USER_ID
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID);
policies[1] =
- root_poa->create_lifespan_policy (PortableServer::PERSISTENT
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT);
PortableServer::POA_var persistent_poa =
root_poa->create_POA ("PersistentPOA",
poa_manager.in (),
- policies
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ policies);
PortableServer::ObjectId_var oid =
PortableServer::string_to_ObjectId ("object1");
- ACE_TRY_CHECK;
persistent_poa->activate_object_with_id (oid.in (),
- &server_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ &server_impl);
CORBA::Object_var server =
persistent_poa->create_reference_with_id (oid.in (),
- "IDL:Simple_Server:1.0"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ "IDL:Simple_Server:1.0");
CORBA::String_var ior =
- orb->object_to_string (server.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->object_to_string (server.in ());
// If the ior_output_file exists, output the ior to it
if (ior_output_file != 0)
@@ -140,29 +123,23 @@ main (int argc, char *argv[])
}
- poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ poa_manager->activate ();
- orb->run (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->run ();
ACE_DEBUG ((LM_DEBUG, "SERVER (%P): Event loop finished.\n"));
- persistent_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ persistent_poa->destroy (1, 1);
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->destroy (1, 1);
ACE_OS::sleep (1);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "SERVER (%P): Caught exception:");
+ ex._tao_print_exception ("SERVER (%P): Caught exception:");
return 1;
}
- ACE_ENDTRY;
return 0;
}