summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl
blob: 0b18e00ceb0da8c431f354f7801d97360b71f754 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

# $Id$
# -*- perl -*-

# ex

use lib "$ENV{ACE_ROOT}/bin";
use PerlACE::Run_Test;
use File::Compare;

$ACE_ROOT = $ENV{ACE_ROOT};
$TAO_ROOT = "$ACE_ROOT/TAO";

$port = 12000 + PerlACE::uniqueid ();

sub cleanup() {
  unlink "loadtest.xml";
  unlink "abc.xml";
  for ($i = 0; $i < 10; ++$i) {
    unlink "abc.00" . $i;
  }
  for ($i = 10; $i < 20; ++$i) {
    unlink "abc.0" . $i;
  }
}

cleanup();

$ret = 0;

$UTEST = new PerlACE::Process("main", "-ORBEndpoint iiop://:$port");
$ret = $UTEST->SpawnWaitKill(10);
if ($ret != 0) {
  print "ERROR : main returned $ret\n";
  exit $ret;
}

# NOTE: In TAO 1.3a main ran the notification service twice
# producing both abc.xml and loadtest.xml.  Unfortunately
# in TAO 1.4 the notification service will does not run
# successfully the second time in the same EXE.
# -- todo figure out why and fix it.
# Thus main was modified to run in two passes.  If loadtest.xml
# exists, it runs pass 2.
$ret = $UTEST->SpawnWaitKill(10);
if ($ret != 0) {
  print "ERROR : main returned $ret\n";
  exit $ret;
}

$different = compare("loadtest.xml", "abc.xml");
if ($different) {
  print "ERROR : loadtest.xml != abc.xml\n";
  exit 1;
} else {
  print "Success : loadtest.xml == abc.xml\n";
  cleanup();
}


exit $ret;