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
;
20 ## Specify and endpoint so that we may test the corbaloc in the
21 ## -ORBInitRef. We retain one -ORBInitRef using the file just to test
24 my $server = PerlACE
::TestTarget
::create_target
(1) || die "Create target 1 failed\n";
25 my $import_test = PerlACE
::TestTarget
::create_target
(2) || die "Create target 2 failed\n";
26 my $export_test = PerlACE
::TestTarget
::create_target
(3) || die "Create target 3 failed\n";
28 $port = $server->RandomPort();
30 my $iorbase = "trading.ior";
31 my $ready = "export_test_ready";
33 my $server_iorfile = $server->LocalFile ($iorbase);
34 my $import_iorfile = $import_test->LocalFile ($iorbase);
35 $server->DeleteFile($iorbase);
36 $import_test->DeleteFile($iorbase);
39 my $export_ready_file = $export_test->LocalFile ($ready);
40 $export_test->DeleteFile($ready);
42 $SV = $server->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/Trading_Service/tao_costrading",
43 "-ORBdebuglevel $debug_level ".
44 "-ORBlogfile trader.log " .
45 "-ORBEndpoint iiop://:$port " .
46 "-TSdumpior $server_iorfile");
48 $CL1 = $export_test->CreateProcess ("export_test",
49 "-ORBInitRef TradingService=corbaloc:::$port/TradingService " .
50 "-d $export_ready_file " .
53 $CL2 = $import_test->CreateProcess ("import_test",
54 "-ORBInitRef TradingService=file://$import_iorfile " .
57 $server_status = $SV->Spawn ();
59 if ($server_status != 0) {
60 print STDERR
"ERROR: server returned $server_status\n";
64 if ($server->WaitForFileTimed ($iorbase,
65 $server->ProcessStartWaitInterval()) == -1) {
66 print STDERR
"ERROR: cannot find file <$server_iorfile>\n";
67 $SV->Kill (); $SV->TimedWait (1);
71 $client_status = $CL1->Spawn ();
73 if ($client_status != 0) {
74 print STDERR
"ERROR: server returned $server_status\n";
75 $SV->Kill (); $SV->TimedWait (1);
79 if ($export_test->WaitForFileTimed ($ready,
80 $export_test->ProcessStartWaitInterval()) == -1) {
81 print STDERR
"ERROR: cannot find file <$ready>\n";
82 $SV->Kill (); $SV->TimedWait (1);
83 $CL1->Kill (); $CL1->TimedWait (1);
87 if ($server->GetFile ($iorbase) == -1) {
88 print STDERR
"ERROR: cannot retrieve file <$server_iorfile>\n";
89 $SV->Kill (); $SV->TimedWait (1);
92 if ($import_test->PutFile ($iorbase) == -1) {
93 print STDERR
"ERROR: cannot set file <$import_iorfile>\n";
94 $SV->Kill (); $SV->TimedWait (1);
98 $client_status = $CL2->SpawnWaitKill ($import_test->ProcessStartWaitInterval());
100 if ($client_status != 0) {
101 print STDERR
"ERROR: client returned $client_status\n";
108 $server->DeleteFile($iorbase);
109 $import_test->DeleteFile($iorbase);
110 $export_test->DeleteFile($ready);