/[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 66 by dpavlin, Fri Jul 8 11:46:35 2005 UTC revision 70 by dpavlin, Tue Aug 2 19:41:28 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(  $debug = 1 if (@ARGV);
19    
20    my $aliases = Cwd::abs_path($0);
21    $aliases =~ s#/[^/]*$#/#;
22    $aliases .= 'aliases';
23    
24    ok($aliases, "using aliases file $aliases");
25    
26    ok(new Nos::SOAP(
27          'dsn' => 'dbi:Pg:dbname=notices',          'dsn' => 'dbi:Pg:dbname=notices',
28          'aliases' => './t/aliases',          'aliases' => $aliases,
29  ), "new");  ), "new");
30    
31  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");
32    
   
33  # start server  # start server
34    
35  my $pid;  my $pid;
# Line 43  my $soap = SOAP::Lite Line 52  my $soap = SOAP::Lite
52          ->uri('http://localhost/Nos/SOAP/')          ->uri('http://localhost/Nos/SOAP/')
53          ->proxy($daemon->url);          ->proxy($daemon->url);
54    
55    $soap->on_debug(sub{print "## ", join("\n## ",@_), "\n";}) if ($debug);
56    
57  # NewList  # NewList
58    
59  ok(my $list_id = $soap->NewList({  ok(my $list_id = $soap->NewList({
60          list => $list_name,                  list => $list_name,
61          from => 'SOAP list',                  from => 'SOAP list',
62          email => 'soap-test@example.com',                  email => 'soap-test@example.com',
63  })->result, "NewList named");  })->result, "NewList named");
64    
65  ok(my $list_id2 = $soap->NewList(  ok(my $list_id2 = $soap->NewList(
# Line 183  ok(waitpid($pid,0), "waitpid"); Line 194  ok(waitpid($pid,0), "waitpid");
194  ok(! kill(0, $pid), "child dead");  ok(! kill(0, $pid), "child dead");
195    
196  exit 1;  exit 1;
197    

Legend:
Removed from v.66  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.26