IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10546 for trunk/Nebulous/t


Ignore:
Timestamp:
Dec 7, 2006, 5:29:19 PM (20 years ago)
Author:
jhoblitt
Message:

change Nebulous::Server instantiate objects (init -> new) instead of working with class data
add a DESTROY method to Nebulous::Server to tear down the database connection

Location:
trunk/Nebulous/t
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous/t/02_server_setup.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 02_server_setup.t,v 1.4 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 02_server_setup.t,v 1.5 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1717Test::Nebulous->setup;
    1818
    19 ok(
    20     Nebulous::Server->init(
     19isa_ok(
     20    Nebulous::Server->new(
    2121        dsn         => "DBI:mysql:database=test:host=localhost",
    2222        dbuser      => "test",
    2323        dbpasswd    => "",
    2424    ),
    25     "connect",
     25    "Nebulous::Server"
    2626);
    2727
     
    2929
    3030eval {
    31     Nebulous::Server->init(
     31    Nebulous::Server->new(
    3232        dsn         => "DBI:mysql:database=foobar:host=localhost",
    3333        dbuser      => "baz",
  • trunk/Nebulous/t/03_server_create_object.t

    r5504 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 03_server_create_object.t,v 1.10 2005-11-10 22:07:53 jhoblitt Exp $
     5# $Id: 03_server_create_object.t,v 1.11 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/04_server_replicate_object.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 04_server_replicate_object.t,v 1.5 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 04_server_replicate_object.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/05_server_lock_object.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 05_server_lock_object.t,v 1.5 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 05_server_lock_object.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/06_server_unlock_object.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 06_server_unlock_object.t,v 1.5 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 06_server_unlock_object.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/07_server_find_instances.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 07_server_find_instances.t,v 1.5 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 07_server_find_instances.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/08_server_delete_instance.t

    r4873 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 08_server_delete_instance.t,v 1.5 2005-08-25 01:40:04 jhoblitt Exp $
     5# $Id: 08_server_delete_instance.t,v 1.6 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/09_server_is_valid_class_id.t

    r5498 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 09_server_is_valid_class_id.t,v 1.1 2005-11-10 21:31:26 jhoblitt Exp $
     5# $Id: 09_server_is_valid_class_id.t,v 1.2 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
     
    2422);
    2523
    26 *_is_valid_class_id = \&Nebulous::Server::_is_valid_class_id;
    27 
    2824Test::Nebulous->setup;
    2925
    3026# 0 is the default and is guarenteed to exist
    31 ok( _is_valid_class_id( 0 ), "default class id");
     27ok( $neb->_is_valid_class_id( 0 ), "default class id");
    3228
    3329Test::Nebulous->setup;
    3430
    3531# the test setup adds class id 1
    36 ok( _is_valid_class_id( 1 ), "custom class id");
     32ok( $neb->_is_valid_class_id( 1 ), "custom class id");
    3733
    3834Test::Nebulous->setup;
    3935
    40 is( _is_valid_class_id( 99 ), undef, "invalid class id");
     36is( $neb->_is_valid_class_id( 99 ), undef, "invalid class id");
    4137
    4238Test::Nebulous->cleanup;
  • trunk/Nebulous/t/09_server_stat_object.t

    r5492 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 09_server_stat_object.t,v 1.7 2005-11-09 01:35:59 jhoblitt Exp $
     5# $Id: 09_server_stat_object.t,v 1.8 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
  • trunk/Nebulous/t/10_server_is_valid_volume_name.t

    r5667 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 10_server_is_valid_volume_name.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
     5# $Id: 10_server_is_valid_volume_name.t,v 1.2 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
     
    2422);
    2523
    26 *_is_valid_volume_name = \&Nebulous::Server::_is_valid_volume_name;
     24Test::Nebulous->setup;
     25
     26ok( $neb->_is_valid_volume_name( 'node01' ), "valid volume name" );
    2727
    2828Test::Nebulous->setup;
    2929
    30 ok( _is_valid_volume_name( 'node01' ), "valid volume name" );
     30ok( $neb->_is_valid_volume_name( 'node02' ), "valid volume name" );
    3131
    3232Test::Nebulous->setup;
    3333
    34 ok( _is_valid_volume_name( 'node02' ), "valid volume name" );
    35 
    36 Test::Nebulous->setup;
    37 
    38 is( _is_valid_volume_name( 'node99' ), undef, "invalid volume name" );
     34is( $neb->_is_valid_volume_name( 'node99' ), undef, "invalid volume name" );
    3935
    4036Test::Nebulous->cleanup;
  • trunk/Nebulous/t/11_server_is_valid_class_id.t

    r5667 r10546  
    33# Copryight (C) 2004-2005  Joshua Hoblitt
    44#
    5 # $Id: 11_server_is_valid_class_id.t,v 1.1 2005-12-03 02:52:31 jhoblitt Exp $
     5# $Id: 11_server_is_valid_class_id.t,v 1.2 2006-12-08 03:29:19 jhoblitt Exp $
    66
    77use strict;
     
    1616use Test::Nebulous;
    1717
    18 my $neb = "Nebulous::Server";
    19 
    20 $neb->init(
     18my $neb = Nebulous::Server->new(
    2119    dsn         => "DBI:mysql:database=test:host=localhost",
    2220    dbuser      => "test",
     
    2422);
    2523
    26 *_is_valid_class_id = \&Nebulous::Server::_is_valid_class_id;
    27 
    2824Test::Nebulous->setup;
    2925
    3026# 0 is the default and is guarenteed to exist
    31 ok( _is_valid_class_id( 0 ), "default class id");
     27ok( $neb->_is_valid_class_id( 0 ), "default class id");
    3228
    3329Test::Nebulous->setup;
    3430
    3531# the test setup adds class id 1
    36 ok( _is_valid_class_id( 1 ), "custom class id");
     32ok( $neb->_is_valid_class_id( 1 ), "custom class id");
    3733
    3834Test::Nebulous->setup;
    3935
    40 is( _is_valid_class_id( 99 ), undef, "invalid class id");
     36is( $neb->_is_valid_class_id( 99 ), undef, "invalid class id");
    4137
    4238Test::Nebulous->cleanup;
Note: See TracChangeset for help on using the changeset viewer.