/[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

Diff of /trunk/t/2_soap.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 63 by dpavlin, Wed Jun 22 16:42:06 2005 UTC revision 68 by dpavlin, Mon Aug 1 08:59:36 2005 UTC
# Line 3  Line 3 
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('dsn' => 'dbi:Pg:dbname=notices'), "new");  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',
26            'aliases' => $aliases,
27    ), "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;
# Line 40  my $soap = SOAP::Lite Line 50  my $soap = SOAP::Lite
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(
# Line 180  ok(waitpid($pid,0), "waitpid"); Line 192  ok(waitpid($pid,0), "waitpid");
192  ok(! kill(0, $pid), "child dead");  ok(! kill(0, $pid), "child dead");
193    
194  exit 1;  exit 1;
195    

Legend:
Removed from v.63  
changed lines
  Added in v.68

  ViewVC Help
Powered by ViewVC 1.1.26