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
;
15 if (defined $ENV{'PATH'}) {
17 foreach $part (split($Config{'path_sep'}, $ENV{'PATH'})) {
38 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
39 my $client = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
41 my $iorbase = "server.ior";
42 my $server_iorfile = $server->LocalFile ($iorbase);
43 my $client_iorfile = $client->LocalFile ($iorbase);
44 $server->DeleteFile($iorbase);
45 $client->DeleteFile($iorbase);
47 $SV = $server->CreateProcess (which
("java"), "server");
48 $CL = $client->CreateProcess ("client", "-k file://$client_iorfile");
49 $server_status = $SV->Spawn ();
51 if ($server_status != 0) {
52 print STDERR
"ERROR: server returned $server_status\n";
56 if ($server->WaitForFileTimed ($iorbase,
57 $server->ProcessStartWaitInterval()) == -1) {
58 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
59 $SV->Kill (); $SV->TimedWait (1);
63 if ($server->GetFile ($iorbase) == -1) {
64 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
65 $SV->Kill (); $SV->TimedWait (1);
69 if ($client->PutFile ($iorbase) == -1) {
70 print STDERR
"ERROR: cannot set file <$client_iorfile>\n";
71 $SV->Kill (); $SV->TimedWait (1);
75 $client_status = $CL->Spawn ($client->ProcessStartWaitInterval() + 45);
77 if ($client_status != 0) {
78 print STDERR
"ERROR: client Spawn returned $client_status\n";
82 $client_status = $CL->WaitKill ($client->ProcessStopWaitInterval() + 45);
84 if ($client_status != 0) {
85 print STDERR
"ERROR: client WaitKill returned $client_status\n";
89 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
91 if ($server_status != 0) {
92 print STDERR
"ERROR: server returned $server_status\n";
96 $server->DeleteFile($iorbase);
97 $client->DeleteFile($iorbase);