summaryrefslogtreecommitdiff
path: root/TAO/tests/CSD_Strategy_Tests/TP_Test_2
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-01-24 15:39:09 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-01-24 15:39:09 +0000
commitc801f87e59c00f72bdeb5ce7bd0d276674665bac (patch)
tree70bff03d1cf156ecf05ee4c5c338d8ce423e64ee /TAO/tests/CSD_Strategy_Tests/TP_Test_2
parent98c0b37d4714ff774fc3ada8c9ee893c719af714 (diff)
downloadATCD-c801f87e59c00f72bdeb5ce7bd0d276674665bac.tar.gz
Wed Jan 24 14:00:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tests/CSD_Strategy_Tests/TP_Test_2')
-rw-r--r--TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.cpp18
-rw-r--r--TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.h4
-rw-r--r--TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.cpp76
-rw-r--r--TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.h12
4 files changed, 43 insertions, 67 deletions
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.cpp
index 531dba15f17..fb1f32e6fe2 100644
--- a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.cpp
+++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.cpp
@@ -24,17 +24,14 @@ int
ClientApp::run_i(int argc, char* argv[] ACE_ENV_ARG_DECL)
{
int result = this->init(argc, argv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
if (result != 0)
{
return result;
}
- this->client_setup(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ this->client_setup();
- result = this->run_engine(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ result = this->run_engine();
this->cleanup();
return result;
}
@@ -44,7 +41,6 @@ int
ClientApp::init(int argc, char* argv[] ACE_ENV_ARG_DECL)
{
this->orb_ = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
// Parse the command-line args for this application.
// * Raises -1 if problems are encountered.
@@ -55,13 +51,12 @@ ClientApp::init(int argc, char* argv[] ACE_ENV_ARG_DECL)
void
-ClientApp::client_setup(ACE_ENV_SINGLE_ARG_DECL)
+ClientApp::client_setup(void)
{
// Turn the ior_ into a Foo_A obj ref.
Foo_A_var foo = RefHelper<Foo_A>::string_to_ref(this->orb_.in(),
this->ior_.c_str()
ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
// Create the ClientEngine object, and give it the Foo_A obj ref.
this->engine_ = new Foo_A_ClientEngine(foo.in(), this->client_id_);
@@ -69,10 +64,9 @@ ClientApp::client_setup(ACE_ENV_SINGLE_ARG_DECL)
int
-ClientApp::run_engine(ACE_ENV_SINGLE_ARG_DECL)
+ClientApp::run_engine(void)
{
- bool result = this->engine_->execute(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ bool result = this->engine_->execute();
return result ? 0 : -1;
}
@@ -107,7 +101,7 @@ ClientApp::parse_args(int argc, char* argv[])
c,
"client_kind");
break;
-
+
case 'n':
result = set_arg(this->client_id_,
get_opts.opt_arg(),
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.h b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.h
index d5bb80cf800..6b359e96eb3 100644
--- a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.h
+++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ClientApp.h
@@ -23,8 +23,8 @@ class ClientApp : public TestAppBase
// These are all called, in order, by the run_i() method.
int init(int argc, char* argv[] ACE_ENV_ARG_DECL);
- void client_setup(ACE_ENV_SINGLE_ARG_DECL);
- int run_engine(ACE_ENV_SINGLE_ARG_DECL);
+ void client_setup(void);
+ int run_engine(void);
void cleanup();
// Helper methods used by the methods above.
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.cpp b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.cpp
index f291baacad4..89ab455005c 100644
--- a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.cpp
+++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.cpp
@@ -33,32 +33,25 @@ int
ServerApp::run_i(int argc, char* argv[] ACE_ENV_ARG_DECL)
{
int result = this->init(argc, argv ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
if (result != 0)
{
return result;
}
-
- this->poa_setup(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
- this->csd_setup(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
- this->servant_setup(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+
+ this->poa_setup();
+ this->csd_setup();
+ this->servant_setup();
this->collocated_setup();
- this->poa_activate(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
- this->run_collocated_clients(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
- this->run_orb_event_loop(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
+ this->poa_activate();
+ this->run_collocated_clients();
+ this->run_orb_event_loop();
// Calling wait on ACE_Thread_Manager singleton to avoid the problem
// that the main thread might exit before all CSD Threads exit.
// Wait for all CSD task threads exit.
ACE_Thread_Manager::instance ()->wait ();
-
+
this->cleanup();
return this->check_validity () ? 0 : -1;
}
@@ -68,41 +61,38 @@ int
ServerApp::init(int argc, char* argv[] ACE_ENV_ARG_DECL)
{
this->orb_ = CORBA::ORB_init(argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
// Parse the command-line args for this application.
// * Raises -1 if problems are encountered.
// * Returns 1 if the usage statement was explicitly requested.
// * Returns 0 otherwise.
int result = this->parse_args(argc, argv);
-
+
if (result != 0)
{
return result;
}
-
+
unsigned num_clients = this->num_remote_clients_ +
this->num_collocated_clients_;
TheAppShutdown->init (this->orb_.in (), num_clients ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (-1);
return 0;
}
void
-ServerApp::poa_setup(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::poa_setup(void)
{
- this->poa_ = this->create_poa(this->orb_.in(),
- "ChildPoa"
+ this->poa_ = this->create_poa(this->orb_.in(),
+ "ChildPoa"
ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
}
void
-ServerApp::csd_setup(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::csd_setup(void)
{
this->tp_strategy_ = new TAO::CSD::TP_Strategy(this->num_csd_threads_);
@@ -112,19 +102,17 @@ ServerApp::csd_setup(ACE_ENV_SINGLE_ARG_DECL)
"Failed to apply CSD strategy to poa.\n"));
ACE_THROW(TestAppException());
}
- ACE_CHECK;
}
void
-ServerApp::servant_setup(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::servant_setup(void)
{
this->servants_.create_and_activate(this->num_servants_,
this->orb_.in (),
this->poa_.in (),
this->ior_filename_prefix_.c_str()
ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
}
@@ -145,19 +133,17 @@ ServerApp::collocated_setup()
void
-ServerApp::poa_activate(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::poa_activate(void)
{
- PortableServer::POAManager_var poa_manager
- = this->poa_->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ PortableServer::POAManager_var poa_manager
+ = this->poa_->the_POAManager();
- poa_manager->activate(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ poa_manager->activate();
}
void
-ServerApp::run_collocated_clients(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::run_collocated_clients(void)
{
if (this->num_collocated_clients_ > 0)
{
@@ -170,11 +156,10 @@ ServerApp::run_collocated_clients(ACE_ENV_SINGLE_ARG_DECL)
void
-ServerApp::run_orb_event_loop(ACE_ENV_SINGLE_ARG_DECL)
+ServerApp::run_orb_event_loop(void)
{
OrbRunner orb_runner(this->orb_.in(), this->num_orb_threads_);
- orb_runner.run(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK;
+ orb_runner.run();
TheAppShutdown->wait ();
}
@@ -287,7 +272,7 @@ ServerApp::usage_statement()
int
ServerApp::arg_dependency_checks()
{
- return (this->num_remote_clients_
+ return (this->num_remote_clients_
+ this->num_collocated_clients_) > 0 ? 0 : -1;
}
@@ -316,21 +301,19 @@ ServerApp::set_arg(unsigned& value,
PortableServer::POA_ptr
-ServerApp::create_poa(CORBA::ORB_ptr orb,
+ServerApp::create_poa(CORBA::ORB_ptr orb,
const char* poa_name
ACE_ENV_ARG_DECL)
{
// Get the Root POA.
PortableServer::POA_var root_poa
- = RefHelper<PortableServer::POA>::resolve_initial_ref(orb,
+ = RefHelper<PortableServer::POA>::resolve_initial_ref(orb,
"RootPOA"
ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (PortableServer::POA::_nil ());
// Get the POAManager from the Root POA.
- PortableServer::POAManager_var poa_manager
- = root_poa->the_POAManager(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_CHECK_RETURN (PortableServer::POA::_nil ());
+ PortableServer::POAManager_var poa_manager
+ = root_poa->the_POAManager();
// Create the child POA Policies.
CORBA::PolicyList policies(0);
@@ -342,7 +325,6 @@ ServerApp::create_poa(CORBA::ORB_ptr orb,
poa_manager.in(),
policies
ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (PortableServer::POA::_nil ());
// Give away the child POA_ptr from the POA_var variable.
return poa._retn();
@@ -353,7 +335,7 @@ bool
ServerApp::check_validity ()
{
// Check whether the clients return any errors.
- if (this->num_collocated_clients_ > 0
+ if (this->num_collocated_clients_ > 0
&& this->collocated_client_task_.failure_count () > 0)
{
return false;
@@ -363,7 +345,7 @@ ServerApp::check_validity ()
this->num_collocated_clients_;
Foo_A_Statistics stats (num_clients);
-
+
Foo_A_ClientEngine::expected_results (stats);
for (unsigned i = 0; i < this->num_servants_; i++)
diff --git a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.h b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.h
index 73b5ccbbd94..91153fb1ffb 100644
--- a/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.h
+++ b/TAO/tests/CSD_Strategy_Tests/TP_Test_2/ServerApp.h
@@ -27,13 +27,13 @@ class ServerApp : public TestAppBase
// These are all called, in order, by the run_i() method.
int init(int argc, char* argv[] ACE_ENV_ARG_DECL);
- void poa_setup(ACE_ENV_SINGLE_ARG_DECL);
- void csd_setup(ACE_ENV_SINGLE_ARG_DECL);
- void servant_setup(ACE_ENV_SINGLE_ARG_DECL);
+ void poa_setup(void);
+ void csd_setup(void);
+ void servant_setup(void);
void collocated_setup();
- void poa_activate(ACE_ENV_SINGLE_ARG_DECL);
- void run_collocated_clients(ACE_ENV_SINGLE_ARG_DECL);
- void run_orb_event_loop(ACE_ENV_SINGLE_ARG_DECL);
+ void poa_activate(void);
+ void run_collocated_clients(void);
+ void run_orb_event_loop(void);
bool check_validity ();
void cleanup();