Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / ForwardUponObjectNotExist / run_test.pl
blob026424f2b050c5c58365d534735bce24f6ffde9b
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
5 # -*- perl -*-
7 use lib "$ENV{ACE_ROOT}/bin";
8 use PerlACE::TestTarget;
10 $status = 0;
11 $debug_level = '0';
13 foreach $i (@ARGV) {
14 if ($i eq '-debug') {
15 $debug_level = '10';
19 my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n";
20 my $client1 = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n";
21 my $client2 = PerlACE::TestTarget::create_target (3) || die "Create target 3 failed\n";
23 my $iorfile = "test.ior";
25 #Files which used by server
26 my $server_iorfile = $server->LocalFile ($iorfile);
27 $server->DeleteFile($iorfile);
29 $hostname = $server->HostName ();
30 $port = $server->RandomPort ();
32 $SV = $server->CreateProcess ("server",
33 "-ORBdebuglevel $debug_level " .
34 "-ORBEndpoint iiop://$hostname:$port " .
35 "-o $server_iorfile");
37 # Client 1 expects OBJECT_NOT_EXIST exception ("-e 1")
38 $CL1 = $client1->CreateProcess ("client",
39 "-ORBdebuglevel $debug_level " .
40 "-k corbaloc::$hostname:$port/Simple_Server " .
41 "-e 1 " .
42 "-ORBForwardInvocationOnObjectNotExist 0");
44 # Client 2 does not expects OBJECT_NOT_EXIST exception ("-e 0")
45 $CL2 = $client2->CreateProcess ("client",
46 "-ORBdebuglevel $debug_level " .
47 "-x -k corbaloc::$hostname:$port/Simple_Server " .
48 "-e 0 " .
49 "-ORBForwardInvocationOnObjectNotExist 1");
51 $server_status = $SV->Spawn ();
53 if ($server_status != 0) {
54 print STDERR "ERROR: server returned $server_status\n";
55 exit 1;
58 if ($server->WaitForFileTimed ($iorfile,
59 $server->ProcessStartWaitInterval()) == -1) {
60 print STDERR "ERROR: cannot find file <$server_iorfile>\n";
61 KillServers ();
62 exit 1;
67 print STDERR "==== Running first client with -ORBForwardInvocationOnObjectNotExist 0\n";
69 $client_status = $CL1->SpawnWaitKill ($client1->ProcessStartWaitInterval() + 45);
71 if ($client_status != 0) {
72 print STDERR "ERROR: client returned $client_status\n";
73 $status = 1;
76 print STDERR "==== Running second client with -ORBForwardInvocationOnObjectNotExist 1\n";
78 $client_status = $CL2->SpawnWaitKill ($client2->ProcessStartWaitInterval() + 45);
80 if ($client_status != 0) {
81 print STDERR "ERROR: client returned $client_status\n";
82 $status = 1;
85 $server_status = $SV->WaitKill ($server->ProcessStopWaitInterval());
87 if ($server_status != 0) {
88 print STDERR "ERROR: server returned $server_status\n";
89 $status = 1;
92 $server->DeleteFile($iorfile);
94 exit $status;