Bug 13159 - Enhancements to the SIP2 command line emulator
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 29 Oct 2014 11:49:38 +0000 (07:49 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Apr 2015 15:04:46 +0000 (12:04 -0300)
commit0e7fd0252fd6d2a4091e33d3c26160512eeac500
tree8ad08bd1f653cf21cfe472b815a547ed061f22e7
parent927aedafa155fb53011c09a510166b4233bac499
Bug 13159 - Enhancements to the SIP2 command line emulator

I needed to be able to perform checkout operations for testing from the
command line. I ended up reengineering the SIP2 command line tester
quite a bit.

Enhancements:
* Moved message generation code to subroutines
* Added support for more messages
* Added command line switches for each supported message
* Enabled use of Sip::Constants to keep code DRY and more understandable
* Moved script from misc to C4/SIP
* Designed with an eye towards possibly moving some code to CPAN in the future
* Also designed to make adding new messages much easier in the future

Test Plan:
1) Apply this patch
2) Look at help via ./C4/SIP/sip_cli_emulator.pl --help
3) Test patron status request and patron information, should work as before
   except you need to pass the command line switche -m <message_name>
4) Test the new checkout option using -m checkout -i <item barcode>

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>
Worked as advertised, with one warning at renew only:

Trying 'renew'
Use of uninitialized value $value in concatenation (.) or string at ./sip_cli_emulator.pl line 462, <GEN0> chunk 1.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/SIP/sip_cli_emulator.pl [new file with mode: 0755]
misc/sip_cli_emulator.pl [deleted file]