IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 25, 2007, 1:37:44 PM (19 years ago)
Author:
jhoblitt
Message:

convert DataStore::Product to use URIs that end as /index.txt$ instead of /$

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/t/05_product.t

    r8722 r15020  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: 05_product.t,v 1.5 2006-08-31 22:58:34 jhoblitt Exp $
     5# $Id: 05_product.t,v 1.6 2007-09-25 23:37:44 jhoblitt Exp $
    66
    77use strict;
     
    1010use lib qw( ./lib ./t );
    1111
    12 use Test::More tests => 22;
     12use Test::More tests => 23;
    1313
    1414=head1 NAME
     
    3232
    3333{
    34     my $dsp = DataStore::Product->new( uri => 'http://example.org/' );
     34    my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt' );
    3535
    3636    isa_ok($dsp, 'DataStore::Product');
     
    3939{
    4040    my $dsp = DataStore::Product->new(
    41         uri             => 'http://example.org/',
     41        uri             => 'http://example.org/index.txt',
    4242        last_fileset    => '12buckelyourshoe',
    4343    );
     
    4747
    4848eval {
    49     my $dsp = DataStore::Product->new( uri => 'http://example.org/', foo => 1 );
     49    my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt', foo => 1 );
    5050};
    5151like($@, qr/not listed in the validation options/,
     
    5454eval {
    5555    my $dsp = DataStore::Product->new(
    56         uri             => 'http://example.org/',
     56        uri             => 'http://example.org/index.txt',
    5757        last_fileset    => '12buckelyourshoe',
    5858        foo => 1,
     
    6565    my $dsp = DataStore::Product->new( uri => 'http://example.org' );
    6666};
    67 like($@, qr/is valid uri dirname/,
    68     '->new() fails when uri param does not end with /');
     67like($@, qr/uri ends with \/index.txt/,
     68    '->new() fails when uri param does not end with /index.txt');
    6969
    7070eval {
    71     my $dsp = DataStore::Product->new( uri => '://example.org' );
     71    my $dsp = DataStore::Product->new( uri => 'http://example.org/index.html' );
     72};
     73like($@, qr/uri ends with \/index.txt/,
     74    '->new() fails when uri param does not end with /index.txt');
     75
     76eval {
     77    my $dsp = DataStore::Product->new( uri => '://example.org/index.txt' );
    7278};
    7379like($@, qr/is valid http uri/,
     
    7682eval {
    7783    my $dsp = DataStore::Product->new(
    78         uri             => 'http://example.org/',
     84        uri             => 'http://example.org/index.txt',
    7985        last_fileset    => '++12buckelyourshoe',
    8086    );
     
    130136    print $server->Start(), "\n";
    131137
    132     $server->RegisterURL('/', \&bar);
     138    $server->RegisterURL('/index.txt', \&bar);
    133139    $server->Process();  # Run forever
    134140
     
    140146
    141147{
    142     my $dsp = DataStore::Product->new( uri => "http://localhost:$port/" );
     148    my $dsp = DataStore::Product->new( uri => "http://localhost:$port/index.txt" );
    143149
    144150    isa_ok($dsp->request, 'DataStore::Response');
     
    146152
    147153{
    148     my $dsp = DataStore::Product->new( uri => "http://localhost:$port/" );
     154    my $dsp = DataStore::Product->new( uri => "http://localhost:$port/index.txt" );
    149155
    150156    my $dsr = $dsp->request;
     
    168174
    169175eval {
    170     my $dsp = DataStore::Product->new( uri => 'http://example.org/' );
     176    my $dsp = DataStore::Product->new( uri => 'http://example.org/index.txt' );
    171177
    172178    $dsp->request( foo => 1 );
Note: See TracChangeset for help on using the changeset viewer.