Changeset 12960 for trunk/Nebulous-Server/t/04_server_replicate_object.t
- Timestamp:
- Apr 23, 2007, 10:42:29 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/04_server_replicate_object.t
r10546 r12960 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 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 $ 6 6 7 7 use strict; … … 15 15 use Nebulous::Util qw( :standard ); 16 16 use Test::Nebulous; 17 use Test::URI; 18 use URI::Split qw( uri_split ); 17 19 18 20 my $neb = Nebulous::Server->new( … … 26 28 { 27 29 # 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"); 30 32 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'); 33 36 } 34 37 … … 37 40 { 38 41 # 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"); 41 44 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'); 44 48 } 45 49 … … 48 52 { 49 53 # 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"); 53 57 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 } 58 69 } 59 70 … … 61 72 62 73 eval { 63 $neb->replicate_object( "foo");74 $neb->replicate_object("foo"); 64 75 }; 65 like( $@, qr/storage object does not exist/, "storage object does not exist");76 like($@, qr/storage object does not exist/, "storage object does not exist"); 66 77 67 78 Test::Nebulous->setup; … … 70 81 $neb->replicate_object(); 71 82 }; 72 like( $@, qr/1 - 2 were expected/, "no params");83 like($@, qr/1 - 2 were expected/, "no params"); 73 84 74 85 Test::Nebulous->setup; 75 86 76 87 eval { 77 $neb->replicate_object( 1, 2, 3);88 $neb->replicate_object(1, 2, 3); 78 89 }; 79 like( $@, qr/1 - 2 were expected/, "too many params");90 like($@, qr/1 - 2 were expected/, "too many params"); 80 91 81 92 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
