Changeset 23934 for trunk/Nebulous/t/62_client_delete_instance.t
- Timestamp:
- Apr 20, 2009, 11:23:23 AM (17 years ago)
- Location:
- trunk/Nebulous
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/eam_branches/eam_branch_20090303/Nebulous 23158-23228 /branches/jhoblitt/Nebulous 2785-12604 /branches/pap/Nebulous 23511-23685,23690-23739
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/Nebulous/t
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/neb_distrib_20081210/Nebulous/t merged eligible /branches/eam_branches/eam_branch_20090303/Nebulous/t 23158-23228 /branches/jhoblitt/Nebulous/t 2785-12604 /branches/pap/Nebulous/t 23511-23685,23690-23739
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/Nebulous/t/62_client_delete_instance.t
r20988 r23934 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 62_client_delete_instance.t,v 1. 3 2008-12-14 22:48:35eugene Exp $5 # $Id: 62_client_delete_instance.t,v 1.1.38.1 2008-12-14 22:03:08 eugene Exp $ 6 6 7 7 use strict; … … 10 10 use Apache::Test qw( -withtestmore ); 11 11 12 plan tests => 9;12 plan tests => 11; 13 13 14 14 use lib qw( ./t ./lib ); … … 26 26 proxy => "http://$hostport/nebulous", 27 27 ); 28 $neb->create( "foo" );29 28 30 my $locations = $neb->find_instances( "foo" ); 29 my $key = "foo"; 30 $neb->create($key); 31 31 32 my $uri = $neb->delete_instance( @$locations[0] ); 32 my $locations = $neb->find_instances($key); 33 34 my $uri = $neb->delete_instance($key, @$locations[0]); 33 35 34 36 is( $uri, @$locations[0], "delete instance" ); … … 43 45 proxy => "http://$hostport/nebulous", 44 46 ); 45 $neb->create( "foo" ); 46 $neb->replicate( "foo" ); 47 my $key = "foo"; 48 $neb->create($key); 49 $neb->replicate($key); 47 50 48 51 my $uri1 = $neb->find_instances( "foo" )->[0]; 49 52 50 ok( $neb->delete_instance( $uri1), "delete instance" );53 ok( $neb->delete_instance($key, $uri1), "delete instance" ); 51 54 52 55 my $uri2 = $neb->find_instances( "foo" )->[0]; … … 54 57 isnt( $uri1, $uri2, "other instance remains" ); 55 58 56 ok( $neb->delete_instance( $uri2), "delete instance" );59 ok( $neb->delete_instance($key, $uri2), "delete instance" ); 57 60 58 61 my $locations = $neb->find_instances( "foo" ); 59 62 60 is( $locations, undef, "no rema ning instances" );63 is( $locations, undef, "no remaining instances" ); 61 64 } 65 66 Test::Nebulous->setup; 62 67 63 68 { … … 65 70 proxy => "http://$hostport/nebulous", 66 71 ); 67 my $uri = $neb->delete_instance( "file:/foo" ); 72 my $key = "foo"; 73 $neb->create($key); 74 my $uri = $neb->delete_instance($key, "file:/foo" ); 68 75 69 76 is( $uri, undef, "uri does not exist" ); … … 76 83 proxy => "http://$hostport/nebulous", 77 84 ); 78 $neb->delete_instance();85 my $uri = $neb->delete_instance("foo", "file:/foo" ); 79 86 }; 80 like( $@, qr/ 1 was expected/, "no params" );87 like( $@, qr/is valid object key/, "bad object key" ); 81 88 82 89 Test::Nebulous->setup; … … 86 93 proxy => "http://$hostport/nebulous", 87 94 ); 88 $neb->delete_instance( "foo", 2);95 my $uri = $neb->delete_instance("foo"); 89 96 }; 90 like( $@, qr/1 was expected/, "too many params" ); 97 like( $@, qr/2 were expected/, "missing second param" ); 98 99 Test::Nebulous->setup; 100 101 eval { 102 my $neb = Nebulous::Client->new( 103 proxy => "http://$hostport/nebulous", 104 ); 105 $neb->delete_instance(); 106 }; 107 like( $@, qr/2 were expected/, "no params" ); 108 109 Test::Nebulous->setup; 110 111 eval { 112 my $neb = Nebulous::Client->new( 113 proxy => "http://$hostport/nebulous", 114 ); 115 $neb->delete_instance("foo", 2, 3); 116 }; 117 like( $@, qr/2 were expected/, "too many params" ); 91 118 92 119 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
