2 # checkin: test Checkin Response
8 use Sip::Constants qw(:all);
10 use SIPtest qw($datepat $textpat $instid $user_barcode
11 $item_barcode $item_title);
13 my $checkin_test_template = {
14 id => 'Checkin: Item is checked out',
15 msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
16 pat => qr/^101YNN$datepat/o,
18 $SIPtest::field_specs{(FID_INST_ID)},
19 $SIPtest::field_specs{(FID_SCREEN_MSG)},
20 $SIPtest::field_specs{(FID_PRINT_LINE)},
21 { field => FID_PATRON_ID,
22 pat => qr/^$user_barcode$/o,
24 { field => FID_ITEM_ID,
25 pat => qr/^$item_barcode$/o,
27 { field => FID_PERM_LOCN,
30 { field => FID_TITLE_ID,
31 pat => qr/^$item_title\s*$/o,
32 required => 1, }, # not required by the spec.
35 my $checkout_template = {
36 id => 'Checkin: prep: check out item',
37 msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
38 pat => qr/^121NNY$datepat/o,
44 $SIPtest::sc_status_test,
46 $checkin_test_template,
51 # Checkin item that's not checked out. Basically, this
52 # is identical to the first case, except the header says that
53 # the ILS didn't check the item in, and there's no patron id.
54 $test = clone($checkin_test_template);
55 $test->{id} = 'Checkin: Item not checked out';
56 $test->{pat} = qr/^100YNN$datepat/o;
57 $test->{fields} = [grep $_->{field} ne FID_PATRON_ID, @{$test->{fields}}];
62 # Still need tests for magnetic media
65 SIPtest::run_sip_tests(@tests);