www.pudn.com > Messenger.rar > run_test.pl


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");
$arg_ns_ref = "-ORBInitRef NameService=file://$nsiorfile";
unlink $nsiorfile;

# 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 Notification Service

$NotifyService = "$ENV{TAO_ROOT}/orbsvcs/Notify_Service/Notify_Service";
$NFS = new PerlACE::Process($NotifyService, $arg_ns_ref);
$NFS->Spawn();
select undef, undef, undef, .11; 

# start MessengerServer
$S = new PerlACE::Process("MessengerServer", $arg_ns_ref);
$S->Spawn();
select undef, undef, undef, .11; 

# start MessengerConsumer
$MC = new PerlACE::Process("MessengerConsumer", $arg_ns_ref);
$MC->Spawn();
select undef, undef, undef, .11; 

# start MessengerClient
$C = new PerlACE::Process("MessengerClient", $arg_ns_ref);

if ($C->SpawnWaitKill(10) == -1) {
     $MC->Kill();
     $S->Kill();
     $NFS->Kill();
     $NS->Kill();
     exit (1);
}

$MC->Kill();
$S->Kill();
$NFS->Kill();
$NS->Kill();

unlink $nsiorfile;

exit 0;