IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 13092 for trunk/Nebulous/t


Ignore:
Timestamp:
Apr 30, 2007, 4:52:04 PM (19 years ago)
Author:
jhoblitt
Message:

remove $class_id & $comment params from Nebulous::Server->create() and Nebulous::Client->create*() and all supporting functions and tests

Location:
trunk/Nebulous/t
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/03_server_create_object.t

    r12960 r13092  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 03_server_create_object.t,v 1.12 2007-04-23 20:42:29 jhoblitt Exp $
     5# $Id: 03_server_create_object.t,v 1.13 2007-05-01 02:52:04 jhoblitt Exp $
    66
    77use strict;
    88use warnings FATAL => qw( all );
    99
    10 use Test::More tests => 14;
     10use Test::More tests => 8;
    1111
    1212use lib qw( ./t ./lib );
     
    3838
    3939{
    40     # key, class
    41     my $uri = $neb->create_object("foo", 0);
    42 
    43     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
    44     ok(-e $path, "file exists");
    45     uri_scheme_ok($uri, 'file');
    46 }
    47 
    48 Test::Nebulous->setup;
    49 
    50 {
    51     # key, class, volume
    52     my $uri = $neb->create_object("foo", 0, "node01");
    53 
    54     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
    55     ok(-e $path, "file exists");
    56     uri_scheme_ok($uri, 'file');
    57 }
    58 
    59 Test::Nebulous->setup;
    60 
    61 {
    62     # key, class, volume, comment
    63     my $uri = $neb->create_object("foo", 0, "node01", "this is foo");
     40    # key, volume
     41    my $uri = $neb->create_object("foo", "node01");
    6442
    6543    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
     
    7856Test::Nebulous->setup;
    7957
    80 {
    81     my $uri = $neb->create_object("foo", 1);
    82 
    83     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
    84     ok(-e $path, "class exists");
    85 }
    86 
    87 Test::Nebulous->setup;
    88 
    8958eval {
    9059    $neb->create_object("foo", 99);
    9160};
    92 like($@, qr/did not pass the \'is valid class id\'/, "class doesn't exist");
    93 
    94 Test::Nebulous->setup;
    95 
    96 eval {
    97     $neb->create_object(1, 0, 'node01', 'x' x 256);
    98 };
    99 like($@, qr/comment length/, "comment is too long");
     61like($@, qr/did not pass the \'is valid volume name\'/, "volume name doesn't exist");
    10062
    10163Test::Nebulous->setup;
     
    10466    $neb->create_object();
    10567};
    106 like($@, qr/2 - 4 were expected/, "no params");
     68like($@, qr/1 - 2 were expected/, "no params");
    10769
    10870Test::Nebulous->setup;
    10971
    11072eval {
    111     $neb->create_object( 1, 0, 'node01', 1, 1 );
     73    $neb->create_object(1, "node01", 3);
    11274};
    113 like($@, qr/2 - 4 were expected/, "too many params");
     75like($@, qr/1 - 2 were expected/, "too many params");
    11476
    11577Test::Nebulous->cleanup;
  • trunk/Nebulous/t/09_server_stat_object.t

    r12646 r13092  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 09_server_stat_object.t,v 1.9 2007-03-28 22:01:37 jhoblitt Exp $
     5# $Id: 09_server_stat_object.t,v 1.10 2007-05-01 02:52:04 jhoblitt Exp $
    66
    77use strict;
    88use warnings FATAL => qw( all );
    99
    10 use Test::More tests => 13;
     10use Test::More tests => 11;
    1111
    1212use lib qw( ./t ./lib );
     
    2929    my $info = $neb->stat_object("foo");
    3030
    31     is(scalar @$info, 8, "number of columns");
     31    is(scalar @$info, 6, "number of columns");
    3232}
    3333
     
    3535
    3636{
    37     my $uri = $neb->create_object("foo", 0, "node01", "foobar");
     37    my $uri = $neb->create_object("foo", "node01");
    3838
    3939    my $info = $neb->stat_object("foo");
    4040
    41     is(scalar @$info, 8,                       "number of columns");
     41    is(scalar @$info, 6,                       "number of columns");
    4242    is(@$info[0], 1,                           "so_id");
    4343    is(@$info[1], "foo",                       "ext_id");
    44     is(@$info[2], 0,                           "class_id");
    45     is(@$info[3], "foobar",                    "comment");
    46     is(@$info[4], 0,                           "read lock");
    47     is(@$info[5], undef,                       "write lock");
    48     like(@$info[6], qr/....-..-.. ..:..:../,   "epoch");
    49     like(@$info[6], qr/....-..-.. ..:..:../,   "mtime");
     44    is(@$info[2], 0,                           "read lock");
     45    is(@$info[3], undef,                       "write lock");
     46    like(@$info[4], qr/....-..-.. ..:..:../,   "epoch");
     47    like(@$info[5], qr/....-..-.. ..:..:../,   "mtime");
    5048}
    5149
  • trunk/Nebulous/t/51_client_create.t

    r12960 r13092  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 51_client_create.t,v 1.2 2007-04-23 20:42:29 jhoblitt Exp $
     5# $Id: 51_client_create.t,v 1.3 2007-05-01 02:52:04 jhoblitt Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 11;
     12plan tests => 7;
    1313
    1414use lib qw( ./t ./lib );
     
    4040
    4141{
    42     # key, class
     42    # key, volume
    4343    my $neb = Nebulous::Client->new(
    4444        proxy => "http://$hostport/nebulous",
    4545    );
    4646
    47     my $uri = $neb->create("foo", 0);
    48 
    49     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
    50     ok(-e $path, "good filename");
    51     uri_scheme_ok($uri, 'file');
    52 }
    53 
    54 Test::Nebulous->setup;
    55 
    56 {
    57     # key, class, volume
    58     my $neb = Nebulous::Client->new(
    59         proxy => "http://$hostport/nebulous",
    60     );
    61 
    62     my $uri = $neb->create("foo", 0, "node01");
    63 
    64     my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
    65     ok(-e $path, "good filename");
    66     uri_scheme_ok($uri, 'file');
    67 }
    68 
    69 Test::Nebulous->setup;
    70 
    71 {
    72     # key, class, volume, comment
    73     my $neb = Nebulous::Client->new(
    74         proxy => "http://$hostport/nebulous",
    75     );
    76 
    77     my $uri = $neb->create("foo", 0, "node01", "this is foo");
     47    my $uri = $neb->create("foo", "node01");
    7848
    7949    my ($scheme, $auth, $path, $query, $frag) = uri_split($uri);
     
    10272    $neb->create();
    10373};
    104 like($@, qr/2 - 4 were expected/, "no params");
     74like($@, qr/1 - 2 were expected/, "no params");
    10575
    10676Test::Nebulous->setup;
     
    11181    );
    11282
    113     $neb->create(1, 2, 3, 4, 5);
     83    $neb->create(1, 2, 3);
    11484};
    115 like($@, qr/2 - 4 were expected/, "too many params");
     85like($@, qr/1 - 2 were expected/, "too many params");
    11686
    11787Test::Nebulous->cleanup;
  • trunk/Nebulous/t/51_client_open_create.t

    r12960 r13092  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 51_client_open_create.t,v 1.2 2007-04-23 20:42:29 jhoblitt Exp $
     5# $Id: 51_client_open_create.t,v 1.3 2007-05-01 02:52:04 jhoblitt Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 7;
     12plan tests => 5;
    1313
    1414use lib qw( ./t ./lib );
     
    3636
    3737{
    38     # key, class
     38    # key, volume
    3939    my $neb = Nebulous::Client->new(
    4040        proxy => "http://$hostport/nebulous",
    4141    );
    4242
    43     my $fh = $neb->open_create( "foo", 0 );
    44 
    45     is(ref $fh, 'GLOB', "good filehandle");
    46 }
    47 
    48 Test::Nebulous->setup;
    49 
    50 {
    51     # key, class, volume
    52     my $neb = Nebulous::Client->new(
    53         proxy => "http://$hostport/nebulous",
    54     );
    55 
    56     my $fh = $neb->open_create("foo", 0, "node01");
    57 
    58     is(ref $fh, 'GLOB', "good filehandle");
    59 }
    60 
    61 Test::Nebulous->setup;
    62 
    63 {
    64     # key, class, volume, comment
    65     my $neb = Nebulous::Client->new(
    66         proxy => "http://$hostport/nebulous",
    67     );
    68 
    69     my $fh = $neb->open_create("foo", 0, "node01", "this is foo");
     43    my $fh = $neb->open_create("foo", "node01");
    7044
    7145    is(ref $fh, 'GLOB', "good filehandle");
     
    9266    $neb->open_create();
    9367};
    94 like($@, qr/2 - 4 were expected/, "no params");
     68like($@, qr/1 - 2 were expected/, "no params");
    9569
    9670Test::Nebulous->setup;
     
    10175    );
    10276
    103     $neb->open_create(1, 2, 3, 4, 5);
     77    $neb->open_create(1, 2, 3);
    10478};
    105 like($@, qr/2 - 4 were expected/, "too many params");
     79like($@, qr/1 - 2 were expected/, "too many params");
    10680
    10781Test::Nebulous->cleanup;
  • trunk/Nebulous/t/63_client_stat.t

    r5667 r13092  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 63_client_stat.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
     5# $Id: 63_client_stat.t,v 1.2 2007-05-01 02:52:04 jhoblitt Exp $
    66
    77use strict;
     
    1010use Apache::Test qw( -withtestmore );
    1111
    12 plan tests => 13;
     12plan tests => 11;
    1313
    1414use lib qw( ./t ./lib );
     
    3030    my $info = $neb->stat( "foo" );
    3131
    32     is( scalar @$info, 8, "number of columns" );
     32    is( scalar @$info, 6, "number of columns" );
    3333}
    3434
     
    3939        proxy => "http://$hostport/nebulous",
    4040    );
    41     $neb->create( "foo", 0, "node01", "foobar" );
     41    $neb->create( "foo", "node01" );
    4242
    4343    my $info = $neb->stat( "foo" );
    4444
    45     is( scalar @$info, 8,                       "number of columns" );
     45    is( scalar @$info, 6,                       "number of columns" );
    4646    is( @$info[0], 1,                           "so_id" );
    4747    is( @$info[1], "foo",                       "ext_id" );
    48     is( @$info[2], 0,                           "class_id" );
    49     is( @$info[3], "foobar",                    "comment" );
    50     is( @$info[4], 0,                           "read lock" );
    51     is( @$info[5], undef,                       "write lock" );
    52     like( @$info[6], qr/....-..-.. ..:..:../,   "epoch" );
    53     like( @$info[6], qr/....-..-.. ..:..:../,   "mtime" );
     48    is( @$info[2], 0,                           "read lock" );
     49    is( @$info[3], undef,                       "write lock" );
     50    like( @$info[4], qr/....-..-.. ..:..:../,   "epoch" );
     51    like( @$info[5], qr/....-..-.. ..:..:../,   "mtime" );
    5452}
    5553
  • trunk/Nebulous/t/Test/Nebulous.pm

    r13045 r13092  
    11# Copyright (C) 2004  Joshua Hoblitt
    22#
    3 # $Id: Nebulous.pm,v 1.10 2007-04-26 22:27:13 jhoblitt Exp $
     3# $Id: Nebulous.pm,v 1.11 2007-05-01 02:52:04 jhoblitt Exp $
    44
    55package Test::Nebulous;
     
    4242    $dbh->do(qq{ INSERT INTO volume VALUES (2,'node02',?) }, undef, $dir2);
    4343    $dbh->do(qq{ INSERT INTO mount VALUES (?, 10e10, 10e10) }, undef, $dir2);
    44 
    45 #   class ID 0 should be setup by default
    46 #    $dbh->do(qq{ INSERT INTO class VALUES (0, 0, "regular data") });
    47     $dbh->do(qq{ INSERT INTO class VALUES (1, 1, "special data") });
    4844}
    4945
Note: See TracChangeset for help on using the changeset viewer.