From 77b6875f95aa54fe9c648ba114e06d85cf655bb1 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Wed, 23 Jan 2008 03:33:41 +0000 Subject: Refactor database initialization into a new Wallet::Admin module. --- perl/t/object.t | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'perl/t/object.t') diff --git a/perl/t/object.t b/perl/t/object.t index 101110a..48604bc 100755 --- a/perl/t/object.t +++ b/perl/t/object.t @@ -4,7 +4,7 @@ # t/object.t -- Tests for the basic object implementation. # # Written by Russ Allbery -# Copyright 2007 Board of Trustees, Leland Stanford Jr. University +# Copyright 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -12,9 +12,9 @@ use POSIX qw(strftime); use Test::More tests => 131; use Wallet::ACL; +use Wallet::Admin; use Wallet::Config; use Wallet::Object::Base; -use Wallet::Server; use lib 't/lib'; use Util; @@ -25,12 +25,12 @@ my $host = 'localhost'; my @trace = ($user, $host, time); my $princ = 'service/test@EXAMPLE.COM'; -# Use Wallet::Server to set up the database. +# Use Wallet::Admin to set up the database. db_setup; -my $server = eval { Wallet::Server->reinitialize ($user) }; -is ($@, '', 'Database initialization did not die'); -ok ($server->isa ('Wallet::Server'), ' and returned the right class'); -my $dbh = $server->dbh; +my $admin = eval { Wallet::Admin->new }; +is ($@, '', 'Database connection succeeded'); +is ($admin->reinitialize ($user), 1, 'Database initialization succeeded'); +my $dbh = $admin->dbh; # Okay, now we have a database. Test create and new. We make believe this is # a keytab object; it won't matter for what we're doing. -- cgit v1.2.3