Changeset 13092 for trunk/Nebulous-Server/t
- Timestamp:
- Apr 30, 2007, 4:52:04 PM (19 years ago)
- Location:
- trunk/Nebulous-Server/t
- Files:
-
- 2 deleted
- 2 edited
-
03_server_create_object.t (modified) (4 diffs)
-
09_server_is_valid_class_id.t (deleted)
-
09_server_stat_object.t (modified) (3 diffs)
-
11_server_is_valid_class_id.t (deleted)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/03_server_create_object.t
r12960 r13092 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 03_server_create_object.t,v 1.1 2 2007-04-23 20:42:29jhoblitt Exp $5 # $Id: 03_server_create_object.t,v 1.13 2007-05-01 02:52:04 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 14;10 use Test::More tests => 8; 11 11 12 12 use lib qw( ./t ./lib ); … … 38 38 39 39 { 40 # key, class 41 my $uri = $neb->create_object("foo", 0); 42 43 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); 44 ok(-e $path, "file exists"); 45 uri_scheme_ok($uri, 'file'); 46 } 47 48 Test::Nebulous->setup; 49 50 { 51 # key, class, volume 52 my $uri = $neb->create_object("foo", 0, "node01"); 53 54 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); 55 ok(-e $path, "file exists"); 56 uri_scheme_ok($uri, 'file'); 57 } 58 59 Test::Nebulous->setup; 60 61 { 62 # key, class, volume, comment 63 my $uri = $neb->create_object("foo", 0, "node01", "this is foo"); 40 # key, volume 41 my $uri = $neb->create_object("foo", "node01"); 64 42 65 43 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri); … … 78 56 Test::Nebulous->setup; 79 57 80 {81 my $uri = $neb->create_object("foo", 1);82 83 my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);84 ok(-e $path, "class exists");85 }86 87 Test::Nebulous->setup;88 89 58 eval { 90 59 $neb->create_object("foo", 99); 91 60 }; 92 like($@, qr/did not pass the \'is valid class id\'/, "class doesn't exist"); 93 94 Test::Nebulous->setup; 95 96 eval { 97 $neb->create_object(1, 0, 'node01', 'x' x 256); 98 }; 99 like($@, qr/comment length/, "comment is too long"); 61 like($@, qr/did not pass the \'is valid volume name\'/, "volume name doesn't exist"); 100 62 101 63 Test::Nebulous->setup; … … 104 66 $neb->create_object(); 105 67 }; 106 like($@, qr/ 2 - 4were expected/, "no params");68 like($@, qr/1 - 2 were expected/, "no params"); 107 69 108 70 Test::Nebulous->setup; 109 71 110 72 eval { 111 $neb->create_object( 1, 0, 'node01', 1, 1);73 $neb->create_object(1, "node01", 3); 112 74 }; 113 like($@, qr/ 2 - 4were expected/, "too many params");75 like($@, qr/1 - 2 were expected/, "too many params"); 114 76 115 77 Test::Nebulous->cleanup; -
trunk/Nebulous-Server/t/09_server_stat_object.t
r12646 r13092 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 09_server_stat_object.t,v 1. 9 2007-03-28 22:01:37jhoblitt Exp $5 # $Id: 09_server_stat_object.t,v 1.10 2007-05-01 02:52:04 jhoblitt Exp $ 6 6 7 7 use strict; 8 8 use warnings FATAL => qw( all ); 9 9 10 use Test::More tests => 1 3;10 use Test::More tests => 11; 11 11 12 12 use lib qw( ./t ./lib ); … … 29 29 my $info = $neb->stat_object("foo"); 30 30 31 is(scalar @$info, 8, "number of columns");31 is(scalar @$info, 6, "number of columns"); 32 32 } 33 33 … … 35 35 36 36 { 37 my $uri = $neb->create_object("foo", 0, "node01", "foobar");37 my $uri = $neb->create_object("foo", "node01"); 38 38 39 39 my $info = $neb->stat_object("foo"); 40 40 41 is(scalar @$info, 8, "number of columns");41 is(scalar @$info, 6, "number of columns"); 42 42 is(@$info[0], 1, "so_id"); 43 43 is(@$info[1], "foo", "ext_id"); 44 is(@$info[2], 0, "class_id"); 45 is(@$info[3], "foobar", "comment"); 46 is(@$info[4], 0, "read lock"); 47 is(@$info[5], undef, "write lock"); 48 like(@$info[6], qr/....-..-.. ..:..:../, "epoch"); 49 like(@$info[6], qr/....-..-.. ..:..:../, "mtime"); 44 is(@$info[2], 0, "read lock"); 45 is(@$info[3], undef, "write lock"); 46 like(@$info[4], qr/....-..-.. ..:..:../, "epoch"); 47 like(@$info[5], qr/....-..-.. ..:..:../, "mtime"); 50 48 } 51 49
Note:
See TracChangeset
for help on using the changeset viewer.
