/[notice-sender]/trunk/t/2_soap.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/2_soap.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (show annotations)
Tue May 17 22:27:09 2005 UTC (18 years, 11 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1323 byte(s)
fix segfault

1 #!/usr/bin/perl -w
2
3 use strict;
4 use blib;
5
6 use Test::More tests => 11;
7
8 BEGIN {
9 use_ok('Nos');
10 use_ok('SOAP::Transport::HTTP');
11 use_ok('SOAP::Lite');
12 };
13
14 ok(my $nos = new Nos::SOAP('dsn' => 'dbi:Pg:dbname=notices'), "new");
15
16 ok(my $daemon = new SOAP::Transport::HTTP::Daemon(LocalAddr => 'localhost')->dispatch_to('Nos::SOAP'), "SOAP daemon");
17
18 my $pid;
19
20 unless ($pid = fork) {
21
22 local $SIG{HUP} = sub {
23 diag "exiting SOAP server";
24 exit 0;
25 };
26
27 diag "SOAP server at ", $daemon->url;
28 $daemon->handle;
29
30 }
31
32 diag "child pid: $pid";
33
34 my $soap = SOAP::Lite
35 ->readable(1)
36 ->uri('http://localhost/Nos/SOAP/')
37 ->proxy($daemon->url);
38
39 ok(my $list_id = $soap->NewList({
40 list => 'SOAP test',
41 email => 'soap-test@example.com',
42 })->result, "NewList");
43
44 diag "list_id: $list_id";
45
46 ok(my $member_id = $soap->AddMemberToList({
47 list => 'SOAP test',
48 email => 'dpavlin@rot13.org',
49 name => 'Dobrica Pavlinusic',
50 })->result, "AddMemberToList");
51
52 diag "member_id: $member_id";
53
54 ok(my $message_id = $soap->AddMessageToList({
55 list => 'SOAP test',
56 message => 'To: member@example.com
57 From: mylist@example.com
58 Subject: text
59
60 This is a dummy test
61 ',
62 })->result, "AddMessageToList");
63
64 diag "message_id: $message_id";
65
66 ok(kill('HUP' => $pid), "kill $pid");
67
68 ok(waitpid($pid,0), "waitpid");
69
70 ok(! kill(0, $pid), "child dead");
71
72 exit 1;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26