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