3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 36; |
use Test::More tests => 38; |
7 |
|
|
8 |
BEGIN { |
BEGIN { |
9 |
use_ok('Nos'); |
use_ok('Nos'); |
10 |
use_ok('SOAP::Transport::HTTP'); |
use_ok('SOAP::Transport::HTTP'); |
11 |
use_ok('SOAP::Lite'); |
use_ok('SOAP::Lite'); |
12 |
|
use_ok('Cwd'); |
13 |
}; |
}; |
14 |
|
|
15 |
|
my $debug = 0; |
16 |
my $list_name = 'SOAP test'; |
my $list_name = 'SOAP test'; |
17 |
|
|
18 |
ok(my $nos = new Nos::SOAP( |
my $aliases = Cwd::abs_path($0); |
19 |
|
$aliases =~ s#/[^/]*$#/#; |
20 |
|
$aliases .= 'aliases'; |
21 |
|
|
22 |
|
ok($aliases, "using aliases file $aliases"); |
23 |
|
|
24 |
|
ok(new Nos::SOAP( |
25 |
'dsn' => 'dbi:Pg:dbname=notices', |
'dsn' => 'dbi:Pg:dbname=notices', |
26 |
'aliases' => './t/aliases', |
'aliases' => $aliases, |
27 |
), "new"); |
), "new"); |
28 |
|
|
29 |
ok(my $daemon = new SOAP::Transport::HTTP::Daemon(LocalAddr => 'localhost')->dispatch_to('Nos::SOAP'), "SOAP daemon"); |
ok(my $daemon = new SOAP::Transport::HTTP::Daemon(LocalAddr => 'localhost')->dispatch_to('Nos::SOAP'), "SOAP daemon"); |
30 |
|
|
|
|
|
31 |
# start server |
# start server |
32 |
|
|
33 |
my $pid; |
my $pid; |
50 |
->uri('http://localhost/Nos/SOAP/') |
->uri('http://localhost/Nos/SOAP/') |
51 |
->proxy($daemon->url); |
->proxy($daemon->url); |
52 |
|
|
53 |
|
$soap->on_debug(sub{print "# CLIENT ",@_}) if ($debug); |
54 |
|
|
55 |
# NewList |
# NewList |
56 |
|
|
57 |
ok(my $list_id = $soap->NewList({ |
ok(my $list_id = $soap->NewList({ |
58 |
list => $list_name, |
list => $list_name, |
59 |
from => 'SOAP list', |
from => 'SOAP list', |
60 |
email => 'soap-test@example.com', |
email => 'soap-test@example.com', |
61 |
})->result, "NewList named"); |
})->result, "NewList named"); |
62 |
|
|
63 |
ok(my $list_id2 = $soap->NewList( |
ok(my $list_id2 = $soap->NewList( |
192 |
ok(! kill(0, $pid), "child dead"); |
ok(! kill(0, $pid), "child dead"); |
193 |
|
|
194 |
exit 1; |
exit 1; |
195 |
|
|