Changeset 23934 for trunk/Nebulous/t
- Timestamp:
- Apr 20, 2009, 11:23:23 AM (17 years ago)
- Location:
- trunk/Nebulous
- Files:
-
- 1 deleted
- 4 edited
- 1 copied
-
. (modified) (1 prop)
-
t (modified) (1 prop)
-
t/62_client_delete_instance.t (modified) (8 diffs)
-
t/70_neb-ls.t (copied) (copied from branches/neb_distrib_20081210/Nebulous/t/70_neb-ls.t )
-
t/Test (deleted)
-
t/conf/startup.pl.in (modified) (1 diff)
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; -
trunk/Nebulous/t/conf/startup.pl.in
r16281 r23934 12 12 use Test::Nebulous; 13 13 14 #$Apache::DBI::DEBUG = 1; 14 15 Apache::DBI->connect_on_init( $NEB_DB, $NEB_USER, $NEB_PASS ); 15 Nebulous::Server::SOAP->new_on_init( 16 Apache::DBI->setPingTimeOut($NEB_DB, 10); 17 18 my $config = Nebulous::Server::Config->new( 19 trace => 'all', 20 ); 21 $config->add_db( 22 dbindex => 0, 16 23 dsn => $NEB_DB, 17 24 dbuser => $NEB_USER, 18 25 dbpasswd => $NEB_PASS, 19 log_level => 'all',20 26 ); 27 #$config->add_db( 28 # dbindex => 1, 29 # dsn => 'DBI:mysql:database=nebulous1:host=localhost', 30 # dbuser => $dbuser, 31 # dbpasswd => $dbpasswd, 32 #); 33 34 Nebulous::Server::SOAP->new_on_init($config); 21 35 22 36 1;
Note:
See TracChangeset
for help on using the changeset viewer.
