Changeset 4440 for trunk/Nebulous-Server/t/07_server_find_instances.t
- Timestamp:
- Jun 29, 2005, 4:35:06 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/07_server_find_instances.t
r2872 r4440 3 3 # Copryight (C) 2004-2005 Joshua Hoblitt 4 4 # 5 # $Id: 07_server_find_instances.t,v 1. 3 2005-01-03 23:55:29jhoblitt Exp $5 # $Id: 07_server_find_instances.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 29 # key 30 my $uri = $ idata->create_object( "foo" );30 my $uri = $neb->create_object( "foo" ); 31 31 32 my $locations = $ idata->find_instances( "foo" );32 my $locations = $neb->find_instances( "foo" ); 33 33 34 34 is( $uri, $locations->[0], "URIs match" ); 35 35 } 36 36 37 Test:: IData->setup;37 Test::Nebulous->setup; 38 38 39 39 { 40 40 # key 41 my $uri1 = $ idata->create_object( "foo" );42 my $uri2 = $ idata->replicate_object( "foo" );41 my $uri1 = $neb->create_object( "foo" ); 42 my $uri2 = $neb->replicate_object( "foo" ); 43 43 44 my $locations = $ idata->find_instances( "foo" );44 my $locations = $neb->find_instances( "foo" ); 45 45 46 46 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); 47 47 } 48 48 49 Test:: IData->setup;49 Test::Nebulous->setup; 50 50 51 51 { 52 52 # key, volume 53 my $uri = $ idata->create_object( "foo" );53 my $uri = $neb->create_object( "foo" ); 54 54 55 my $locations = $ idata->find_instances( "foo", "node01" );55 my $locations = $neb->find_instances( "foo", "node01" ); 56 56 57 57 is( $uri, $locations->[0], "URIs match" ); 58 58 } 59 59 60 Test:: IData->setup;60 Test::Nebulous->setup; 61 61 62 62 { 63 63 # key 64 my $uri1 = $ idata->create_object( "foo" );65 my $uri2 = $ idata->replicate_object( "foo" );64 my $uri1 = $neb->create_object( "foo" ); 65 my $uri2 = $neb->replicate_object( "foo" ); 66 66 67 my $locations = $ idata->find_instances( "foo", "node01" );67 my $locations = $neb->find_instances( "foo", "node01" ); 68 68 69 69 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); … … 71 71 72 72 73 Test:: IData->setup;73 Test::Nebulous->setup; 74 74 75 75 eval { 76 $ idata->find_instances( "foo" );76 $neb->find_instances( "foo" ); 77 77 }; 78 78 like( $@, qr/no instances found/, "storage object does not exist" ); 79 79 80 Test:: IData->setup;80 Test::Nebulous->setup; 81 81 82 82 eval { 83 $ idata->find_instances();83 $neb->find_instances(); 84 84 }; 85 85 like( $@, qr/1 - 2 were expected/, "no params" ); 86 86 87 Test:: IData->setup;87 Test::Nebulous->setup; 88 88 89 89 eval { 90 $ idata->find_instances( "foo", 'read', 3 );90 $neb->find_instances( "foo", 'read', 3 ); 91 91 }; 92 92 like( $@, qr/1 - 2 were expected/, "too many params" ); 93 93 94 Test:: IData->cleanup;94 Test::Nebulous->cleanup;
Note:
See TracChangeset
for help on using the changeset viewer.
