summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
diff options
context:
space:
mode:
authorAbdullah Sowayan <sowayan@users.noreply.github.com>2008-10-21 20:47:43 +0000
committerAbdullah Sowayan <sowayan@users.noreply.github.com>2008-10-21 20:47:43 +0000
commitd2911d5b9eb897d3da7d458ebf5ba8b998bc7763 (patch)
tree3158327d3787df5b439329fac177f20a12857c62 /TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
parentf8ea2bc5a4d98525f6f290d8272663e46aa1de74 (diff)
downloadATCD-d2911d5b9eb897d3da7d458ebf5ba8b998bc7763.tar.gz
Tue Oct 21 19:10:21 UTC 2008 Abdullah Sowayan <abdullah.sowayan@lmco.com>
Diffstat (limited to 'TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl')
-rw-r--r--TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl61
1 files changed, 61 insertions, 0 deletions
diff --git a/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl b/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
new file mode 100644
index 00000000000..78ced481eb9
--- /dev/null
+++ b/TAO/DevGuideExamples/EventServices/OMG_Basic/run_test.pl
@@ -0,0 +1,61 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
+ & eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+use Env (ACE_ROOT);
+use lib "$ACE_ROOT/bin";
+use PerlACE::Run_Test;
+
+$nsiorfile = PerlACE::LocalFile ("ns.ior");
+$esiorfile = PerlACE::LocalFile ("es.ior");
+$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+# start Naming Service
+
+$NameService = "$ENV{TAO_ROOT}/orbsvcs/Naming_Service/Naming_Service";
+$NS = new PerlACE::Process($NameService, "-o $nsiorfile");
+$NS->Spawn();
+if (PerlACE::waitforfile_timed ($nsiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$nsiorfile>\n";
+ $NS->Kill();
+ exit 1;
+}
+
+# start Event Service
+$EventService = "$ENV{TAO_ROOT}/orbsvcs/CosEvent_Service/CosEvent_Service";
+$ES = new PerlACE::Process($EventService, "-o $esiorfile $arg_ns_ref");
+$ES->Spawn();
+if (PerlACE::waitforfile_timed ($esiorfile, 5) == -1) {
+ print STDERR "ERROR: cannot find file <$esiorfile>\n";
+ $ES->Kill();
+ unlink $nsiorfile;
+ exit 1;
+}
+
+# start EchoEventSupplier
+$S = new PerlACE::Process("EchoEventSupplier", $arg_ns_ref);
+$S->Spawn();
+
+# start EchoEventConsumer
+$C = new PerlACE::Process("EchoEventConsumer", $arg_ns_ref);
+$C->Spawn();
+
+$CRET = $C->WaitKill(60);
+$S->Kill();
+$NS->Kill();
+$ES->Kill();
+
+unlink $nsiorfile;
+unlink $esiorfile;
+
+if ($CRET != 0) {
+ print STDERR "ERROR: Client returned <$CRET>\n";
+ exit 1 ;
+}
+
+exit 0;
+
+