Changeset 4440 for trunk/Nebulous-Server/t/22_client_delete_instance.t
- Timestamp:
- Jun 29, 2005, 4:35:06 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/22_client_delete_instance.t
r2882 r4440 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 22_client_delete_instance.t,v 1. 1 2005-01-04 03:14:19jhoblitt Exp $5 # $Id: 22_client_delete_instance.t,v 1.2 2005-06-30 02:35:06 jhoblitt Exp $ 6 6 7 7 use strict; … … 14 14 use lib qw( ./t ./lib ); 15 15 16 use PS::IPP::IData::Client;17 use PS::IPP::IData::Util qw( :standard );18 use Test:: IData;16 use Nebulous::Client; 17 use Nebulous::Util qw( :standard ); 18 use Test::Nebulous; 19 19 20 20 my $hostport = Apache::Test->config->{ 'hostport' }; 21 21 22 Test:: IData->setup;22 Test::Nebulous->setup; 23 23 24 24 { 25 my $ idata = PS::IPP::IData::Client->new(26 proxy => "http://$hostport/ idata",25 my $neb = Nebulous::Client->new( 26 proxy => "http://$hostport/nebulous", 27 27 ); 28 $ idata->create( "foo" );28 $neb->create( "foo" ); 29 29 30 my $locations = $ idata->find_instances( "foo" );30 my $locations = $neb->find_instances( "foo" ); 31 31 32 my $uri = $ idata->delete_instance( @$locations[0] );32 my $uri = $neb->delete_instance( @$locations[0] ); 33 33 34 34 is( $uri, @$locations[0], "delete instance" ); … … 37 37 } 38 38 39 Test:: IData->setup;39 Test::Nebulous->setup; 40 40 41 41 { 42 my $ idata = PS::IPP::IData::Client->new(43 proxy => "http://$hostport/ idata",42 my $neb = Nebulous::Client->new( 43 proxy => "http://$hostport/nebulous", 44 44 ); 45 $ idata->create( "foo" );46 $ idata->replicate( "foo" );45 $neb->create( "foo" ); 46 $neb->replicate( "foo" ); 47 47 48 my $uri1 = $ idata->find_instances( "foo" )->[0];48 my $uri1 = $neb->find_instances( "foo" )->[0]; 49 49 50 ok( $ idata->delete_instance( $uri1 ), "delete instance" );50 ok( $neb->delete_instance( $uri1 ), "delete instance" ); 51 51 52 my $uri2 = $ idata->find_instances( "foo" )->[0];52 my $uri2 = $neb->find_instances( "foo" )->[0]; 53 53 54 54 isnt( $uri1, $uri2, "other instance remains" ); 55 55 56 ok( $ idata->delete_instance( $uri2 ), "delete instance" );56 ok( $neb->delete_instance( $uri2 ), "delete instance" ); 57 57 58 my $locations = $ idata->find_instances( "foo" );58 my $locations = $neb->find_instances( "foo" ); 59 59 60 60 is( $locations, undef, "no remaning instances" ); … … 62 62 63 63 { 64 my $ idata = PS::IPP::IData::Client->new(65 proxy => "http://$hostport/ idata",64 my $neb = Nebulous::Client->new( 65 proxy => "http://$hostport/nebulous", 66 66 ); 67 my $uri = $ idata->delete_instance( "file:/foo" );67 my $uri = $neb->delete_instance( "file:/foo" ); 68 68 69 69 is( $uri, undef, "uri does not exist" ); 70 70 } 71 71 72 Test:: IData->setup;72 Test::Nebulous->setup; 73 73 74 74 eval { 75 my $ idata = PS::IPP::IData::Client->new(76 proxy => "http://$hostport/ idata",75 my $neb = Nebulous::Client->new( 76 proxy => "http://$hostport/nebulous", 77 77 ); 78 $ idata->delete_instance();78 $neb->delete_instance(); 79 79 }; 80 80 like( $@, qr/1 was expected/, "no params" ); 81 81 82 Test:: IData->setup;82 Test::Nebulous->setup; 83 83 84 84 eval { 85 my $ idata = PS::IPP::IData::Client->new(86 proxy => "http://$hostport/ idata",85 my $neb = Nebulous::Client->new( 86 proxy => "http://$hostport/nebulous", 87 87 ); 88 $ idata->delete_instance( "foo", 2 );88 $neb->delete_instance( "foo", 2 ); 89 89 }; 90 90 like( $@, qr/1 was expected/, "too many params" ); 91 91 92 Test:: IData->cleanup;92 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
