IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 20, 2009, 11:23:23 AM (17 years ago)
Author:
jhoblitt
Message:

merge neb_distrib_20081210

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/Nebulous23158-23228
      /branches/jhoblitt/Nebulous2785-12604
      /branches/pap/Nebulous23511-23685,​23690-23739
  • trunk/Nebulous/t

  • trunk/Nebulous/t/62_client_delete_instance.t

    r20988 r23934  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 62_client_delete_instance.t,v 1.3 2008-12-14 22:48:35 eugene Exp $
     5# $Id: 62_client_delete_instance.t,v 1.1.38.1 2008-12-14 22:03:08 eugene Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 9;
     12plan tests => 11;
    1313
    1414use lib qw( ./t ./lib );
     
    2626        proxy => "http://$hostport/nebulous",
    2727    );
    28     $neb->create( "foo" );
    2928
    30     my $locations = $neb->find_instances( "foo" );
     29    my $key = "foo";
     30    $neb->create($key);
    3131
    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]);
    3335
    3436    is( $uri, @$locations[0], "delete instance" );
     
    4345        proxy => "http://$hostport/nebulous",
    4446    );
    45     $neb->create( "foo" );
    46     $neb->replicate( "foo" );
     47    my $key = "foo";
     48    $neb->create($key);
     49    $neb->replicate($key);
    4750
    4851    my $uri1 = $neb->find_instances( "foo" )->[0];
    4952
    50     ok( $neb->delete_instance( $uri1 ), "delete instance" );
     53    ok( $neb->delete_instance($key, $uri1), "delete instance" );
    5154
    5255    my $uri2 = $neb->find_instances( "foo" )->[0];
     
    5457    isnt( $uri1, $uri2, "other instance remains" );
    5558
    56     ok( $neb->delete_instance( $uri2 ), "delete instance" );
     59    ok( $neb->delete_instance($key, $uri2), "delete instance" );
    5760
    5861    my $locations = $neb->find_instances( "foo" );
    5962
    60     is( $locations, undef, "no remaning instances" );
     63    is( $locations, undef, "no remaining instances" );
    6164}
     65
     66Test::Nebulous->setup;
    6267
    6368{
     
    6570        proxy => "http://$hostport/nebulous",
    6671    );
    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" );
    6875
    6976    is( $uri, undef, "uri does not exist" );
     
    7683        proxy => "http://$hostport/nebulous",
    7784    );
    78     $neb->delete_instance();
     85    my $uri = $neb->delete_instance("foo", "file:/foo" );
    7986};
    80 like( $@, qr/1 was expected/, "no params" );
     87like( $@, qr/is valid object key/, "bad object key" );
    8188
    8289Test::Nebulous->setup;
     
    8693        proxy => "http://$hostport/nebulous",
    8794    );
    88     $neb->delete_instance( "foo", 2 );
     95    my $uri = $neb->delete_instance("foo");
    8996};
    90 like( $@, qr/1 was expected/, "too many params" );
     97like( $@, qr/2 were expected/, "missing second param" );
     98
     99Test::Nebulous->setup;
     100
     101eval {
     102    my $neb = Nebulous::Client->new(
     103        proxy => "http://$hostport/nebulous",
     104    );
     105    $neb->delete_instance();
     106};
     107like( $@, qr/2 were expected/, "no params" );
     108
     109Test::Nebulous->setup;
     110
     111eval {
     112    my $neb = Nebulous::Client->new(
     113        proxy => "http://$hostport/nebulous",
     114    );
     115    $neb->delete_instance("foo", 2, 3);
     116};
     117like( $@, qr/2 were expected/, "too many params" );
    91118
    92119Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.