IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2007, 10:42:29 AM (19 years ago)
Author:
jhoblitt
Message:

ws
add the use of Test::URI in tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/t/04_server_replicate_object.t

    r10546 r12960  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 04_server_replicate_object.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
     5# $Id: 04_server_replicate_object.t,v 1.7 2007-04-23 20:42:29 jhoblitt Exp $
    66
    77use strict;
     
    1515use Nebulous::Util qw( :standard );
    1616use Test::Nebulous;
     17use Test::URI;
     18use URI::Split qw( uri_split );
    1719
    1820my $neb = Nebulous::Server->new(
     
    2628{
    2729    # key
    28     $neb->create_object( "foo" );
    29     my $uri = $neb->replicate_object( "foo" );
     30    $neb->create_object("foo");
     31    my $uri = $neb->replicate_object("foo");
    3032
    31     ok( -e _get_file_path( $uri ), "file exists" );
    32     like( $uri, qr/^file:\//, "valid URI" );
     33    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
     34    ok(-e $path, "file exists");
     35    uri_scheme_ok($uri, 'file');
    3336}
    3437
     
    3740{
    3841    # key, $volume
    39     $neb->create_object( "foo" );
    40     my $uri = $neb->replicate_object( "foo", "node01" );
     42    $neb->create_object("foo");
     43    my $uri = $neb->replicate_object("foo", "node01");
    4144
    42     ok( -e _get_file_path( $uri ), "file exists" );
    43     like( $uri, qr/^file:\//, "valid URI" );
     45    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
     46    ok(-e $path, "file exists");
     47    uri_scheme_ok($uri, 'file');
    4448}
    4549
     
    4852{
    4953    # key, $volume
    50     $neb->create_object( "foo" );
    51     my $uri1 = $neb->replicate_object( "foo", "node01" );
    52     my $uri2 = $neb->replicate_object( "foo", "node02" );
     54    $neb->create_object("foo");
     55    my $uri1 = $neb->replicate_object("foo", "node01");
     56    my $uri2 = $neb->replicate_object("foo", "node02");
    5357
    54     ok( -e _get_file_path( $uri1 ), "file exists" );
    55     ok( -e _get_file_path( $uri2 ), "file exists" );
    56     like( $uri1, qr/^file:\//, "valid URI" );
    57     like( $uri2, qr/^file:\//, "valid URI" );
     58    {
     59        my ($scheme, $auth, $path, $query, $frag) = uri_split($uri1);
     60        ok(-e $path, "file exists");
     61        uri_scheme_ok($uri1, 'file');
     62    }
     63
     64    {
     65        my ($scheme, $auth, $path, $query, $frag) = uri_split($uri2);
     66        ok(-e $path, "file exists");
     67        uri_scheme_ok($uri2, 'file');
     68    }
    5869}
    5970
     
    6172
    6273eval {
    63     $neb->replicate_object( "foo" );
     74    $neb->replicate_object("foo");
    6475};
    65 like( $@, qr/storage object does not exist/, "storage object does not exist" );
     76like($@, qr/storage object does not exist/, "storage object does not exist");
    6677
    6778Test::Nebulous->setup;
     
    7081    $neb->replicate_object();
    7182};
    72 like( $@, qr/1 - 2 were expected/, "no params" );
     83like($@, qr/1 - 2 were expected/, "no params");
    7384
    7485Test::Nebulous->setup;
    7586
    7687eval {
    77     $neb->replicate_object( 1, 2, 3 );
     88    $neb->replicate_object(1, 2, 3);
    7889};
    79 like( $@, qr/1 - 2 were expected/, "too many params" );
     90like($@, qr/1 - 2 were expected/, "too many params");
    8091
    8192Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.