/[cwmp]/google/trunk/t/20-response.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 /google/trunk/t/20-response.t

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

revision 33 by dpavlin, Tue Jun 19 00:03:01 2007 UTC revision 53 by dpavlin, Tue Jun 19 22:06:46 2007 UTC
# Line 4  use warnings; Line 4  use warnings;
4    
5  my $debug = shift @ARGV;  my $debug = shift @ARGV;
6    
7  use Test::More tests => 4;  use Test::More tests => 9;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use blib;  use blib;
10    
# Line 18  BEGIN { Line 18  BEGIN {
18  ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );  ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );
19  isa_ok( $response, 'CWMP::Response' );  isa_ok( $response, 'CWMP::Response' );
20    
21  ok( my $inform = $response->Inform, 'Inform' );  sub is_like {
22            my ( $command, $template_xml ) = @_;
23    
24  diag $inform if $debug;          ok( my $xml = $response->$command({ ID => 42 }), $command );
25            diag $xml if $debug;
26            chomp( $xml );
27            chomp( $template_xml );
28            like( $xml, qr{^\Q$template_xml\E$}, $command . ' xml' );
29    }
30    
31    is_like( 'Inform', <<__SOAP__
32    <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
33      <soap:Header>
34        <cwmp:ID mustUnderstand="1">42</cwmp:ID>
35        <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
36      </soap:Header>
37      <soap:Body>
38        <cwmp:InformResponse>
39          <cwmp:MaxEnvelopes>1</cwmp:MaxEnvelopes>
40        </cwmp:InformResponse>
41      </soap:Body>
42    </soap:Envelope>
43    __SOAP__
44    );
45    
46    is_like( 'GetRPCMethods', <<__SOAP__
47    <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
48      <soap:Header>
49        <cwmp:ID mustUnderstand="1">42</cwmp:ID>
50        <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
51      </soap:Header>
52      <soap:Body>
53        <GetRPCMethods />
54      </soap:Body>
55    </soap:Envelope>
56    __SOAP__
57    );
58    
59    is_like( 'Reboot', <<__SOAP__
60    <soap:Envelope xmlns:cwmp="urn:dslforum-org:cwmp-1-0" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
61      <soap:Header>
62        <cwmp:ID mustUnderstand="1">42</cwmp:ID>
63        <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
64      </soap:Header>
65      <soap:Body>
66        <Reboot />
67      </soap:Body>
68    </soap:Envelope>
69    __SOAP__
70    );

Legend:
Removed from v.33  
changed lines
  Added in v.53

  ViewVC Help
Powered by ViewVC 1.1.26