IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 28, 2007, 11:41:11 AM (19 years ago)
Author:
jhoblitt
Message:

ws

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/06_server_unlock_object.t

    r10546 r12641  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 06_server_unlock_object.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
     5# $Id: 06_server_unlock_object.t,v 1.7 2007-03-28 21:41:11 jhoblitt Exp $
    66
    77use strict;
     
    2525
    2626{
    27     $neb->create_object( "foo" );
     27    $neb->create_object("foo");
    2828
    29     $neb->lock_object( "foo", "read" );
     29    $neb->lock_object("foo", "read");
    3030
    31     ok( $neb->unlock_object( "foo", "read" ), "read unlock" );
     31    ok($neb->unlock_object("foo", "read"), "read unlock");
    3232}
    3333
     
    3535
    3636{
    37     $neb->create_object( "foo" );
     37    $neb->create_object("foo");
    3838
    39     $neb->lock_object( "foo", "read" );
    40     $neb->lock_object( "foo", "read" );
     39    $neb->lock_object("foo", "read");
     40    $neb->lock_object("foo", "read");
    4141
    42     ok( $neb->unlock_object( "foo", "read" ), "read unlock" );
    43     ok( $neb->unlock_object( "foo", "read" ), "read unlock" );
     42    ok($neb->unlock_object("foo", "read"), "read unlock");
     43    ok($neb->unlock_object("foo", "read"), "read unlock");
    4444}
    4545
     
    4747
    4848{
    49     $neb->create_object( "foo" );
     49    $neb->create_object("foo");
    5050
    51     $neb->lock_object( "foo", "write" );
     51    $neb->lock_object("foo", "write");
    5252
    53     ok( $neb->unlock_object( "foo", "write" ), "write unlock" );
     53    ok($neb->unlock_object("foo", "write"), "write unlock");
    5454}
    5555
     
    5757
    5858eval {
    59     $neb->unlock_object( "foo", "read" );
     59    $neb->unlock_object("foo", "read");
    6060};
    61 like( $@, qr/storage object does not exist/, "storage object does not exist" );
     61like($@, qr/storage object does not exist/, "storage object does not exist");
    6262
    6363Test::Nebulous->setup;
    6464
    6565eval {
    66     $neb->unlock_object( "foo", "write" );
     66    $neb->unlock_object("foo", "write");
    6767};
    68 like( $@, qr/storage object does not exist/, "storage object does not exist" );
     68like($@, qr/storage object does not exist/, "storage object does not exist");
    6969
    7070Test::Nebulous->setup;
    7171
    7272eval {
    73     $neb->create_object( "foo" );
     73    $neb->create_object("foo");
    7474
    75     $neb->unlock_object( "foo", "read" );
     75    $neb->unlock_object("foo", "read");
    7676};
    77 like( $@, qr/can not remove non-existant read lock/, "no lock set" );
     77like($@, qr/can not remove non-existant read lock/, "no lock set");
    7878
    7979Test::Nebulous->setup;
    8080
    8181eval {
    82     $neb->create_object( "foo" );
     82    $neb->create_object("foo");
    8383
    84     $neb->unlock_object( "foo", "write" );
     84    $neb->unlock_object("foo", "write");
    8585};
    86 like( $@, qr/can not remove non-existant write lock/, "no lock set" );
     86like($@, qr/can not remove non-existant write lock/, "no lock set");
    8787
    8888Test::Nebulous->setup;
    8989
    9090eval {
    91     $neb->create_object( "foo" );
    92     $neb->lock_object( "foo", "write" );
     91    $neb->create_object("foo");
     92    $neb->lock_object("foo", "write");
    9393
    94     $neb->unlock_object( "foo", "read" );
     94    $neb->unlock_object("foo", "read");
    9595};
    96 like( $@, qr/can not have a read lock under a write lock/, "read unlock under write lock" );
     96like($@, qr/can not have a read lock under a write lock/, "read unlock under write lock");
    9797
    9898Test::Nebulous->setup;
    9999
    100100eval {
    101     $neb->create_object( "foo" );
    102     $neb->lock_object( "foo", "read" );
     101    $neb->create_object("foo");
     102    $neb->lock_object("foo", "read");
    103103
    104     $neb->unlock_object( "foo", "write" );
     104    $neb->unlock_object("foo", "write");
    105105};
    106 like( $@, qr/can not have a write lock under a read lock/, "write unlock under read lock" );
     106like($@, qr/can not have a write lock under a read lock/, "write unlock under read lock");
    107107
    108108Test::Nebulous->setup;
     
    111111    $neb->unlock_object();
    112112};
    113 like( $@, qr/2 were expected/, "no params" );
     113like($@, qr/2 were expected/, "no params");
    114114
    115115Test::Nebulous->setup;
    116116
    117117eval {
    118     $neb->unlock_object( "foo" );
     118    $neb->unlock_object("foo");
    119119};
    120 like( $@, qr/2 were expected/, "not enough params" );
     120like($@, qr/2 were expected/, "not enough params");
    121121
    122122Test::Nebulous->setup;
    123123
    124124eval {
    125     $neb->unlock_object( "foo", "both" );
     125    $neb->unlock_object("foo", "both");
    126126};
    127 like( $@, qr/is read or write/, "not read or write" );
     127like($@, qr/is read or write/, "not read or write");
    128128
    129129Test::Nebulous->setup;
    130130
    131131eval {
    132     $neb->unlock_object( "foo", 'read', 3 );
     132    $neb->unlock_object("foo", 'read', 3);
    133133};
    134 like( $@, qr/2 were expected/, "too many params" );
     134like($@, qr/2 were expected/, "too many params");
    135135
    136136Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.