This is going to cause some poor indentation, but I'm tired of tripping over these tabs :)
Signed-off-by: Jason Etheridge <jason@EquinoxOLI.org>
use SIPtest qw($datepat $username $password $login_test $sc_status_test);
my $invalid_uname = { id => 'Invalid username',
- msg => "9300CNinvalid$username|CO$password|CPThe floor|",
- pat => qr/^940/,
- fields => [], };
+ msg => "9300CNinvalid$username|CO$password|CPThe floor|",
+ pat => qr/^940/,
+ fields => [], };
my $invalid_pwd = { id => 'Invalid password',
- msg => "9300CN$username|COinvalid$password|CPThe floor|",
- pat => qr/^940/,
- fields => [], };
+ msg => "9300CN$username|COinvalid$password|CPThe floor|",
+ pat => qr/^940/,
+ fields => [], };
my @tests = ( $invalid_uname, $invalid_pwd, $login_test, $sc_status_test );
use Sip::Constants qw(:all);
use SIPtest qw($datepat $instid $currency $user_barcode $user_pin
- $user_fullname $user_homeaddr $user_email $user_phone
- $user_birthday);
+ $user_fullname $user_homeaddr $user_email $user_phone
+ $user_birthday);
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- { id => 'valid Patron Status',
- msg => "2300120060101 084237AO$SIPtest::instid|AA$user_barcode|AD$user_pin|AC|",
- pat => qr/^24 [ Y]{13}\d{3}$datepat/,
- fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PERSONAL_NAME,
- pat => qr/^$user_fullname$/o,
- required => 1, },
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode/o,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- required => 0, },
- { field => FID_VALID_PATRON_PWD,
- pat => qr/^Y$/,
- required => 0, },
- { field => FID_CURRENCY,
- pat => qr/^$currency$/io,
- required => 0, },
- { field => FID_FEE_AMT,
- pat => qr/^[0-9.]+$/,
- required => 0, },
- ], },
- { id => 'invalid password Patron Status',
- msg => "2300120060101 084237AO$instid|AA$user_barcode|AC|ADbadw|",
- pat => qr/^24[ Y]{14}\d{3}$datepat/,
- fields => [
- { field => FID_PERSONAL_NAME,
- pat => qr/^$user_fullname$/o,
- required => 1, },
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/o,
- required => 1, },
- { field => FID_INST_ID,
- pat => qr/^$instid$/o,
- required => 1, },
- { field => FID_VALID_PATRON_PWD,
- pat => qr/^N$/,
- required => 0, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- required => 0, },
- ], },
- { id => 'invalid Patron Status',
- msg => "2300120060101 084237AO$instid|AAwshakespeare|AC|",
- pat => qr/^24Y[ Y]{13}\d{3}$datepat/,
- fields => [
- { field => FID_PERSONAL_NAME,
- pat => qr/^$/,
- required => 1, },
- { field => FID_PATRON_ID,
- pat => qr/^wshakespeare$/,
- required => 1, },
- { field => FID_INST_ID,
- pat => qr/^$instid$/o,
- required => 1, },
- ], },
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ { id => 'valid Patron Status',
+ msg => "2300120060101 084237AO$SIPtest::instid|AA$user_barcode|AD$user_pin|AC|",
+ pat => qr/^24 [ Y]{13}\d{3}$datepat/,
+ fields => [
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$user_fullname$/o,
+ required => 1, },
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode/o,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ required => 0, },
+ { field => FID_VALID_PATRON_PWD,
+ pat => qr/^Y$/,
+ required => 0, },
+ { field => FID_CURRENCY,
+ pat => qr/^$currency$/io,
+ required => 0, },
+ { field => FID_FEE_AMT,
+ pat => qr/^[0-9.]+$/,
+ required => 0, },
+ ], },
+ { id => 'invalid password Patron Status',
+ msg => "2300120060101 084237AO$instid|AA$user_barcode|AC|ADbadw|",
+ pat => qr/^24[ Y]{14}\d{3}$datepat/,
+ fields => [
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$user_fullname$/o,
+ required => 1, },
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/o,
+ required => 1, },
+ { field => FID_INST_ID,
+ pat => qr/^$instid$/o,
+ required => 1, },
+ { field => FID_VALID_PATRON_PWD,
+ pat => qr/^N$/,
+ required => 0, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ required => 0, },
+ ], },
+ { id => 'invalid Patron Status',
+ msg => "2300120060101 084237AO$instid|AAwshakespeare|AC|",
+ pat => qr/^24Y[ Y]{13}\d{3}$datepat/,
+ fields => [
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$/,
+ required => 1, },
+ { field => FID_PATRON_ID,
+ pat => qr/^wshakespeare$/,
+ required => 1, },
+ { field => FID_INST_ID,
+ pat => qr/^$instid$/o,
+ required => 1, },
+ ], },
+ );
SIPtest::run_sip_tests(@tests);
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $currency $user_barcode $user_pin
- $user_fullname $user_homeaddr $user_email $user_phone
- $user_birthday $user_ptype $user_inet $user_homelib);
+ $user_fullname $user_homeaddr $user_email $user_phone
+ $user_birthday $user_ptype $user_inet $user_homelib);
# This is a template test case for the Patron Information
# message handling. Because of the large number of fields,
msg => "6300020060329 201700 AO$instid|AA$user_barcode|",
pat => qr/^64[ Y]{14}\d{3}$datepat(\d{4}){6}/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID) },
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/o,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$user_fullname$/o,
- required => 1, just_warn => 1, },
- $SIPtest::field_specs{(FID_HOLD_ITEMS_LMT) },
- $SIPtest::field_specs{(FID_OVERDUE_ITEMS_LMT)},
- $SIPtest::field_specs{(FID_CHARGED_ITEMS_LMT)},
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- $SIPtest::field_specs{(FID_CURRENCY)},
- { field => FID_FEE_AMT,
- pat => $textpat,
- required => 0, },
- { field => FID_FEE_LMT,
- pat => $textpat,
- required => 0, },
- { field => FID_HOME_ADDR,
- pat => qr/^$user_homeaddr$/o,
- required => 0, }, # optional in the spec
- { field => FID_EMAIL,
- pat => qr/^$user_email$/o,
- required => 1, },
- { field => FID_HOME_PHONE,
- pat => qr/^$user_phone$/o,
- required => 0, },
- { field => FID_PATRON_BIRTHDATE,
- pat => qr/^$user_birthday$/o,
- required => 1, },
- { field => FID_PATRON_CLASS,
- pat => qr/^$user_ptype$/o,
- required => 1, },
- { field => FID_INET_PROFILE,
- pat => qr/^$user_inet$/,
- required => 0, }, # this is a custom extension, not required by spec
- { field => FID_HOME_LIBRARY,
- pat => qr/^$user_homelib$/,
- required => 0, }, # this is a custom extension, not required by spec
- ], };
+ $SIPtest::field_specs{(FID_INST_ID) },
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/o,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$user_fullname$/o,
+ required => 1, just_warn => 1, },
+ $SIPtest::field_specs{(FID_HOLD_ITEMS_LMT) },
+ $SIPtest::field_specs{(FID_OVERDUE_ITEMS_LMT)},
+ $SIPtest::field_specs{(FID_CHARGED_ITEMS_LMT)},
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ $SIPtest::field_specs{(FID_CURRENCY)},
+ { field => FID_FEE_AMT,
+ pat => $textpat,
+ required => 0, },
+ { field => FID_FEE_LMT,
+ pat => $textpat,
+ required => 0, },
+ { field => FID_HOME_ADDR,
+ pat => qr/^$user_homeaddr$/o,
+ required => 0, }, # optional in the spec
+ { field => FID_EMAIL,
+ pat => qr/^$user_email$/o,
+ required => 1, },
+ { field => FID_HOME_PHONE,
+ pat => qr/^$user_phone$/o,
+ required => 0, },
+ { field => FID_PATRON_BIRTHDATE,
+ pat => qr/^$user_birthday$/o,
+ required => 1, },
+ { field => FID_PATRON_CLASS,
+ pat => qr/^$user_ptype$/o,
+ required => 1, },
+ { field => FID_INET_PROFILE,
+ pat => qr/^$user_inet$/,
+ required => 0, }, # this is a custom extension, not required by spec
+ { field => FID_HOME_LIBRARY,
+ pat => qr/^$user_homelib$/,
+ required => 0, }, # this is a custom extension, not required by spec
+ ], };
my @tests = (
$SIPtest::login_test,
sub create_patron_summary_tests {
my $test;
my @patron_info_summary_tests = (
- { field => FID_HOLD_ITEMS,
- pat => $textpat,
- required => 0, },
- { field => FID_OVERDUE_ITEMS,
- pat => $textpat,
- required => 0, },
- { field => FID_CHARGED_ITEMS,
- pat => $textpat,
- required => 0, },
+ { field => FID_HOLD_ITEMS,
+ pat => $textpat,
+ required => 0, },
+ { field => FID_OVERDUE_ITEMS,
+ pat => $textpat,
+ required => 0, },
+ { field => FID_CHARGED_ITEMS,
+ pat => $textpat,
+ required => 0, },
# The test user has no items of these types, so the tests seem to fail
-# { field => FID_FINE_ITEMS,
-# pat => $textpat,
-# required => 1, },
-# { field => FID_RECALL_ITEMS,
-# pat => $textpat,
-# required => 0, },
-# { field => FID_UNAVAILABLE_HOLD_ITEMS,
-# pat => $textpat,
-# required => 0, },
- );
+# { field => FID_FINE_ITEMS,
+# pat => $textpat,
+# required => 1, },
+# { field => FID_RECALL_ITEMS,
+# pat => $textpat,
+# required => 0, },
+# { field => FID_UNAVAILABLE_HOLD_ITEMS,
+# pat => $textpat,
+# required => 0, },
+ );
foreach my $i (0 .. scalar @patron_info_summary_tests-1) {
# The tests for each of the summary fields are exactly the
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $currency $user_barcode
- $item_barcode $item_title
- $item_diacritic_barcode $item_diacritic_title
- $item_diacritic_owner);
+ $item_barcode $item_title
+ $item_diacritic_barcode $item_diacritic_title
+ $item_diacritic_owner);
my $patron_enable_template = {
id => 'Renew All: prep: enable patron permissions',
msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
pat => qr/^121NNY$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/o,
- required => 1, },
- { field => FID_ITEM_ID,
- pat => qr/^$item_barcode$/o,
- required => 1, },
- { field => FID_TITLE_ID,
- pat => qr/^$item_title\s*$/o,
- required => 1, },
- { field => FID_DUE_DATE,
- pat => $textpat,
- required => 1, },
- { field => FID_FEE_TYPE,
- pat => qr/^\d{2}$/,
- required => 0, },
- { field => FID_SECURITY_INHIBIT,
- pat => qr/^[YN]$/,
- required => 0, },
- { field => FID_CURRENCY,
- pat => qr/^$currency$/o,
- required => 0, },
- { field => FID_FEE_AMT,
- pat => qr/^[.0-9]+$/,
- required => 0, },
- { field => FID_MEDIA_TYPE,
- pat => qr/^\d{3}$/,
- required => 0, },
- { field => FID_ITEM_PROPS,
- pat => $textpat,
- required => 0, },
- { field => FID_TRANSACTION_ID,
- pat => $textpat,
- required => 0, },
- ], };
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/o,
+ required => 1, },
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/o,
+ required => 1, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title\s*$/o,
+ required => 1, },
+ { field => FID_DUE_DATE,
+ pat => $textpat,
+ required => 1, },
+ { field => FID_FEE_TYPE,
+ pat => qr/^\d{2}$/,
+ required => 0, },
+ { field => FID_SECURITY_INHIBIT,
+ pat => qr/^[YN]$/,
+ required => 0, },
+ { field => FID_CURRENCY,
+ pat => qr/^$currency$/o,
+ required => 0, },
+ { field => FID_FEE_AMT,
+ pat => qr/^[.0-9]+$/,
+ required => 0, },
+ { field => FID_MEDIA_TYPE,
+ pat => qr/^\d{3}$/,
+ required => 0, },
+ { field => FID_ITEM_PROPS,
+ pat => $textpat,
+ required => 0, },
+ { field => FID_TRANSACTION_ID,
+ pat => $textpat,
+ required => 0, },
+ ], };
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- clone($checkout_test_template),
- # Don't check the item in, because we're about to test renew
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ clone($checkout_test_template),
+ # Don't check the item in, because we're about to test renew
+ );
my $test;
my $field = $test->{fields}[$i];
if ($field->{field} eq FID_ITEM_ID) {
- $field->{pat} = qr/^$item_diacritic_barcode$/;
+ $field->{pat} = qr/^$item_diacritic_barcode$/;
} elsif ($field->{field} eq FID_TITLE_ID) {
- $field->{pat} = qr/^$item_diacritic_title\s*$/;
+ $field->{pat} = qr/^$item_diacritic_title\s*$/;
} elsif ($field->{field} eq FID_OWNER) {
- $field->{pat} = qr/^$item_diacritic_owner$/;
+ $field->{pat} = qr/^$item_diacritic_owner$/;
}
}
#$test->{pat} = qr/^120NUN$datepat/;
#delete $test->{fields};
#$test->{fields} = [
-# $SIPtest::field_specs{(FID_INST_ID)},
-# $SIPtest::field_specs{(FID_SCREEN_MSG)},
-# $SIPtest::field_specs{(FID_PRINT_LINE)},
-# { field => FID_PATRON_ID,
-# pat => qr/^$user_barcode$/,
-# required => 1, },
-# { field => FID_VALID_PATRON,
-# pat => qr/^Y$/,
-# required => 1, },
-# ];
+# $SIPtest::field_specs{(FID_INST_ID)},
+# $SIPtest::field_specs{(FID_SCREEN_MSG)},
+# $SIPtest::field_specs{(FID_PRINT_LINE)},
+# { field => FID_PATRON_ID,
+# pat => qr/^$user_barcode$/,
+# required => 1, },
+# { field => FID_VALID_PATRON,
+# pat => qr/^Y$/,
+# required => 1, },
+# ];
#
#push @tests, $patron_disable_template, $test, $patron_enable_template;
#
use Sip::Constants qw(:all);
use SIPtest qw($datepat $instid $currency $user_barcode $user_pin
- $user_fullname $user_homeaddr $user_email $user_phone
+ $user_fullname $user_homeaddr $user_email $user_phone
$textpat $password
- $user_birthday);
+ $user_birthday);
my $patron_status_test_template = {
id => 'Patron Status: valid patron, no patron password',
msg => "2300120060101 084237AO$instid|AA$user_barcode|AC$password|",
pat => qr/^24 [ Y]{13}00[01]$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
pat => qr/^$user_fullname$/o,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- $SIPtest::field_specs{(FID_CURRENCY)},
- { field => FID_FEE_AMT,
- pat => $textpat,
- required => 0, },
- ], };
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ $SIPtest::field_specs{(FID_CURRENCY)},
+ { field => FID_FEE_AMT,
+ pat => $textpat,
+ required => 0, },
+ ], };
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- clone($patron_status_test_template),
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ clone($patron_status_test_template),
+ );
# Invalid patron
my $test = clone($patron_status_test_template);
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^bad_userid$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^N$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^bad_userid$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^N$/,
+ required => 1, },
+ ];
push @tests, $test;
$test->{pat} = qr/^24[ Y]{14}00[01]$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
pat => qr/^$/o, # FIXME: expose patron info with invalid password or not?
- required => 1,
+ required => 1,
just_warn => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^N$/, # FIXME: still exposing patron info if we provide Y here with an invalid password
- required => 0, }, # optional per spec
- { field => FID_VALID_PATRON_PWD,
- pat => qr/^N$/,
- required => 0, }, # optional per spec
- ];
+ { field => FID_VALID_PATRON,
+ pat => qr/^N$/, # FIXME: still exposing patron info if we provide Y here with an invalid password
+ required => 0, }, # optional per spec
+ { field => FID_VALID_PATRON_PWD,
+ pat => qr/^N$/,
+ required => 0, }, # optional per spec
+ ];
push @tests, $test;
# TODO: Need multiple patrons to test each individual
# response to block patron is a patron status message
pat => qr/^24Y[ Y]{13}000$datepat/o,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$block_user_barcode$/o,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$block_user_fullname$/o,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- $SIPtest::field_specs{(FID_CURRENCY)},
- { field => FID_FEE_AMT,
- pat => $textpat,
- required => 0, },
- ], };
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$block_user_barcode$/o,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$block_user_fullname$/o,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ $SIPtest::field_specs{(FID_CURRENCY)},
+ { field => FID_FEE_AMT,
+ pat => $textpat,
+ required => 0, },
+ ], };
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- clone($block_patron_test_template),
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ clone($block_patron_test_template),
+ );
SIPtest::run_sip_tests(@tests);
msg => "2520060102 084238AO$instid|AA$block_user_barcode|",
pat => qr/^26 [ Y]{12}000$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$block_user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$block_user_fullname$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- ], };
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$block_user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$block_user_fullname$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ ], };
# We need to disable the valid patron before we can
# ensure that he was properly enabled.
# response to block patron is a patron status message
pat => qr/^24Y{4}[ Y]{10}000$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- { field => FID_PATRON_ID,
- pat => qr/^$block_user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$block_user_fullname$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- ], };
+ $SIPtest::field_specs{(FID_INST_ID)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$block_user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$block_user_fullname$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ ], };
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- $patron_disable_test_template,
- clone($patron_enable_test_template),
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ $patron_disable_test_template,
+ clone($patron_enable_test_template),
+ );
my $test;
$test->{pat} = qr/^26 {4}[ Y]{10}000$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$block_user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$block_user_fullname$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- { field => FID_VALID_PATRON_PWD,
- pat => qr/^Y$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$block_user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$block_user_fullname$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ { field => FID_VALID_PATRON_PWD,
+ pat => qr/^Y$/,
+ required => 1, },
+ ];
push @tests, $patron_disable_test_template, $test;
$test->{pat} = qr/^26[ Y]{14}000$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$block_user_barcode$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$block_user_fullname$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^Y$/,
- # Not required by the spec, but by the test
- required => 1, },
- { field => FID_VALID_PATRON_PWD,
- pat => qr/^N$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$block_user_barcode$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$block_user_fullname$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^Y$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ { field => FID_VALID_PATRON_PWD,
+ pat => qr/^N$/,
+ required => 1, },
+ ];
push @tests, $patron_disable_test_template, $test;
# After this test, the patron is left disabled, so re-enable
$test->{pat} = qr/^26Y{4}[ Y]{10}000$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^bad_userid$/,
- required => 1, },
- { field => FID_PERSONAL_NAME,
- pat => qr/^$/,
- required => 1, },
- { field => FID_VALID_PATRON,
- pat => qr/^N$/,
- # Not required by the spec, but by the test
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^bad_userid$/,
+ required => 1, },
+ { field => FID_PERSONAL_NAME,
+ pat => qr/^$/,
+ required => 1, },
+ { field => FID_VALID_PATRON,
+ pat => qr/^N$/,
+ # Not required by the spec, but by the test
+ required => 1, },
+ ];
push @tests, $test;
msg => "15+20060415 110158BW21060815 110158|BSBR1|BY2|AO$instid|AA$user_barcode|AB$item_barcode|",
pat => qr/^161N$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- { field => FID_EXPIRATION,
- pat => $datepat,
- required => 0, },
- { field => FID_QUEUE_POS,
- pat => qr/^1$/,
- required => 0, },
- { field => FID_PICKUP_LOCN,
- pat => qr/^BR1$/,
- required => 0, },
- { field => FID_TITLE_ID,
- pat => qr/^$item_title$/,
- required => 0, },
- { field => FID_ITEM_ID,
- pat => qr/^$item_barcode$/,
- required => 0, },
- ],};
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ { field => FID_EXPIRATION,
+ pat => $datepat,
+ required => 0, },
+ { field => FID_QUEUE_POS,
+ pat => qr/^1$/,
+ required => 0, },
+ { field => FID_PICKUP_LOCN,
+ pat => qr/^BR1$/,
+ required => 0, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title$/,
+ required => 0, },
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/,
+ required => 0, },
+ ],};
my $hold_count_test_template0 = {
id => 'Confirm patron has 0 holds',
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- $hold_test_template, $hold_count_test_template1,
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ $hold_test_template, $hold_count_test_template1,
+ );
my $test;
my $field = $test->{fields}[$i];
if ($field->{field} eq FID_PATRON_ID) {
- $field->{pat} = qr/^$second_user_barcode$/;
+ $field->{pat} = qr/^$second_user_barcode$/;
} elsif ($field->{field} eq FID_QUEUE_POS) {
- $field->{pat} = qr/^2$/;
+ $field->{pat} = qr/^2$/;
}
}
$test->{pat} = qr/^161[NY]$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$second_user_barcode$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$second_user_barcode$/,
+ required => 1, },
+ ];
push @tests, $test;
$test->{pat} = qr/^161[NY]$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$second_user_barcode$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$second_user_barcode$/,
+ required => 1, },
+ ];
push @tests, $test;
$test->{pat} = qr/^160N$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ ];
push @tests, $test, $hold_count_test_template0;
$test->{pat} = qr/^160N$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^no_such_user$/,
- required => 1, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^no_such_user$/,
+ required => 1, },
+ ];
# There's no patron to check the number of holds against
push @tests, $test;
$test->{pat} = qr/^160N$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- { field => FID_ITEM_ID,
- pat => qr/^nosuchitem$/,
- required => 0, },
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ { field => FID_ITEM_ID,
+ pat => qr/^nosuchitem$/,
+ required => 0, },
+ ];
push @tests, $test, $hold_count_test_template0;
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $user_barcode
- $item_barcode $item_title);
+ $item_barcode $item_title);
my $checkin_test_template = {
id => 'Checkin: Item is checked out',
msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
pat => qr/^101YNN$datepat/o,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/o,
- required => 1, },
- { field => FID_ITEM_ID,
- pat => qr/^$item_barcode$/o,
- required => 1, },
- { field => FID_PERM_LOCN,
- pat => $textpat,
- required => 1, },
- { field => FID_TITLE_ID,
- pat => qr/^$item_title\s*$/o,
- required => 1, }, # not required by the spec.
- ],};
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/o,
+ required => 1, },
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/o,
+ required => 1, },
+ { field => FID_PERM_LOCN,
+ pat => $textpat,
+ required => 1, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title\s*$/o,
+ required => 1, }, # not required by the spec.
+ ],};
my $checkout_template = {
id => 'Checkin: prep: check out item',
};
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- $checkout_template,
- $checkin_test_template,
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ $checkout_template,
+ $checkin_test_template,
+ );
my $test;
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $currency $user_barcode
- $item_barcode $item_title);
+ $item_barcode $item_title);
my $checkout_template = {
- id => 'Renew: prep: check out item',
- msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
- pat => qr/^121NNY$datepat/,
- fields => [],
- };
+ id => 'Renew: prep: check out item',
+ msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
+ pat => qr/^121NNY$datepat/,
+ fields => [],
+ };
my $checkin_template = {
- id => 'Renew: prep: check in item',
- msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
- pat => qr/^101YNN$datepat/,
- fields => [],
- };
+ id => 'Renew: prep: check in item',
+ msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
+ pat => qr/^101YNN$datepat/,
+ fields => [],
+ };
#my $hold_template = {
-# id => 'Renew: prep: place hold on item',
-# msg =>"15+20060415 110158BW20060815 110158|BSTaylor|BY2|AO$instid|AA$second_user_barcode|AB$item_barcode|",
-# pat => qr/^161N$datepat/,
-# fields => [],
-# };
+# id => 'Renew: prep: place hold on item',
+# msg =>"15+20060415 110158BW20060815 110158|BSTaylor|BY2|AO$instid|AA$second_user_barcode|AB$item_barcode|",
+# pat => qr/^161N$datepat/,
+# fields => [],
+# };
#
#my $cancel_hold_template = {
-# id => 'Renew: cleanup: cancel hold on item',
-# msg =>"15-20060415 110158BW20060815 110158|BSTaylor|BY2|AO$instid|AA$second_user_barcode|AB$item_barcode|",
-# pat => qr/^161[NY]$datepat/,
-# fields => [],
-# };
+# id => 'Renew: cleanup: cancel hold on item',
+# msg =>"15-20060415 110158BW20060815 110158|BSTaylor|BY2|AO$instid|AA$second_user_barcode|AB$item_barcode|",
+# pat => qr/^161[NY]$datepat/,
+# fields => [],
+# };
#
my $renew_test_template = {
- id => 'Renew: item id checked out to patron, renewal permitted, no 3rd party, no fees',
- msg => "29NN20060102 084236 AO$instid|AA$user_barcode|AB$item_barcode|",
- pat => qr/^301YNN$datepat/,
- fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_PATRON_ID,
- pat => qr/^$user_barcode$/,
- required => 1, },
- { field => FID_ITEM_ID,
- pat => qr/^$item_barcode$/,
- required => 1, },
- { field => FID_TITLE_ID,
- pat => qr/^$item_title\s*$/,
- required => 1, },
- { field => FID_DUE_DATE,
- pat => qr/^.+$/, # spec says ACS can return dates in any format it wants
- required => 1, },
- { field => FID_SECURITY_INHIBIT,
- pat => qr/^[YN]$/,
- required => 0, },
- ],};
+ id => 'Renew: item id checked out to patron, renewal permitted, no 3rd party, no fees',
+ msg => "29NN20060102 084236 AO$instid|AA$user_barcode|AB$item_barcode|",
+ pat => qr/^301YNN$datepat/,
+ fields => [
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_PATRON_ID,
+ pat => qr/^$user_barcode$/,
+ required => 1, },
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/,
+ required => 1, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title\s*$/,
+ required => 1, },
+ { field => FID_DUE_DATE,
+ pat => qr/^.+$/, # spec says ACS can return dates in any format it wants
+ required => 1, },
+ { field => FID_SECURITY_INHIBIT,
+ pat => qr/^[YN]$/,
+ required => 0, },
+ ],};
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- $checkout_template,
- $renew_test_template,
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ $checkout_template,
+ $renew_test_template,
+ );
my $test;
#$test->{pat} = qr/^300N[NU]N$datepat/;
#foreach my $field (@{$test->{fields}}) {
# if ($field->{field} eq FID_DUE_DATE || $field->{field} eq FID_TITLE_ID) {
-# $field->{pat} = qr/^$/;
+# $field->{pat} = qr/^$/;
# }
#}
#
$test->{pat} = qr/^300N[NU]N$datepat/;
foreach my $field (@{$test->{fields}}) {
if ($field->{field} eq FID_DUE_DATE) {
- $field->{pat} = qr/^$/;
+ $field->{pat} = qr/^$/;
} elsif ($field->{field} eq FID_TITLE_ID) {
- $field->{pat} = qr/^($item_title\s*|)$/;
+ $field->{pat} = qr/^($item_title\s*|)$/;
}
}
$test->{pat} = qr/^300N[NU]N$datepat/;
foreach my $field (@{$test->{fields}}) {
if ($field->{field} eq FID_TITLE_ID || $field->{field} eq FID_DUE_DATE) {
- $field->{pat} = qr/^$/;
+ $field->{pat} = qr/^$/;
} elsif ($field->{field} eq FID_ITEM_ID) {
- $field->{pat} = qr/^bad-item$/;
+ $field->{pat} = qr/^bad-item$/;
}
}
$test->{pat} = qr/^300N[NU]N$datepat/;
foreach my $field (@{$test->{fields}}) {
if ($field->{field} eq FID_DUE_DATE) {
- $field->{pat} = qr/^$/;
+ $field->{pat} = qr/^$/;
} elsif ($field->{field} eq FID_PATRON_ID) {
- $field->{pat} = qr/^bad_barcode$/;
+ $field->{pat} = qr/^bad_barcode$/;
} elsif ($field->{field} eq FID_TITLE_ID) {
- $field->{pat} = qr/^($item_title\s*|)$/;
+ $field->{pat} = qr/^($item_title\s*|)$/;
}
}
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $user_barcode $item_barcode $item_owner
- $item2_barcode $item2_owner $instid);
+ $item2_barcode $item2_owner $instid);
my $enable_template = {
id => 'Renew All: prep: enable patron permissions',
};
my @checkout_templates = (
- { id => "Renew All: prep: check out $item_barcode",
- msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
- pat => qr/^121NNY$datepat/,
- fields => [],},
- { id => "Renew All: prep: check out $item2_barcode",
- msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item2_barcode|AC|",
- pat => qr/^121NNY$datepat/,
- fields => [],}
- );
+ { id => "Renew All: prep: check out $item_barcode",
+ msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|",
+ pat => qr/^121NNY$datepat/,
+ fields => [],},
+ { id => "Renew All: prep: check out $item2_barcode",
+ msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item2_barcode|AC|",
+ pat => qr/^121NNY$datepat/,
+ fields => [],}
+ );
my @checkin_templates = (
- { id => "Renew All: prep: check in $item_barcode",
- msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
- pat => qr/^101YNN$datepat/,
- fields => [],},
- { id => "Renew All: prep: check in $item2_barcode",
- msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item2_barcode|ACterminal password|",
- pat => qr/^101YNN$datepat/,
- fields => [],}
- );
+ { id => "Renew All: prep: check in $item_barcode",
+ msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|ACterminal password|",
+ pat => qr/^101YNN$datepat/,
+ fields => [],},
+ { id => "Renew All: prep: check in $item2_barcode",
+ msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item2_barcode|ACterminal password|",
+ pat => qr/^101YNN$datepat/,
+ fields => [],}
+ );
my $renew_all_test_template = {
id => 'Renew All: valid patron with one item checked out, no patron password',
msg => "6520060102 084236AO$instid|AA$user_barcode|",
pat => qr/^66100010000$datepat/,
fields => [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_RENEWED_ITEMS,
- pat => qr/^$item_barcode$/,
- required => 1, },
- ],};
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_RENEWED_ITEMS,
+ pat => qr/^$item_barcode$/,
+ required => 1, },
+ ],};
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
-# $enable_template,
- $checkout_templates[0],
- $renew_all_test_template,
- $checkin_templates[0], # check the book in, when done testing
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+# $enable_template,
+ $checkout_templates[0],
+ $renew_all_test_template,
+ $checkin_templates[0], # check the book in, when done testing
+ );
my $test;
# my $field = $test->{fields}[$i];
#
# if ($field->{field} eq FID_RENEWED_ITEMS) {
-# $field->{pat} = qr/^$item_barcode\|$item2_barcode$/;
+# $field->{pat} = qr/^$item_barcode\|$item2_barcode$/;
# }
#}
#
$test->{just_warn} = 1;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ ];
push @tests, $checkout_templates[0], $test, $checkin_templates[0];
$test->{pat} = qr/^66000000000$datepat/;
delete $test->{fields};
$test->{fields} = [
- $SIPtest::field_specs{(FID_INST_ID)},
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- ];
+ $SIPtest::field_specs{(FID_INST_ID)},
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ ];
push @tests, $test;
SIPtest::run_sip_tests(@tests);
use Sip::Constants qw(:all);
use SIPtest qw($datepat $textpat $instid $currency $user_barcode
- $item_barcode $item_title $item_owner);
+ $item_barcode $item_title $item_owner);
my $item_info_test_template = {
id => 'Item Information: check information for available item',
msg => "1720060110 215612AO$instid|AB$item_barcode|",
pat => qr/^180[139]0201$datepat/, # status of 'other' or 'available'
fields => [
- $SIPtest::field_specs{(FID_SCREEN_MSG)},
- $SIPtest::field_specs{(FID_PRINT_LINE)},
- { field => FID_ITEM_ID,
- pat => qr/^$item_barcode$/,
- required => 1, },
- { field => FID_TITLE_ID,
- pat => qr/^$item_title\s*$/,
- required => 1, },
- { field => FID_MEDIA_TYPE,
- pat => qr/^\d{3}$/,
- required => 0, },
- { field => FID_OWNER,
- pat => qr/^$item_owner$/,
- required => 0, },
- ], };
+ $SIPtest::field_specs{(FID_SCREEN_MSG)},
+ $SIPtest::field_specs{(FID_PRINT_LINE)},
+ { field => FID_ITEM_ID,
+ pat => qr/^$item_barcode$/,
+ required => 1, },
+ { field => FID_TITLE_ID,
+ pat => qr/^$item_title\s*$/,
+ required => 1, },
+ { field => FID_MEDIA_TYPE,
+ pat => qr/^\d{3}$/,
+ required => 0, },
+ { field => FID_OWNER,
+ pat => qr/^$item_owner$/,
+ required => 0, },
+ ], };
my @tests = (
- $SIPtest::login_test,
- $SIPtest::sc_status_test,
- clone($item_info_test_template),
- );
+ $SIPtest::login_test,
+ $SIPtest::sc_status_test,
+ clone($item_info_test_template),
+ );
SIPtest::run_sip_tests(@tests);
use SIPtest qw($instid $user_barcode $user_pin);
my $end_session = { id => 'End Session',
- msg => "3520060101 084237AO$instid|AA$user_barcode|AC|AD$user_pin|",
- pat => qr/^36Y/,
- fields => [], };
+ msg => "3520060101 084237AO$instid|AA$user_barcode|AC|AD$user_pin|",
+ pat => qr/^36Y/,
+ fields => [], };
my @tests = ( $SIPtest::login_test, $SIPtest::sc_status_test, $end_session );
# fee type = unknown, payment type = cash
my $fee_paid_against_fees = { id => 'Fee Paid against user with fees',
- msg => "3720060101 0842370100USDBV10.00|A0$instid|AA$user_with_fees_barcode|",
- pat => qr/^38Y/,
- fields => [], };
+ msg => "3720060101 0842370100USDBV10.00|A0$instid|AA$user_with_fees_barcode|",
+ pat => qr/^38Y/,
+ fields => [], };
my $fee_paid_but_no_fees = { id => 'Fee Paid against user without fees',
- msg => "3720060101 0842370100USDBV10.00|A0$instid|AA$user_barcode|",
- pat => qr/^38N/,
- fields => [], };
+ msg => "3720060101 0842370100USDBV10.00|A0$instid|AA$user_barcode|",
+ pat => qr/^38N/,
+ fields => [], };
my @tests = ( $SIPtest::login_test, $SIPtest::sc_status_test, $fee_paid_against_fees, $fee_paid_but_no_fees );
our $VERSION = 0.02;
our @EXPORT_OK = qw(run_sip_tests no_tagged_fields
- $datepat $textpat
- $login_test $sc_status_test
- %field_specs
-
- $instid $currency $server $username $password
- $user_barcode $user_pin $user_fullname $user_homeaddr
- $user_email $user_phone $user_birthday $user_ptype
- $user_inet $user_homelib
- $block_user_barcode $block_user_pin $block_user_fullname $block_user_homeaddr
- $block_user_email $block_user_phone $block_user_birthday $block_user_ptype
- $block_user_inet $block_user_homelib
- $second_user_barcode $second_user_pin $second_user_fullname $second_user_homeaddr
- $second_user_email $second_user_phone $second_user_birthday $second_user_ptype
- $second_user_inet $second_user_homelib
+ $datepat $textpat
+ $login_test $sc_status_test
+ %field_specs
+
+ $instid $currency $server $username $password
+ $user_barcode $user_pin $user_fullname $user_homeaddr
+ $user_email $user_phone $user_birthday $user_ptype
+ $user_inet $user_homelib
+ $block_user_barcode $block_user_pin $block_user_fullname $block_user_homeaddr
+ $block_user_email $block_user_phone $block_user_birthday $block_user_ptype
+ $block_user_inet $block_user_homelib
+ $second_user_barcode $second_user_pin $second_user_fullname $second_user_homeaddr
+ $second_user_email $second_user_phone $second_user_birthday $second_user_ptype
+ $second_user_inet $second_user_homelib
$cancel_hold_user_barcode $user_with_fees_barcode
- $item_barcode $item_title $item_owner
- $item2_barcode $item2_title $item2_owner
+ $item_barcode $item_title $item_owner
+ $item2_barcode $item2_title $item2_owner
$item_on_hold_barcode
- $item_diacritic_barcode $item_diacritic_title
- $item_diacritic_owner);
+ $item_diacritic_barcode $item_diacritic_title
+ $item_diacritic_owner);
# The number of tests is set in run_sip_tests() below, based
# on the size of the array of tests.
# cases here and reference them in the individual test files.
our $login_test = { id => 'login',
- msg => "9300CN$username|CO$password|CP$instid|",
- pat => qr/^941/,
- fields => [], };
+ msg => "9300CN$username|CO$password|CP$instid|",
+ pat => qr/^941/,
+ fields => [], };
our $sc_status_test = { id => 'SC status',
- msg => '9910302.00',
- pat => qr/^98[YN]{6}\d{3}\d{3}$datepat(2\.00|1\.00)/,
- fields => [
- $field_specs{(FID_SCREEN_MSG)},
- $field_specs{(FID_PRINT_LINE)},
- $field_specs{(FID_INST_ID)},
- { field => 'AM',
- pat => $textpat,
- required => 0, },
- { field => 'BX',
- pat => qr/^[YN]{16}$/,
- required => 1, },
- { field => 'AN',
- pat => $textpat,
- required => 0, },
- ],
- };
+ msg => '9910302.00',
+ pat => qr/^98[YN]{6}\d{3}\d{3}$datepat(2\.00|1\.00)/,
+ fields => [
+ $field_specs{(FID_SCREEN_MSG)},
+ $field_specs{(FID_PRINT_LINE)},
+ $field_specs{(FID_INST_ID)},
+ { field => 'AM',
+ pat => $textpat,
+ required => 0, },
+ { field => 'BX',
+ pat => qr/^[YN]{16}$/,
+ required => 1, },
+ { field => 'AN',
+ pat => $textpat,
+ required => 0, },
+ ],
+ };
our $debug = 1;
our $error_detect = 0;
foreach my $test (@_) {
# print STDERR "Test $seqno:" . Dumper($test);
one_msg($sock, $test, $seqno++);
- $seqno %= 10; # sequence number is one digit
+ $seqno %= 10; # sequence number is one digit
}
}