APP-REST-RestTestSuite

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

use 5.006;
use strict;
use warnings FATAL => 'all';
use Module::Build;

my $builder = Module::Build->new(
    module_name         => 'APP::REST::RestTestSuite',
    license             => 'artistic_2',
    dist_author         => q{Mithun Radhakrishnan <rkmithun@cpan.org>},
    dist_version_from   => 'lib/APP/REST/RestTestSuite.pm',
    dist_abstract       => 'rest-client => Test automation tool for restful web services',
    release_status      => 'stable',
    script_files      => [
        'script/rest-client', 
    ],
    meta_merge        => {
        resources => {
            repository => 'https://github.com/rkmithun/APP-REST-RestTestSuite'
        }

META.json  view on Meta::CPAN

{
   "abstract" : "rest-client => Test automation tool for restful web services",
   "author" : [
      "Mithun Radhakrishnan <rkmithun@cpan.org>"
   ],
   "dynamic_config" : 1,
   "generated_by" : "Module::Build version 0.4206",
   "license" : [
      "artistic_2"
   ],
   "meta-spec" : {
      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
      "version" : "2"

META.yml  view on Meta::CPAN

---
abstract: 'rest-client => Test automation tool for restful web services'
author:
  - 'Mithun Radhakrishnan <rkmithun@cpan.org>'
build_requires:
  Test::More: 0
configure_requires:
  Module::Build: 0
dynamic_config: 1
generated_by: 'Module::Build version 0.4206, CPAN::Meta::Converter version 2.120921'
license: artistic_2
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html

lib/APP/REST/RestTestSuite.pm  view on Meta::CPAN

        }

        $uri              = qq|$self->{rest_uri_base}| . qq|$tc->{uri}|;
        $method           = uc( $tc->{request_method} );
        $req_content_type = $tc->{request_content_type};
        $req_body         = $tc->{request_body} || 0;
        $status           = $tc->{response_status};

        if ( $tc->{request_method} =~ /get/i ) {
            $request = HTTP::Request->new( $method, $uri );
            $request->authorization_basic( $username, $password )
              if ( $username && $password );
        } else {
            $request =
              HTTP::Request->new( $method, $uri, new HTTP::Headers, $req_body );
            $request->authorization_basic( $username, $password )
              if ( $username && $password );
            $request->content_type($req_content_type);
            $request->content_length( length($req_body) );
        }

        print STDERR "Executing Test case $count => $tc->{test_case}";
        print $fh "Executing Test case $count => $tc->{test_case}";

        my $start_time = time;
        $response = $ua->request($request);

lib/APP/REST/RestTestSuite.pm  view on Meta::CPAN

        #Support only GET methods at present
        if ( $tc->{request_method} =~ /get/i ) {

            # Create HTTP request pool for later execution by parallel useragent
            $method           = uc( $tc->{request_method} );
            $req_content_type = $tc->{request_content_type};
            $req_body         = $tc->{request_body} || 0;
            $status           = $tc->{response_status};

            my $request = HTTP::Request->new( $method, $uri );
            $request->authorization_basic( $username, $password )
              if ( $username && $password );
            push( @reqs, $request );
        }

        $total++;

    }

    print STDERR "\nRequesting [$total] web services together.\n";
    foreach my $req (@reqs) {

lib/APP/REST/RestTestSuite.pm  view on Meta::CPAN

#START_HTTP_CODE_DEF
############################
200 :  operation successful.
201 :  Successful creation of a resource.
202 :  The request was received.
204 :  The request was processed successfully, but no response body is needed.
301 :  Resource has moved.
303 :  Redirection.
304 :  Resource has not been modified.
400 :  Malformed syntax or a bad query.
401 :  Action requires user authentication.
403 :  Authentication failure or invalid Application ID.
404 :  Resource not found.
405 :  Method not allowed on resource.
406 :  Requested representation not available for the resource.
408 :  Request has timed out.
409 :  State of the resource doesn't permit request.
410 :  The URI used to refer to a resource.
411 :  The server needs to know the size of the entity body and it should be specified in the Content Length header.
412 :  Operation not completed because preconditions were not met.
413 :  The representation was too large for the server to handle.



( run in 1.041 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )