diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2007-04-02 15:24:40 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2007-04-02 15:24:40 +0000 |
commit | 19126f9c2ca2c5d0eb2974380d797cbb72ce1c83 (patch) | |
tree | db23f9dab4a0c820151c2c5c1063400954156ae3 | |
parent | f3b0bfcf8c096cc3ff947e722e12d6127aec6232 (diff) | |
download | ATCD-19126f9c2ca2c5d0eb2974380d797cbb72ce1c83.tar.gz |
ChangeLogTag: Mon Apr 2 15:24:46 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 7 | ||||
-rwxr-xr-x | TAO/tests/Bug_2735_Regression/run_test.pl | 8 | ||||
-rw-r--r-- | TAO/tests/Bug_2735_Regression/server.cpp | 59 |
3 files changed, 66 insertions, 8 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 875beb88925..d36ae35ab7f 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,10 @@ +Mon Apr 2 15:24:46 UTC 2007 Chad Elliott <elliott_c@ociweb.com> + + * tests/Bug_2735_Regression/run_test.pl: + * tests/Bug_2735_Regression/server.cpp: + + Modified this test to work with the XML service configurator. + Mon Apr 2 15:00:08 UTC 2007 Chad Elliott <elliott_c@ociweb.com> * tests/Bug_2677_Regression/Bug_2677_Regression.mpc: diff --git a/TAO/tests/Bug_2735_Regression/run_test.pl b/TAO/tests/Bug_2735_Regression/run_test.pl index f7b7fb4dddc..2839730c6d3 100755 --- a/TAO/tests/Bug_2735_Regression/run_test.pl +++ b/TAO/tests/Bug_2735_Regression/run_test.pl @@ -15,10 +15,7 @@ my $class = (PerlACE::is_vxworks_test() ? 'PerlACE::ProcessVX' : 'PerlACE::Process'); ## First test that the -ORBSvcConfDirective works with good options. -my $SV = $class->new('server', - '-ORBSvcConfDirective "static ' . - 'Server_Strategy_Factory \'-ORBConcurrency ' . - 'thread-per-connection\'"'); +my $SV = $class->new('server', '-s'); $SV->Spawn (); my $server = $SV->WaitKill(5); if ($server != 0) { @@ -28,8 +25,7 @@ if ($server != 0) { ## Next, test that the -ORBSvcConfDirective gives an error with bad ## options. -$SV = $class->new('server', - '-ORBSvcConfDirective "static Foo_Strategy_Factory"'); +$SV = $class->new('server', '-f'); ## Run the server, but redirect stdout and stderr to /dev/null ## so that the errors messages don't show up on the scoreboard diff --git a/TAO/tests/Bug_2735_Regression/server.cpp b/TAO/tests/Bug_2735_Regression/server.cpp index a919be6b402..81ddd5493ab 100644 --- a/TAO/tests/Bug_2735_Regression/server.cpp +++ b/TAO/tests/Bug_2735_Regression/server.cpp @@ -1,17 +1,72 @@ // $Id$ #include "tao/ORB.h" +#include "ace/Get_Opt.h" +#include "ace/Service_Config.h" ACE_RCSID (Bug_2735_Regression, server, "$Id$") +static const ACE_TCHAR* server_strat = + ACE_STATIC_SERVICE_DIRECTIVE ("Server_Strategy_Factory", + "-ORBConcurrency thread-per-connection"); +static const ACE_TCHAR* foo_strat = + ACE_STATIC_SERVICE_DIRECTIVE ("Foo_Strategy_Factory", ""); + +enum Strategy { SERVER, FOO }; + +static Strategy strategy = SERVER; + +static int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("fs")); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'f': + strategy = FOO; + break; + case 's': + strategy = SERVER; + break; + case '?': + default: + ACE_ERROR_RETURN ((LM_ERROR, + "usage: %s " + "-f " + "-s " + "\n", + argv [0]), + -1); + } + return 0; +} + + int -main (int argc, char *argv[]) +ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { try { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + if (parse_args (argc, argv) == -1) + return -1; + + int targc = 3; + char* targv[] = { "server", "-ORBSvcConfDirective", 0 }; + switch (strategy) + { + case FOO: + targv[2] = const_cast<char*> (ACE_TEXT_ALWAYS_CHAR (foo_strat)); + break; + case SERVER: + targv[2] = const_cast<char*> (ACE_TEXT_ALWAYS_CHAR (server_strat)); + break; + } + CORBA::ORB_var orb = CORBA::ORB_init (targc, targv); orb->destroy (); } catch (const CORBA::Exception& ex) |