diff options
author | Angelo Corsaro <angelo@icorsaro.net> | 2000-11-22 23:35:18 +0000 |
---|---|---|
committer | Angelo Corsaro <angelo@icorsaro.net> | 2000-11-22 23:35:18 +0000 |
commit | e426e065d5bd1e05d026a2f69aa903f1456ea1a3 (patch) | |
tree | 1b320394151745941aee014ca0a06786110709e0 /TAO/tests/Multiple | |
parent | b67c5e88a6a3cd3a44ce895bbda5a89e08b90d0c (diff) | |
download | ATCD-e426e065d5bd1e05d026a2f69aa903f1456ea1a3.tar.gz |
Wed Nov 22 17:37:37 2000 Angelo Corsaro <corsaro@cs.wustl.edu>
Diffstat (limited to 'TAO/tests/Multiple')
-rw-r--r-- | TAO/tests/Multiple/Collocation_Tester.cpp | 31 | ||||
-rw-r--r-- | TAO/tests/Multiple/Makefile | 2 | ||||
-rw-r--r-- | TAO/tests/Multiple/Multiple_Impl.cpp | 16 | ||||
-rw-r--r-- | TAO/tests/Multiple/client.cpp | 2 | ||||
-rwxr-xr-x | TAO/tests/Multiple/run_test.pl | 105 | ||||
-rw-r--r-- | TAO/tests/Multiple/server.cpp | 2 |
6 files changed, 139 insertions, 19 deletions
diff --git a/TAO/tests/Multiple/Collocation_Tester.cpp b/TAO/tests/Multiple/Collocation_Tester.cpp index 3050e02e3c8..886e9d81830 100644 --- a/TAO/tests/Multiple/Collocation_Tester.cpp +++ b/TAO/tests/Multiple/Collocation_Tester.cpp @@ -1,6 +1,9 @@ // $Id$ + #include "Collocation_Tester.h" +ACE_RCSID (tests, Collocation_Tester, "$Id$") + const char *Quote::top = "Ciao"; const char *Quote::left = "Hola"; const char *Quote::right = "Hello"; @@ -56,9 +59,9 @@ Collocation_Tester::test_top (CORBA::Environment &ACE_TRY_ENV) ACE_TEXT ("\n\nCalling all method supported by the Interface Top\n\n"))); CORBA::String_var msg = top->top_quote (ACE_TRY_ENV); - ACE_TRY_CHECK; + ACE_CHECK_RETURN (0); - failure += this->match_answer (Quote.top, msg.in (), "top_quote"); + failure += this->match_answer (Quote::top, msg.in (), "top_quote"); if (failure) ACE_ERROR ((LM_DEBUG, @@ -91,14 +94,14 @@ Collocation_Tester::test_right (CORBA::Environment &ACE_TRY_ENV) ACE_TEXT ("\n\nCalling all method supported by the Interface Right\n\n"))); CORBA::String_var msg = right->top_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (1); - failure += this->match_answer (Quote.top, msg.in (), "top_quote"); + failure += this->match_answer (Quote::top, msg.in (), "top_quote"); msg = right->right_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (1); - failure += this->match_answer (Quote.right, msg.in (), "right_quote"); + failure += this->match_answer (Quote::right, msg.in (), "right_quote"); if (failure) ACE_ERROR ((LM_DEBUG, @@ -133,14 +136,14 @@ Collocation_Tester::test_left (CORBA::Environment &ACE_TRY_ENV) ACE_TEXT ("\n\nCalling all method supported by the Interface Left\n\n"))); CORBA::String_var msg = left->top_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (1); - failure += this->match_answer (Quote.top, msg.in (), "top_quote"); + failure += this->match_answer (Quote::top, msg.in (), "top_quote"); msg = left->left_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN(1); - failure += this->match_answer (Quote.left, msg.in (), "left_quote"); + failure += this->match_answer (Quote::left, msg.in (), "left_quote"); if (failure) ACE_ERROR ((LM_DEBUG, @@ -175,22 +178,22 @@ Collocation_Tester::test_bottom (CORBA::Environment &ACE_TRY_ENV) ACE_TEXT ("\n\nCalling all method supported by the Interface Bottom\n\n"))); CORBA::String_var msg = bottom->top_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN(1); failure += this->match_answer (Quote::top, msg.in (), "top_quote"); msg = bottom->left_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN (1); failure += this->match_answer (Quote::left, msg.in (), "left_quote"); msg = bottom->right_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN(1); failure += this->match_answer (Quote::right, msg.in (), "right_quote"); msg = bottom->bottom_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN(1); failure += this->match_answer (Quote::bottom, msg.in (), "bottom_quote"); diff --git a/TAO/tests/Multiple/Makefile b/TAO/tests/Multiple/Makefile index e3d0f362f88..949f96acb58 100644 --- a/TAO/tests/Multiple/Makefile +++ b/TAO/tests/Multiple/Makefile @@ -26,7 +26,7 @@ BIN = client server SRC = $(addsuffix .cpp, $(MISC_TEST_SRC) $(BIN)) -CLIENT_OBJ = $(addsuffix .o, $(CLIENT_SRC)) MultipleC.o +CLIENT_OBJ = $(addsuffix .o, $(CLIENT_SRC)) $(IDL_SRC:.cpp=.o) SERVER_OBJ = $(addsuffix .o, $(SERVER_SRC)) $(IDL_SRC:.cpp=.o) TAO_IDLFLAGS += -Ge 1 -Gd diff --git a/TAO/tests/Multiple/Multiple_Impl.cpp b/TAO/tests/Multiple/Multiple_Impl.cpp index b9658e9983a..18d076603d0 100644 --- a/TAO/tests/Multiple/Multiple_Impl.cpp +++ b/TAO/tests/Multiple/Multiple_Impl.cpp @@ -3,6 +3,8 @@ #include "Multiple_Impl.h" #include "Collocation_Tester.h" +ACE_RCSID (tests, Multiple_Impl, "$Id$") + /////////////////////////////////////////////////////////// // Bottom_Impl Implementation // @@ -19,30 +21,35 @@ Bottom_Impl::~Bottom_Impl (void) char * Bottom_Impl::top_quote (CORBA::Environment &ACE_TRY_ENV) { + ACE_UNUSED_ARG (ACE_TRY_ENV); return CORBA::string_dup(Quote::top); } char * Bottom_Impl::left_quote (CORBA::Environment &ACE_TRY_ENV) { + ACE_UNUSED_ARG (ACE_TRY_ENV); return CORBA::string_dup(Quote::left); } char * Bottom_Impl::right_quote (CORBA::Environment &ACE_TRY_ENV) { + ACE_UNUSED_ARG (ACE_TRY_ENV); return CORBA::string_dup(Quote::right); } char * Bottom_Impl::bottom_quote (CORBA::Environment &ACE_TRY_ENV) { + ACE_UNUSED_ARG (ACE_TRY_ENV); return CORBA::string_dup(Quote::bottom); } void Bottom_Impl::shutdown (CORBA::Environment &ACE_TRY_ENV) { + ACE_UNUSED_ARG (ACE_TRY_ENV); this->orb_->shutdown (0, ACE_TRY_ENV); } @@ -69,7 +76,7 @@ Delegated_Bottom_Impl::top_quote (CORBA::Environment &ACE_TRY_ENV) CORBA::String_var msg = this->delegate_->top_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN ("ERROR"); return msg._retn (); } @@ -81,7 +88,7 @@ Delegated_Bottom_Impl::left_quote (CORBA::Environment &ACE_TRY_ENV) CORBA::String_var msg = this->delegate_->left_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN ("ERROR"); return msg._retn (); } @@ -93,7 +100,7 @@ Delegated_Bottom_Impl::right_quote (CORBA::Environment &ACE_TRY_ENV) CORBA::String_var msg = this->delegate_->right_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN ("ERROR"); return msg._retn (); } @@ -105,7 +112,7 @@ Delegated_Bottom_Impl::bottom_quote (CORBA::Environment &ACE_TRY_ENV) CORBA::String_var msg = this->delegate_->bottom_quote (ACE_TRY_ENV); - ACE_CHECK; + ACE_CHECK_RETURN ("ERROR"); return msg._retn (); } @@ -118,4 +125,5 @@ Delegated_Bottom_Impl::shutdown (CORBA::Environment &ACE_TRY_ENV) //this->orb_->shutdown (0, ACE_TRY_ENV); ACE_CHECK; + } diff --git a/TAO/tests/Multiple/client.cpp b/TAO/tests/Multiple/client.cpp index e13b46cac04..79e171ef16e 100644 --- a/TAO/tests/Multiple/client.cpp +++ b/TAO/tests/Multiple/client.cpp @@ -2,6 +2,8 @@ # include "Collocation_Tester.h" +ACE_RCSID (tests, client, "$Id$") + int main (int argc, char *argv[]) { ACE_DECLARE_NEW_CORBA_ENV; diff --git a/TAO/tests/Multiple/run_test.pl b/TAO/tests/Multiple/run_test.pl new file mode 100755 index 00000000000..789f921beb4 --- /dev/null +++ b/TAO/tests/Multiple/run_test.pl @@ -0,0 +1,105 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "../../../bin"; +require Process; + + +unshift @INC, '../../../bin'; +require ACEutils; +use Cwd; + + +$status = 0; +$EXEPREFIX = "./"; +$DIRECT_COLLOC = "-ORBCollocationStrategy direct"; +$NO_COLLOC = "-ORBCollocation no"; + +$cwd = getcwd(); + +$iorfile = "$cwd$DIR_SEPARATOR" . "s.ior"; +unlink $iorfile; + +ACE::checkForTarget($cwd); + +# +# Test using ThruPOA collocation. +# + + +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT ", + ""); + +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; +} + + +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); + +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = 1; + $Client->Kill (); +} + +$Server->Kill (); + + +# +# Test using Direct Collocation +# + +unlink $iorfile; + +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT", $DIRECT_COLLOC); + +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; +} + + +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); + +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = $status+1; + $Client->Kill (); +} + +$Server->Kill (); + +# +# Test using No Collocation +# + +unlink $iorfile; + +$Server = Process::Create ($EXEPREFIX."server$EXE_EXT", $NO_COLLOC); + +if (ACE::waitforfile_timed ($iorfile, 5) == -1) { + print STDERR "ERROR: cannot find file <$iorfile>\n"; + $Server->Kill (); $Server->TimedWait (1); + exit 1; +} + + +$Client = Process::Create($EXEPREFIX."client$EXE_EXT", ""); + +if ($Client->TimedWait (60) == -1) { + print STDERR "ERROR: client timedout\n"; + $status = $status+1; + $Client3->Kill (); +} + +$Server->Kill (); + +exit $status diff --git a/TAO/tests/Multiple/server.cpp b/TAO/tests/Multiple/server.cpp index 39997cac8be..576e662898a 100644 --- a/TAO/tests/Multiple/server.cpp +++ b/TAO/tests/Multiple/server.cpp @@ -2,6 +2,8 @@ #include "Multiple_Impl.h" +ACE_RCSID (tests, server, "$Id$") + int main (int argc, char *argv[]) { |