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');
34 ok($session = OpenILS::Utils::Cronscript->new()->session('open-ils.acq'),
35 "new session created");
40 use_ok('OpenILS::Utils::CStoreEditor');
45 ok($e = OpenILS::Utils::CStoreEditor->new(xact => 1),
46 "new CStoreEditor created");
48 until (can_ok($e, $call) or $i-- == 0) {
49 diag("CStore FAIL: cannot $call");
51 diag("reloading: prepare for a ton of warnings");
52 delete $INC{'OpenILS/Utils/CStoreEditor.pm'};
53 require_ok('OpenILS::Utils::CStoreEditor');
55 ok($e = OpenILS::Utils::CStoreEditor->new(xact => 1),
56 "replacement CStoreEditor created");
59 my $set = $e->retrieve_all_acq_edi_account();
60 ok(defined($set), $call);