Changeset 12644 for trunk/Nebulous-Server
- Timestamp:
- Mar 28, 2007, 11:53:20 AM (19 years ago)
- Location:
- trunk/Nebulous-Server/t
- Files:
-
- 2 edited
-
08_server_delete_instance.t (modified) (5 diffs)
-
09_server_is_valid_class_id.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/08_server_delete_instance.t
r10546 r12644 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 08_server_delete_instance.t,v 1. 6 2006-12-08 03:29:19jhoblitt Exp $5 # $Id: 08_server_delete_instance.t,v 1.7 2007-03-28 21:50:26 jhoblitt Exp $ 6 6 7 7 use strict; … … 25 25 26 26 { 27 my $uri = $neb->create_object( "foo");27 my $uri = $neb->create_object("foo"); 28 28 29 ok( $neb->delete_instance( $uri ), "delete instance");29 ok($neb->delete_instance($uri), "delete instance"); 30 30 } 31 31 … … 33 33 34 34 { 35 my $uri1 = $neb->create_object( "foo");36 my $uri2 = $neb->replicate_object( "foo");35 my $uri1 = $neb->create_object("foo"); 36 my $uri2 = $neb->replicate_object("foo"); 37 37 38 ok( $neb->delete_instance( $uri1 ), "delete instance");38 ok($neb->delete_instance($uri1), "delete instance"); 39 39 40 my $locations = $neb->find_instances( "foo");40 my $locations = $neb->find_instances("foo"); 41 41 42 is( $locations->[0], $uri2, "instance remains");42 is($locations->[0], $uri2, "instance remains"); 43 43 44 ok( $neb->delete_instance( $uri2 ), "delete instance");44 ok($neb->delete_instance( $uri2 ), "delete instance"); 45 45 46 46 eval { 47 $neb->find_instances( "foo");47 $neb->find_instances("foo"); 48 48 }; 49 like( $@, qr/no instances found/, "storage object was deleted");49 like($@, qr/no instances found/, "storage object was deleted"); 50 50 } 51 51 … … 53 53 54 54 eval { 55 $neb->delete_instance( "file:/foo");55 $neb->delete_instance("file:/foo"); 56 56 }; 57 like( $@, qr/no instance is associated with uri/, "uri does not exist");57 like($@, qr/no instance is associated with uri/, "uri does not exist"); 58 58 59 59 Test::Nebulous->setup; … … 62 62 $neb->delete_instance(); 63 63 }; 64 like( $@, qr/1 was expected/, "no params");64 like($@, qr/1 was expected/, "no params"); 65 65 66 66 Test::Nebulous->setup; 67 67 68 68 eval { 69 $neb->delete_instance( "foo", 2);69 $neb->delete_instance("foo", 2); 70 70 }; 71 like( $@, qr/1 was expected/, "too many params");71 like($@, qr/1 was expected/, "too many params"); 72 72 73 73 Test::Nebulous->cleanup; -
trunk/Nebulous-Server/t/09_server_is_valid_class_id.t
r10546 r12644 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 09_server_is_valid_class_id.t,v 1. 2 2006-12-08 03:29:19jhoblitt Exp $5 # $Id: 09_server_is_valid_class_id.t,v 1.3 2007-03-28 21:53:20 jhoblitt Exp $ 6 6 7 7 use strict; … … 25 25 26 26 # 0 is the default and is guarenteed to exist 27 ok( $neb->_is_valid_class_id( 0), "default class id");27 ok($neb->_is_valid_class_id(0), "default class id"); 28 28 29 29 Test::Nebulous->setup; 30 30 31 31 # the test setup adds class id 1 32 ok( $neb->_is_valid_class_id( 1), "custom class id");32 ok($neb->_is_valid_class_id(1), "custom class id"); 33 33 34 34 Test::Nebulous->setup; 35 35 36 is( $neb->_is_valid_class_id( 99), undef, "invalid class id");36 is($neb->_is_valid_class_id(99), undef, "invalid class id"); 37 37 38 38 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
