3 use Test::More tests => 2;
5 diag("Tests libdbi transaction error reporting");
7 use strict; use warnings;
9 use OpenILS::Utils::TestUtils;
10 use OpenILS::Utils::CStoreEditor (':funcs');
11 use OpenILS::Utils::Fieldmapper;
12 my $script = OpenILS::Utils::TestUtils->new();
15 my $e = new_editor(xact => 1);
18 # create a copy status object with ID 1, which will fail.
19 my $stat = Fieldmapper::config::copy_status->new;
22 # when functioning well, this should happen and fail quickly
24 $e->create_config_copy_status($stat);
25 my $evt = $e->die_event; # this part takes the longest
26 my $duration = time - $start;
28 cmp_ok($duration, '<', '10',
29 'Confirm cstore reports standard update query error in a timely fashion');
32 is($evt->{textcode}, 'DATABASE_UPDATE_FAILED',
33 'CStoreEditor returns standard update query error');
35 fail('CStoreEditor returned no event');