summaryrefslogtreecommitdiff
path: root/TAO/tests/Exposed_Policies
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:17:52 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:17:52 +0000
commit2ee7b7eed4c0cc10f4ec25b186b04202af01b565 (patch)
tree08a8a649c90559cf5b2228c1caad15515902613e /TAO/tests/Exposed_Policies
parentc979767a00db4ea1299af482033a68829cc16675 (diff)
downloadATCD-2ee7b7eed4c0cc10f4ec25b186b04202af01b565.tar.gz
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/tests/Exposed_Policies')
-rw-r--r--TAO/tests/Exposed_Policies/Counter_i.cpp6
-rw-r--r--TAO/tests/Exposed_Policies/Policy_Tester.cpp47
-rw-r--r--TAO/tests/Exposed_Policies/Policy_Tester.h3
-rw-r--r--TAO/tests/Exposed_Policies/Policy_Verifier.cpp50
-rw-r--r--TAO/tests/Exposed_Policies/Policy_Verifier.h6
-rw-r--r--TAO/tests/Exposed_Policies/RT_Properties.cpp3
-rw-r--r--TAO/tests/Exposed_Policies/RT_Properties.h3
-rw-r--r--TAO/tests/Exposed_Policies/client.cpp10
-rw-r--r--TAO/tests/Exposed_Policies/server.cpp11
9 files changed, 55 insertions, 84 deletions
diff --git a/TAO/tests/Exposed_Policies/Counter_i.cpp b/TAO/tests/Exposed_Policies/Counter_i.cpp
index 1f2bd43626b..c4a63433eb6 100644
--- a/TAO/tests/Exposed_Policies/Counter_i.cpp
+++ b/TAO/tests/Exposed_Policies/Counter_i.cpp
@@ -21,21 +21,21 @@ Counter_Servant::~Counter_Servant (void)
// Counter Interface Methods Implementation.
void
-Counter_Servant::increment (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+Counter_Servant::increment (/**/)
ACE_THROW_SPEC ((CORBA::SystemException))
{
++this->count_;
}
CORBA::Long
-Counter_Servant::get_count (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+Counter_Servant::get_count (/**/)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return this->count_;
}
void
-Counter_Servant::reset (ACE_ENV_SINGLE_ARG_DECL_NOT_USED/*ACE_ENV_SINGLE_ARG_PARAMETER*/)
+Counter_Servant::reset (/**/)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->count_ = 0;
diff --git a/TAO/tests/Exposed_Policies/Policy_Tester.cpp b/TAO/tests/Exposed_Policies/Policy_Tester.cpp
index 906f21ae8a2..2670017a27f 100644
--- a/TAO/tests/Exposed_Policies/Policy_Tester.cpp
+++ b/TAO/tests/Exposed_Policies/Policy_Tester.cpp
@@ -44,21 +44,17 @@ Policy_Tester::run (void)
int
Policy_Tester::init (int argc,
- char *argv[]
- ACE_ENV_ARG_DECL)
+ char *argv[])
{
// ORB Initialization.
this->orb_ =
- CORBA::ORB_init (argc, argv, ""
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
// Get a reference to the RT-ORB.
CORBA::Object_var object =
- this->orb_->resolve_initial_references ("RTORB"
- ACE_ENV_ARG_PARAMETER);
+ this->orb_->resolve_initial_references ("RTORB");
- this->rt_orb_ = RTCORBA::RTORB::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
+ this->rt_orb_ = RTCORBA::RTORB::_narrow (object.in ());
// Here we parse the command line paramether passed
// to the application.
@@ -72,12 +68,12 @@ Policy_Tester::init (int argc,
if ((arg = arg_shifter.get_the_parameter ("-POAConfigFile")))
{
this->rt_poa_properties_ =
- RT_Properties::read_from (arg ACE_ENV_ARG_PARAMETER);
+ RT_Properties::read_from (arg);
}
else if ((arg = arg_shifter.get_the_parameter ("-ObjectConfigFile")))
{
this->rt_object_properties_ =
- RT_Properties::read_from (arg ACE_ENV_ARG_PARAMETER);
+ RT_Properties::read_from (arg);
}
else if ((arg = arg_shifter.get_the_parameter ("-BaseObjectIOR")))
{
@@ -144,16 +140,14 @@ Policy_Tester::create_objects (void)
RTCORBA::Priority priority = this->rt_poa_properties_->priority ();
poa_policy_list[0] =
this->rt_orb_->create_priority_model_policy (RTCORBA::SERVER_DECLARED,
- priority
- ACE_ENV_ARG_PARAMETER);
+ priority);
// Create priority Banded Connection Policy.
RTCORBA::PriorityBands poa_priority_bands =
this->rt_poa_properties_->priority_bands ();
poa_policy_list[1] =
- this->rt_orb_->create_priority_banded_connection_policy (poa_priority_bands
- ACE_ENV_ARG_PARAMETER);
+ this->rt_orb_->create_priority_banded_connection_policy (poa_priority_bands);
// Client Protocol Policy.
RTCORBA::ProtocolList protocol_list;
@@ -171,10 +165,10 @@ Policy_Tester::create_objects (void)
this->rt_orb_->create_client_protocol_policy (protocol_list);
CORBA::Object_var object =
- this->orb_->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER);
+ this->orb_->resolve_initial_references ("RootPOA");
this->poa_ =
- PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (object.in ());
PortableServer::POAManager_var poa_mgr =
PortableServer::POAManager::_nil ();
@@ -182,17 +176,15 @@ Policy_Tester::create_objects (void)
object =
this->poa_->create_POA ("Child_POA",
poa_mgr.in (),
- poa_policy_list
- ACE_ENV_ARG_PARAMETER);
+ poa_policy_list);
this->child_poa_ =
- RTPortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ RTPortableServer::POA::_narrow (object.in ());
// Create a Corba Object reference, using the policies
// set at the POA level.
object =
- this->child_poa_->create_reference ("IDL:Counter:1.0"
- ACE_ENV_ARG_PARAMETER);
+ this->child_poa_->create_reference ("IDL:Counter:1.0");
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Reference Created!\n")));
@@ -201,14 +193,14 @@ Policy_Tester::create_objects (void)
"Unable to create Object!\n"))
return -1;
- Counter_var base_object = Counter::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ Counter_var base_object = Counter::_narrow (object.in ());
if (!check_reference (base_object.in(),
"Unable to create a Object!\n"))
return -1;
CORBA::String_var ior =
- this->orb_->object_to_string (base_object.in () ACE_ENV_ARG_PARAMETER);
+ this->orb_->object_to_string (base_object.in ());
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Activated as <%s>\n"), ior.in ()));
@@ -232,8 +224,7 @@ Policy_Tester::create_objects (void)
object =
this->child_poa_->create_reference_with_priority
("IDL:Counter:1.0",
- this->rt_object_properties_->priority ()
- ACE_ENV_ARG_PARAMETER);
+ this->rt_object_properties_->priority ());
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Reference Created!\n")));
@@ -242,7 +233,7 @@ Policy_Tester::create_objects (void)
"Unable to create a Counter Object!\n"))
return -1;
- Counter_var over_object = Counter::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ Counter_var over_object = Counter::_narrow (object.in ());
if (!check_reference (over_object.in(),
"Unable to create Object!\n"))
@@ -250,7 +241,7 @@ Policy_Tester::create_objects (void)
CORBA::String_var o_ior =
- this->orb_->object_to_string (over_object.in () ACE_ENV_ARG_PARAMETER);
+ this->orb_->object_to_string (over_object.in ());
ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Activated as <%s>\n"), o_ior.in ()));
@@ -270,5 +261,5 @@ Policy_Tester::create_objects (void)
void
Policy_Tester::shutdown (void)
{
- this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ this->orb_->shutdown (0);
}
diff --git a/TAO/tests/Exposed_Policies/Policy_Tester.h b/TAO/tests/Exposed_Policies/Policy_Tester.h
index 8561406b5b5..0f484518e18 100644
--- a/TAO/tests/Exposed_Policies/Policy_Tester.h
+++ b/TAO/tests/Exposed_Policies/Policy_Tester.h
@@ -39,8 +39,7 @@ public:
// Runs the test.
int init (int argc,
- char *argv[]
- ACE_ENV_ARG_DECL);
+ char *argv[]);
void shutdown (void);
private:
diff --git a/TAO/tests/Exposed_Policies/Policy_Verifier.cpp b/TAO/tests/Exposed_Policies/Policy_Verifier.cpp
index 20a352ded22..422f0f198ae 100644
--- a/TAO/tests/Exposed_Policies/Policy_Verifier.cpp
+++ b/TAO/tests/Exposed_Policies/Policy_Verifier.cpp
@@ -19,11 +19,10 @@ Policy_Verifier::~Policy_Verifier (void)
bool
Policy_Verifier::init (int argc,
- char *argv[]
- ACE_ENV_ARG_DECL)
+ char *argv[])
{
this->orb_ =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
ACE_Arg_Shifter arg_shifter (argc, argv);
@@ -34,14 +33,14 @@ Policy_Verifier::init (int argc,
if ((arg = arg_shifter.get_the_parameter ("-POAConfigFile")))
{
this->rt_poa_properties_ =
- RT_Properties::read_from (arg ACE_ENV_ARG_PARAMETER);
+ RT_Properties::read_from (arg);
this->priority_bands_ =
this->rt_poa_properties_->priority_bands ().length ();
}
else if ((arg = arg_shifter.get_the_parameter ("-ObjectConfigFile")))
{
this->rt_object_properties_ =
- RT_Properties::read_from (arg ACE_ENV_ARG_PARAMETER);
+ RT_Properties::read_from (arg);
}
else if ((arg = arg_shifter.get_the_parameter ("-BaseObjectIOR")))
{
@@ -85,24 +84,23 @@ Policy_Verifier::init (int argc,
}
// Get the Object references.
- CORBA::Object_var object = this->orb_->string_to_object (this->base_object_ref_
- ACE_ENV_ARG_PARAMETER);
+ CORBA::Object_var object = this->orb_->string_to_object (this->base_object_ref_);
if (!Policy_Verifier::check_reference (object.in (), "Invalid IOR file!\n"))
return false;
- this->base_object_ = Counter::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ this->base_object_ = Counter::_narrow (object.in ());
if (!Policy_Verifier::check_reference (this->base_object_.in (),
"Unable to convert the IOR to the proper object reference.\n"))
return false;
- object = this->orb_->string_to_object (this->overridden_object_ref_ ACE_ENV_ARG_PARAMETER);
+ object = this->orb_->string_to_object (this->overridden_object_ref_);
if (!Policy_Verifier::check_reference (object.in (), "Invalid IOR file!\n"))
return false;
- this->overridden_object_ = Counter::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ this->overridden_object_ = Counter::_narrow (object.in ());
if (!Policy_Verifier::check_reference (this->overridden_object_.in (),
"Unable to convert the IOR to the proper object reference.\n"))
@@ -112,28 +110,24 @@ Policy_Verifier::init (int argc,
}
void
-Policy_Verifier::run (ACE_ENV_SINGLE_ARG_DECL )
+Policy_Verifier::run ( )
{
this->verify_reference (this->base_object_.in (),
- this->rt_poa_properties_
- ACE_ENV_ARG_PARAMETER);
+ this->rt_poa_properties_);
this->verify_reference (this->overridden_object_.in (),
- this->rt_object_properties_
- ACE_ENV_ARG_PARAMETER);
+ this->rt_object_properties_);
}
void
Policy_Verifier::verify_reference (Counter_ptr object,
- RT_Properties *rt_properties
- ACE_ENV_ARG_DECL)
+ RT_Properties *rt_properties)
{
- ACE_TRY
+ try
{
CORBA::Policy_var policy_var =
- object->_get_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE
- ACE_ENV_ARG_PARAMETER);
+ object->_get_policy (RTCORBA::PRIORITY_MODEL_POLICY_TYPE);
if (Policy_Verifier::check_reference (policy_var.in (), "Unable to get Priority Policy.\n"))
{
@@ -163,16 +157,14 @@ Policy_Verifier::verify_reference (Counter_ptr object,
ACE_TEXT ("Priority Value Mismatch.\n")));
}
- policy_var = object->_get_policy (RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE
- ACE_ENV_ARG_PARAMETER);
+ policy_var = object->_get_policy (RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE);
if (Policy_Verifier::check_reference (policy_var.in (),
"Unable to get Priority Banded Policy\n"))
{
RTCORBA::PriorityBandedConnectionPolicy_var priority_banded_policy =
- RTCORBA::PriorityBandedConnectionPolicy::_narrow (policy_var.in ()
- ACE_ENV_ARG_PARAMETER);
+ RTCORBA::PriorityBandedConnectionPolicy::_narrow (policy_var.in ());
if (Policy_Verifier::check_reference (priority_banded_policy.in (),
@@ -207,14 +199,13 @@ Policy_Verifier::verify_reference (Counter_ptr object,
}
}
}
- policy_var = object->_get_policy (RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE
- ACE_ENV_ARG_PARAMETER);
+ policy_var = object->_get_policy (RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE);
if (Policy_Verifier::check_reference (policy_var.in (),
"Unable to get Client Protocol Policy\n"))
{
RTCORBA::ClientProtocolPolicy_var client_protocol_policy =
- RTCORBA::ClientProtocolPolicy::_narrow (policy_var.in () ACE_ENV_ARG_PARAMETER);
+ RTCORBA::ClientProtocolPolicy::_narrow (policy_var.in ());
RTCORBA::ProtocolList_var protocol_list =
client_protocol_policy->protocols ();
@@ -227,12 +218,11 @@ Policy_Verifier::verify_reference (Counter_ptr object,
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "CORBA Exception Raised");
+ ex._tao_print_exception ("CORBA Exception Raised");
}
- ACE_ENDTRY;
}
CORBA::Boolean
diff --git a/TAO/tests/Exposed_Policies/Policy_Verifier.h b/TAO/tests/Exposed_Policies/Policy_Verifier.h
index b78926c289f..a37b8bf0396 100644
--- a/TAO/tests/Exposed_Policies/Policy_Verifier.h
+++ b/TAO/tests/Exposed_Policies/Policy_Verifier.h
@@ -41,16 +41,14 @@ public:
~Policy_Verifier (void);
bool init (int argc,
- char *argv[]
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ char *argv[]);
void run (void);
private:
// -- Helper methods --
void verify_reference (Counter_ptr counter,
- RT_Properties *rt_properties
- ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+ RT_Properties *rt_properties);
CORBA::Boolean check_reference (CORBA::Object_ptr object,
const char *msg);
diff --git a/TAO/tests/Exposed_Policies/RT_Properties.cpp b/TAO/tests/Exposed_Policies/RT_Properties.cpp
index 4a23c92f0f5..b284f3e2534 100644
--- a/TAO/tests/Exposed_Policies/RT_Properties.cpp
+++ b/TAO/tests/Exposed_Policies/RT_Properties.cpp
@@ -21,8 +21,7 @@ RT_Properties::~RT_Properties (void)
}
RT_Properties *
-RT_Properties::read_from (const char *file_name
- ACE_ENV_ARG_DECL)
+RT_Properties::read_from (const char *file_name)
{
FILE *fp = ACE_OS::fopen (file_name, "r");
diff --git a/TAO/tests/Exposed_Policies/RT_Properties.h b/TAO/tests/Exposed_Policies/RT_Properties.h
index 35166b9d9fa..4fbc06beed0 100644
--- a/TAO/tests/Exposed_Policies/RT_Properties.h
+++ b/TAO/tests/Exposed_Policies/RT_Properties.h
@@ -29,8 +29,7 @@ public:
RT_Properties (void);
~RT_Properties (void);
- static RT_Properties * read_from (const char *file_name
- ACE_ENV_ARG_DECL);
+ static RT_Properties * read_from (const char *file_name);
// -- Accessor Methods --
void priority (RTCORBA::Priority priority);
diff --git a/TAO/tests/Exposed_Policies/client.cpp b/TAO/tests/Exposed_Policies/client.cpp
index aaefc20f658..1295144a34c 100644
--- a/TAO/tests/Exposed_Policies/client.cpp
+++ b/TAO/tests/Exposed_Policies/client.cpp
@@ -15,13 +15,12 @@ int
main (int argc, char *argv[])
{
int status = 0;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
Policy_Verifier policy_verifier;
- bool retval = policy_verifier.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ bool retval = policy_verifier.init (argc, argv);
if (retval)
{
@@ -32,13 +31,12 @@ main (int argc, char *argv[])
status++;
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "CORBA Exception Raised");
+ ex._tao_print_exception ("CORBA Exception Raised");
status++;
}
- ACE_ENDTRY;
return status;
}
diff --git a/TAO/tests/Exposed_Policies/server.cpp b/TAO/tests/Exposed_Policies/server.cpp
index 6548d9ba6a8..59e4566d509 100644
--- a/TAO/tests/Exposed_Policies/server.cpp
+++ b/TAO/tests/Exposed_Policies/server.cpp
@@ -21,13 +21,12 @@ ACE_RCSID(tao, server, "$Id$")
int
main (int argc, char *argv[])
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
Policy_Tester policy_tester;
- int result = policy_tester.init (argc, argv ACE_ENV_ARG_PARAMETER);
+ int result = policy_tester.init (argc, argv);
if (result != 0)
return result;
@@ -35,14 +34,12 @@ main (int argc, char *argv[])
policy_tester.run ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- ACE_TEXT ("CORBA Exception Raised."));
+ ex._tao_print_exception (ACE_TEXT ("CORBA Exception Raised."));
return 1;
}
- ACE_ENDTRY;
return 0;
}