1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
7 use lib
"$ENV{ACE_ROOT}/bin";
8 use PerlACE
::TestTarget
;
19 my $ns_service = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
20 my $lg_service = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
21 my $client = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
23 my $iorbase = "ns.ior";
24 my $ns_iorfile = $ns_service->LocalFile ($iorbase);
25 my $lg_iorfile = $lg_service->LocalFile ($iorbase);
26 my $client_iorfile = $client->LocalFile ($iorbase);
27 $ns_service->DeleteFile ($iorbase);
28 $lg_service->DeleteFile ($iorbase);
29 $client->DeleteFile ($iorbase);
31 $NS = $ns_service->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Naming_Service/tao_cosnaming",
33 $LS = $lg_service->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Logging_Service/Basic_Logging_Service/tao_tls_basic",
34 "-ORBInitRef NameService=file://$lg_iorfile");
35 $CL = $client->CreateProcess ("client", "-ORBInitRef NameService=file://$client_iorfile");
37 print STDERR
"Starting Naming Service\n";
39 $process_status = $NS->Spawn ();
41 if ($process_status != 0) {
42 print STDERR
"ERROR: naming service returned $process_status\n";
46 if ($ns_service->WaitForFileTimed ($iorbase,
47 $ns_service->ProcessStartWaitInterval()) == -1) {
48 print STDERR
"ERROR: cannot find file <$ns_iorfile>\n";
49 $NS->Kill (); $NS->TimedWait (1);
53 if ($ns_service->GetFile ($iorbase) == -1) {
54 print STDERR
"ERROR: cannot retrieve file <$ns_iorfile>\n";
55 $NS->Kill (); $NS->TimedWait (1);
59 if ($lg_service->PutFile ($iorbase) == -1) {
60 print STDERR
"ERROR: cannot set file <$lg_iorfile>\n";
61 $NS->Kill (); $NS->TimedWait (1);
65 if ($client->PutFile ($iorbase) == -1) {
66 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
67 $NS->Kill (); $NS->TimedWait (1);
71 print STDERR
"Starting Logging Service\n";
73 $process_status = $LS->Spawn ();
75 if ($process_status != 0) {
76 print STDERR
"ERROR: logging service returned $process_status\n";
77 $NS->Kill (); $NS->TimedWait (1);
81 # Give time for logging service to initialize and install its object
82 # reference in the nameing service.
85 print STDERR
"Starting client\n";
87 $process_status = $CL->SpawnWaitKill ($client->ProcessStartWaitInterval());
89 if ($process_status != 0) {
90 print STDERR
"ERROR: client returned $process_status\n";
97 $ns_service->DeleteFile ($iorbase);
98 $lg_service->DeleteFile ($iorbase);
99 $client->DeleteFile ($iorbase);