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

Annotation of /google/trunk/t/20-response.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 112 - (hide annotations)
Fri Oct 26 11:42:39 2007 UTC (16 years, 7 months ago) by dpavlin
File MIME type: application/x-troff
File size: 2451 byte(s)
reorg source code tree to make trunk
1 dpavlin 32 #!/usr/bin/perl
2     use strict;
3     use warnings;
4    
5     my $debug = shift @ARGV;
6    
7 dpavlin 59 use Test::More tests => 11;
8 dpavlin 32 use Data::Dump qw/dump/;
9     use blib;
10    
11     BEGIN {
12     use_ok('CWMP::Response');
13     }
14    
15     #ok( my $xml = join("",<DATA>), 'xml' );
16     #diag $xml if $debug;
17    
18     ok( my $response = CWMP::Response->new({ debug => $debug }), 'new' );
19     isa_ok( $response, 'CWMP::Response' );
20    
21 dpavlin 46 sub is_like {
22     my ( $command, $template_xml ) = @_;
23 dpavlin 32
24 dpavlin 46 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 dpavlin 71 is_like( 'InformResponse', <<__SOAP__
32 dpavlin 46 <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 dpavlin 45 <soap:Header>
34     <cwmp:ID mustUnderstand="1">42</cwmp:ID>
35 dpavlin 50 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
36 dpavlin 45 </soap:Header>
37     <soap:Body>
38     <cwmp:InformResponse>
39     <cwmp:MaxEnvelopes>1</cwmp:MaxEnvelopes>
40     </cwmp:InformResponse>
41     </soap:Body>
42 dpavlin 46 </soap:Envelope>
43     __SOAP__
44     );
45 dpavlin 45
46 dpavlin 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 dpavlin 50 <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
51 dpavlin 46 </soap:Header>
52     <soap:Body>
53     <GetRPCMethods />
54     </soap:Body>
55     </soap:Envelope>
56     __SOAP__
57     );
58 dpavlin 53
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     );
71 dpavlin 59
72     is_like( 'GetParameterNames', <<__SOAP__
73     <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/">
74     <soap:Header>
75     <cwmp:ID mustUnderstand="1">42</cwmp:ID>
76     <cwmp:NoMoreRequests>0</cwmp:NoMoreRequests>
77     </soap:Header>
78     <soap:Body>
79     <cwmp:GetParameterNames>
80     <cwmp:ParameterPath></cwmp:ParameterPath>
81     <cwmp:NextLevel>0</cwmp:NextLevel>
82     </cwmp:GetParameterNames>
83     </soap:Body>
84     </soap:Envelope>
85     __SOAP__
86     );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26