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