2005-12-05 08:35:07 -05:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
|
|
|
|
package HTTPTest;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
use HTTPServer;
|
2006-01-24 07:15:58 -05:00
|
|
|
use Test;
|
|
|
|
|
|
|
|
our @ISA = qw(Test);
|
|
|
|
my $VERSION = 0.01;
|
2005-12-05 08:35:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
my %_attr_data = ( # DEFAULT
|
|
|
|
);
|
|
|
|
|
|
|
|
sub _default_for
|
|
|
|
{
|
|
|
|
my ($self, $attr) = @_;
|
|
|
|
return $_attr_data{$attr} if exists $_attr_data{$attr};
|
|
|
|
return $self->SUPER::_default_for($attr);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub _standard_keys
|
|
|
|
{
|
|
|
|
my ($self) = @_;
|
|
|
|
($self->SUPER::_standard_keys(), keys %_attr_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
sub _setup_server {}
|
2005-12-05 08:35:07 -05:00
|
|
|
|
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
sub _launch_server {
|
2005-12-05 08:35:07 -05:00
|
|
|
my $self = shift;
|
2006-05-29 05:15:06 -04:00
|
|
|
my $synch_func = shift;
|
2005-12-05 08:35:07 -05:00
|
|
|
|
2006-01-24 07:15:58 -05:00
|
|
|
my $server = HTTPServer->new (LocalAddr => 'localhost',
|
|
|
|
LocalPort => '8080',
|
|
|
|
ReuseAddr => 1) or die "Cannot create server!!!";
|
2006-05-29 05:15:06 -04:00
|
|
|
$server->run ($self->{_input}, $synch_func);
|
2005-12-05 08:35:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|
|
|
|
# vim: et ts=4 sw=4
|
|
|
|
|