2 # checkin: test Checkin Response
8 use Sip::Constants qw(:all);
9 use SIPtest qw(:basic :user1 :item1);
11 # Checkout response, format:
15 # magnetic media: Y, N or U
19 # Checkin response, format:
23 # magnetic media: Y, N or U
27 my $checkout_template = {
28 id => "Checkin: prep: check out item ($item_barcode)",
29 msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
30 pat => qr/^121N[NYU][NY]$datepat/,
34 my $checkin_test_template = {
35 id => "Checkin: Item ($item_barcode) is checked out",
36 msg => "09N20060102 08423620060113 084235AP$item_owner|AO$instid|AB$item_barcode|AC$password|",
37 pat => qr/^101[NY][NYU]N$datepat/,
39 $SIPtest::field_specs{(FID_INST_ID )},
40 $SIPtest::field_specs{(FID_SCREEN_MSG)},
41 $SIPtest::field_specs{(FID_PRINT_LINE)},
42 { field => FID_PATRON_ID,
43 pat => qr/^$user_barcode$/,
45 { field => FID_ITEM_ID,
46 pat => qr/^$item_barcode$/,
48 { field => FID_PERM_LOCN,
51 { field => FID_TITLE_ID,
52 pat => qr/^$item_title\s*$/,
53 required => 1, }, # not required by the spec.
54 { field => FID_DESTINATION_LOCATION,
55 pat => qr/^$item_owner\s*$/,
56 required => 0, }, # 3M Extension
61 $SIPtest::sc_status_test,
63 $checkin_test_template,
68 # Checkin item that's not checked out. Basically, this
69 # is identical to the first case, except the header says that
70 # the ILS didn't check the item in, and there's no patron id.
71 $test = clone($checkin_test_template);
72 $test->{id} = 'Checkin: Item not checked out';
73 $test->{pat} = qr/^100[NY][NYU][NY]$datepat/o;
74 $test->{fields} = [grep $_->{field} ne FID_PATRON_ID, @{$test->{fields}}];
79 # Still need tests for magnetic media
82 SIPtest::run_sip_tests(@tests);