IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20988 for trunk/Nebulous/t


Ignore:
Timestamp:
Dec 14, 2008, 12:48:35 PM (18 years ago)
Author:
eugene
Message:

revert to non-distributed version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/62_client_delete_instance.t

    r20965 r20988  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 62_client_delete_instance.t,v 1.2 2008-12-12 21:13:41 jhoblitt Exp $
     5# $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 11;
     12plan tests => 9;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
     28    $neb->create( "foo" );
    2829
    29     my $key = "foo";
    30     $neb->create($key);
     30    my $locations = $neb->find_instances( "foo" );
    3131
    32     my $locations = $neb->find_instances($key);
    33 
    34     my $uri = $neb->delete_instance($key, @$locations[0]);
     32    my $uri = $neb->delete_instance( @$locations[0] );
    3533
    3634    is( $uri, @$locations[0], "delete instance" );
     
    4543        proxy => "http://$hostport/nebulous",
    4644    );
    47     my $key = "foo";
    48     $neb->create($key);
    49     $neb->replicate($key);
     45    $neb->create( "foo" );
     46    $neb->replicate( "foo" );
    5047
    5148    my $uri1 = $neb->find_instances( "foo" )->[0];
    5249
    53     ok( $neb->delete_instance($key, $uri1), "delete instance" );
     50    ok( $neb->delete_instance( $uri1 ), "delete instance" );
    5451
    5552    my $uri2 = $neb->find_instances( "foo" )->[0];
     
    5754    isnt( $uri1, $uri2, "other instance remains" );
    5855
    59     ok( $neb->delete_instance($key, $uri2), "delete instance" );
     56    ok( $neb->delete_instance( $uri2 ), "delete instance" );
    6057
    6158    my $locations = $neb->find_instances( "foo" );
    6259
    63     is( $locations, undef, "no remaining instances" );
     60    is( $locations, undef, "no remaning instances" );
    6461}
    65 
    66 Test::Nebulous->setup;
    6762
    6863{
     
    7065        proxy => "http://$hostport/nebulous",
    7166    );
    72     my $key = "foo";
    73     $neb->create($key);
    74     my $uri = $neb->delete_instance($key, "file:/foo" );
     67    my $uri = $neb->delete_instance( "file:/foo" );
    7568
    7669    is( $uri, undef, "uri does not exist" );
     
    8376        proxy => "http://$hostport/nebulous",
    8477    );
    85     my $uri = $neb->delete_instance("foo", "file:/foo" );
     78    $neb->delete_instance();
    8679};
    87 like( $@, qr/is valid object key/, "bad object key" );
     80like( $@, qr/1 was expected/, "no params" );
    8881
    8982Test::Nebulous->setup;
     
    9386        proxy => "http://$hostport/nebulous",
    9487    );
    95     my $uri = $neb->delete_instance("foo");
     88    $neb->delete_instance( "foo", 2 );
    9689};
    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" );
     90like( $@, qr/1 was expected/, "too many params" );
    11891
    11992Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.