You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2001/04/02 11:05:01 UTC

cvs commit: modperl-2.0/t/response/TestAPI conn_rec.pm request_rec.pm server_rec.pm

dougm       01/04/02 02:05:01

  Added:       t/response/TestAPI conn_rec.pm request_rec.pm server_rec.pm
  Log:
  start of apache api tests
  
  Revision  Changes    Path
  1.1                  modperl-2.0/t/response/TestAPI/conn_rec.pm
  
  Index: conn_rec.pm
  ===================================================================
  package TestAPI::conn_rec;
  
  use Apache::Test;
  
  sub handler {
      my $r = shift;
  
      my $c = $r->connection;
  
      plan $r, tests => 17;
  
      ok $c;
  
      ok $c->pool->isa('APR::Pool');
  
      ok $c->base_server->isa('Apache::Server');
  
      ok $c->client_socket->isa('APR::Socket');
  
      ok $c->local_addr->isa('APR::SockAddr');
  
      ok $c->remote_addr->isa('APR::SockAddr');
  
      ok $c->remote_ip;
  
      ok $c->remote_host || 1;
  
      ok $c->remote_logname || 1;
  
      ok $c->aborted || 1;
  
      ok $c->keepalive || 1;
  
      ok $c->keptalive || 1;
  
      ok $c->keepalives || 1;
  
      ok $c->local_ip;
  
      ok $c->local_host || 1;
  
      ok $c->id || 1;
  
      #conn_config
  
      ok $r->notes;
  
      #input_filters
      #output_filters
      #remain
  
      0;
  }
  
  1;
  
  
  
  1.1                  modperl-2.0/t/response/TestAPI/request_rec.pm
  
  Index: request_rec.pm
  ===================================================================
  package TestAPI::request_rec;
  
  use Apache::Test;
  
  sub handler {
      my $r = shift;
  
      plan $r, tests => 33;
  
      ok $r->pool->isa('APR::Pool');
  
      ok $r->connection->isa('Apache::Connection');
  
      ok $r->server->isa('Apache::Server');
  
      for (qw(next prev main)) {
          ok (! $r->$_()) || $r->$_()->isa('Apache::RequestRec');
      }
  
      ok $r->the_request || 1;
  
      ok $r->assbackwards || 1;
  
      ok $r->proxyreq || 1;
  
      ok $r->header_only || 1;
  
      ok $r->protocol =~ /http/i;
  
      ok $r->proto_num;
  
      ok $r->hostname || 1;
  
      ok $r->request_time;
  
      ok $r->status_line || 1;
  
      ok $r->status || 1;
  
      ok $r->method;
  
      ok $r->method_number || 1;
  
      ok $r->allowed || 1;
  
      #allowed_xmethods
      #allow_methods
  
      ok $r->bytes_sent || 1;
  
      ok $r->mtime || 1;
  
      ok $r->headers_in;
  
      ok $r->headers_out;
  
      ok $r->err_headers_out;
  
      ok $r->subprocess_env;
  
      ok $r->notes;
  
      ok $r->content_type;
  
      ok $r->handler;
  
      #content_encoding
      #content_language
      #content_languages
  
      #user
  
      #no_cache
      #no_local_copy
  
      ok $r->unparsed_uri;
  
      ok $r->uri;
  
      ok $r->filename;
  
      ok $r->path_info || 1;
  
      ok $r->args || 1;
  
      #finfo
      #parsed_uri
  
      #per_dir_config
      #request_config
  
      #output_filters
      #input_filers
  
      #eos_sent
  
      0;
  }
  
  1;
  
  
  
  1.1                  modperl-2.0/t/response/TestAPI/server_rec.pm
  
  Index: server_rec.pm
  ===================================================================
  package TestAPI::server_rec;
  
  use Apache::Test;
  
  sub handler {
      my $r = shift;
  
      my $s = $r->server;
  
      plan $r, tests => 17;
  
      ok $s;
  
      ok $s->process;
  
      ok $s->next || 1;
  
      ok $s->server_admin;
  
      ok $s->server_hostname;
  
      ok $s->port || 1;
  
      ok $s->error_fname;
  
      #error_log;
  
      ok $s->loglevel;
  
      ok $s->is_virtual || 1;
  
      #module_config
  
      #lookup_defaults
  
      ok $s->addrs;
  
      ok $s->timeout;
  
      #keep_alive_timeout
      #keep_alive_max
      #keep_alive
  
      ok $s->path || 1;
  
      ok $s->names || 1;
  
      ok $s->wild_names || 1;
  
      ok $s->limit_req_line;
  
      ok $s->limit_req_fieldsize;
  
      ok $s->limit_req_fields;
  
      0;
  }
  
  1;