Changeset 2870
- Timestamp:
- Jan 3, 2005, 1:48:52 PM (22 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
Nebulous-Server/t/16_client_find_instances.t (modified) (7 diffs)
-
Nebulous/t/16_client_find_instances.t (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/t/16_client_find_instances.t
r2868 r2870 6 6 use Apache::Test qw( -withtestmore ); 7 7 8 plan tests => 7;8 plan tests => 13; 9 9 10 10 use lib qw( ./t ./lib ); … … 18 18 Test::IData->setup; 19 19 20 SKIP: {21 skip "need to write a module to validate URIs", 7;22 23 20 { 24 21 # key … … 26 23 proxy => "http://$hostport/idata", 27 24 ); 28 my $uri =$idata->create( "foo" );25 $idata->create( "foo" ); 29 26 30 27 my $locations = $idata->find_instances( "foo" ); 31 28 32 is( $uri, @$locations[0], "URIs match" ); 29 is( scalar @$locations, 1, "found 1" ); 30 like( @$locations[0], qr/file:/, "URIs match" ); 33 31 } 34 32 … … 40 38 proxy => "http://$hostport/idata", 41 39 ); 42 my $uri1 =$idata->create( "foo" );43 my $uri2 =$idata->replicate( "foo" );40 $idata->create( "foo" ); 41 $idata->replicate( "foo" ); 44 42 45 43 my $locations = $idata->find_instances( "foo" ); 46 44 47 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); 45 is( scalar @$locations, 2, "found 2" ); 46 like( @$locations[0], qr/file:/, "URIs match" ); 47 like( @$locations[1], qr/file:/, "URIs match" ); 48 48 } 49 49 … … 55 55 proxy => "http://$hostport/idata", 56 56 ); 57 my $uri =$idata->create( "foo" );57 $idata->create( "foo" ); 58 58 59 59 my $locations = $idata->find_instances( "foo", "node01" ); 60 60 61 is( $uri, $locations->[0], "URIs match" ); 61 is( scalar @$locations, 1, "found 1" ); 62 like( @$locations[0], qr/file:/, "URIs match" ); 62 63 } 63 64 … … 69 70 proxy => "http://$hostport/idata", 70 71 ); 71 my $uri1 =$idata->create( "foo" );72 my $uri2 =$idata->replicate( "foo" );72 $idata->create( "foo" ); 73 $idata->replicate( "foo" ); 73 74 74 75 my $locations = $idata->find_instances( "foo", "node01" ); 75 76 76 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); 77 is( scalar @$locations, 2, "found 2" ); 78 like( @$locations[0], qr/file:/, "URIs match" ); 79 like( @$locations[1], qr/file:/, "URIs match" ); 77 80 } 78 81 … … 111 114 112 115 Test::IData->cleanup; 113 114 } -
trunk/Nebulous/t/16_client_find_instances.t
r2868 r2870 6 6 use Apache::Test qw( -withtestmore ); 7 7 8 plan tests => 7;8 plan tests => 13; 9 9 10 10 use lib qw( ./t ./lib ); … … 18 18 Test::IData->setup; 19 19 20 SKIP: {21 skip "need to write a module to validate URIs", 7;22 23 20 { 24 21 # key … … 26 23 proxy => "http://$hostport/idata", 27 24 ); 28 my $uri =$idata->create( "foo" );25 $idata->create( "foo" ); 29 26 30 27 my $locations = $idata->find_instances( "foo" ); 31 28 32 is( $uri, @$locations[0], "URIs match" ); 29 is( scalar @$locations, 1, "found 1" ); 30 like( @$locations[0], qr/file:/, "URIs match" ); 33 31 } 34 32 … … 40 38 proxy => "http://$hostport/idata", 41 39 ); 42 my $uri1 =$idata->create( "foo" );43 my $uri2 =$idata->replicate( "foo" );40 $idata->create( "foo" ); 41 $idata->replicate( "foo" ); 44 42 45 43 my $locations = $idata->find_instances( "foo" ); 46 44 47 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); 45 is( scalar @$locations, 2, "found 2" ); 46 like( @$locations[0], qr/file:/, "URIs match" ); 47 like( @$locations[1], qr/file:/, "URIs match" ); 48 48 } 49 49 … … 55 55 proxy => "http://$hostport/idata", 56 56 ); 57 my $uri =$idata->create( "foo" );57 $idata->create( "foo" ); 58 58 59 59 my $locations = $idata->find_instances( "foo", "node01" ); 60 60 61 is( $uri, $locations->[0], "URIs match" ); 61 is( scalar @$locations, 1, "found 1" ); 62 like( @$locations[0], qr/file:/, "URIs match" ); 62 63 } 63 64 … … 69 70 proxy => "http://$hostport/idata", 70 71 ); 71 my $uri1 =$idata->create( "foo" );72 my $uri2 =$idata->replicate( "foo" );72 $idata->create( "foo" ); 73 $idata->replicate( "foo" ); 73 74 74 75 my $locations = $idata->find_instances( "foo", "node01" ); 75 76 76 ok( eq_set( [$uri1, $uri2], $locations ), "URIs match" ); 77 is( scalar @$locations, 2, "found 2" ); 78 like( @$locations[0], qr/file:/, "URIs match" ); 79 like( @$locations[1], qr/file:/, "URIs match" ); 77 80 } 78 81 … … 111 114 112 115 Test::IData->cleanup; 113 114 }
Note:
See TracChangeset
for help on using the changeset viewer.
