~ubuntu-branches/ubuntu/trusty/wget/trusty-updates

« back to all changes in this revision

Viewing changes to tests/HTTPTest.pm

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2009-12-12 08:15:59 UTC
  • mfrom: (2.1.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091212081559-mvccl4kzdqb138y3
Tags: 1.12-1.1ubuntu1
* Merge from debian testing, remaining changes:
  - Add wget-udeb to ship wget.gnu as alternative to busybox wget
    implementation.
* Keep build dependencies in main:
  - debian/control: remove info2man build-dep
  - debian/patches/00list: disable wget-infopod_generated_manpage.dpatch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
 
3
1
package HTTPTest;
4
2
 
5
3
use strict;
 
4
use warnings;
6
5
 
7
6
use HTTPServer;
8
7
use WgetTest;
14
13
{
15
14
    my %_attr_data = ( # DEFAULT
16
15
    );
17
 
    
 
16
 
18
17
    sub _default_for
19
18
    {
20
19
        my ($self, $attr) = @_;
22
21
        return $self->SUPER::_default_for($attr);
23
22
    }
24
23
 
25
 
    sub _standard_keys 
 
24
    sub _standard_keys
26
25
    {
27
26
        my ($self) = @_;
28
27
        ($self->SUPER::_standard_keys(), keys %_attr_data);
29
28
    }
30
29
}
31
 
    
32
 
 
33
 
sub _setup_server {}
 
30
 
 
31
 
 
32
sub _setup_server {
 
33
    my $self = shift;
 
34
    $self->{_server} = HTTPServer->new (LocalAddr => 'localhost',
 
35
                                        ReuseAddr => 1)
 
36
                                    or die "Cannot create server!!!";
 
37
}
34
38
 
35
39
 
36
40
sub _launch_server {
37
41
    my $self = shift;
38
42
    my $synch_func = shift;
39
43
 
40
 
    my $server = HTTPServer->new (LocalAddr => 'localhost',
41
 
                                  LocalPort => '8080',
42
 
                                  ReuseAddr => 1) or die "Cannot create server!!!";
43
 
    $server->run ($self->{_input}, $synch_func);
 
44
    $self->{_server}->run ($self->{_input}, $synch_func);
 
45
}
 
46
 
 
47
sub _substitute_port {
 
48
    my $self = shift;
 
49
    my $ret = shift;
 
50
    $ret =~ s/{{port}}/$self->{_server}->sockport/eg;
 
51
    return $ret;
44
52
}
45
53
 
46
54
1;