Changeset 4440 for trunk/Nebulous/t/08_server_delete_instance.t
- Timestamp:
- Jun 29, 2005, 4:35:06 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/t/08_server_delete_instance.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/t/08_server_delete_instance.t
r2872 r4440 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 08_server_delete_instance.t,v 1. 3 2005-01-03 23:55:29jhoblitt Exp $5 # $Id: 08_server_delete_instance.t,v 1.4 2005-06-30 02:35:06 jhoblitt Exp $ 6 6 7 7 use strict; … … 12 12 use lib qw( ./t ./lib ); 13 13 14 use PS::IPP::IData::Server;15 use PS::IPP::IData::Util qw( :standard );16 use Test:: IData;14 use Nebulous::Server; 15 use Nebulous::Util qw( :standard ); 16 use Test::Nebulous; 17 17 18 my $ idata = "PS::IPP::IData::Server";18 my $neb = "Nebulous::Server"; 19 19 20 $ idata->setup(20 $neb->setup( 21 21 "DBI:mysql:database=test:host=localhost", 22 22 "test", … … 24 24 ); 25 25 26 Test:: IData->setup;26 Test::Nebulous->setup; 27 27 28 28 { 29 my $uri = $ idata->create_object( "foo" );29 my $uri = $neb->create_object( "foo" ); 30 30 31 ok( $ idata->delete_instance( $uri ), "delete instance" );31 ok( $neb->delete_instance( $uri ), "delete instance" ); 32 32 } 33 33 34 Test:: IData->setup;34 Test::Nebulous->setup; 35 35 36 36 { 37 my $uri1 = $ idata->create_object( "foo" );38 my $uri2 = $ idata->replicate_object( "foo" );37 my $uri1 = $neb->create_object( "foo" ); 38 my $uri2 = $neb->replicate_object( "foo" ); 39 39 40 ok( $ idata->delete_instance( $uri1 ), "delete instance" );40 ok( $neb->delete_instance( $uri1 ), "delete instance" ); 41 41 42 my $locations = $ idata->find_instances( "foo" );42 my $locations = $neb->find_instances( "foo" ); 43 43 44 44 is( $locations->[0], $uri2, "instance remains" ); 45 45 46 ok( $ idata->delete_instance( $uri2 ), "delete instance" );46 ok( $neb->delete_instance( $uri2 ), "delete instance" ); 47 47 48 48 eval { 49 $ idata->find_instances( "foo" );49 $neb->find_instances( "foo" ); 50 50 }; 51 51 like( $@, qr/no instances found/, "storage object was deleted" ); 52 52 } 53 53 54 Test:: IData->setup;54 Test::Nebulous->setup; 55 55 56 56 eval { 57 $ idata->delete_instance( "file:/foo" );57 $neb->delete_instance( "file:/foo" ); 58 58 }; 59 59 like( $@, qr/no instance is associated with uri/, "uri does not exist" ); 60 60 61 Test:: IData->setup;61 Test::Nebulous->setup; 62 62 63 63 eval { 64 $ idata->delete_instance();64 $neb->delete_instance(); 65 65 }; 66 66 like( $@, qr/1 was expected/, "no params" ); 67 67 68 Test:: IData->setup;68 Test::Nebulous->setup; 69 69 70 70 eval { 71 $ idata->delete_instance( "foo", 2 );71 $neb->delete_instance( "foo", 2 ); 72 72 }; 73 73 like( $@, qr/1 was expected/, "too many params" ); 74 74 75 Test:: IData->cleanup;75 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
