/[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 39 - (show annotations)
Tue May 17 22:23:40 2005 UTC (18 years, 10 months ago) by dpavlin
File MIME type: application/x-troff
File size: 1301 byte(s)
moved Nos::SOAP package to Nos.pm, added SOAP tests

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 $SIG{CHLD} = 'IGNORE';
21
22 unless ($pid = fork) {
23 diag "SOAP server at ", $daemon->url;
24 $daemon->handle;
25 }
26
27 diag "child pid: $pid";
28
29 my $soap = SOAP::Lite
30 ->readable(1)
31 ->uri('http://localhost/Nos/SOAP/')
32 ->proxy($daemon->url);
33
34 ok(my $list_id = $soap->NewList({
35 list => 'SOAP test',
36 email => 'soap-test@example.com',
37 })->result, "NewList");
38
39 diag "list_id: $list_id";
40
41 ok(my $member_id = $soap->AddMemberToList({
42 list => 'SOAP test',
43 email => 'dpavlin@rot13.org',
44 name => 'Dobrica Pavlinusic',
45 })->result, "AddMemberToList");
46
47 diag "member_id: $member_id";
48
49 ok(my $message_id = $soap->AddMessageToList({
50 list => 'SOAP test',
51 message => 'To: member@example.com
52 From: mylist@example.com
53 Subject: text
54
55 This is a dummy test
56 ',
57 })->result, "AddMessageToList");
58
59 diag "message_id: $message_id";
60
61 ok(kill('TERM' => $pid), "kill $pid");
62
63 sleep 1;
64 print `ps ax`;
65
66 ok(! kill(0, $pid), "child dead");
67
68 ok(waitpid($pid,0), "waitpid");
69
70 exit 1;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26