2 # ---------------------------------------------------------------
3 # Copyright (C) 2010 Equinox Software, Inc
4 # Author: Joe Atzberger <jatzberger@esilibrary.com>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 # ---------------------------------------------------------------
17 use strict; use warnings;
18 use vars qw/ $session $e $i $call/;
20 use Test::More qw/no_plan/;
24 my $nap = shift @ARGV;
25 diag("OK, this time we'll sleep for $nap seconds to see if CStore wakes up");
32 $call = 'retrieve_all_acq_edi_account';
33 use_ok('OpenILS::Utils::Cronscript');
35 use_ok('OpenILS::Utils::CStoreEditor');
38 ok($session = OpenILS::Utils::Cronscript->new()->session('open-ils.acq'),
39 "new session created");
43 ok($e = OpenILS::Utils::CStoreEditor->new(xact => 1),
44 "new CStoreEditor created");
46 until (can_ok($e, $call) or $i-- == 0) {
47 diag("CStore FAIL: cannot $call");
49 diag("reloading: prepare for a ton of warnings");
50 delete $INC{'OpenILS/Utils/CStoreEditor.pm'};
51 require_ok('OpenILS::Utils::CStoreEditor');
53 ok($e = OpenILS::Utils::CStoreEditor->new(xact => 1),
54 "replacement CStoreEditor created");
57 my $set = $e->retrieve_all_acq_edi_account();
58 ok(defined($set), $call);