https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43848

--- Comment #2 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 208471
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208471&action=edit
Bug 43848: Share the SIP2 request builders with the SIP CLI emulator

misc/sip_cli_emulator.pl knows how to build every request a terminal sends,
but as subs inside a script, so code that needs to build a request ( the SIP2
message tester of bug 42769 ) writes its own builders next to them. Move them
into Koha::SIP2::RequestBuilder and have both use it, so there is one place
that knows how a request is laid out.

The emulator builds what it did, apart from two fixes that sharing brought to
light:

- The item information request carried a language field. The server's
  template for that message is the 18 character date and nothing else, so the
  language pushed the date into the first field and the institution was lost.
- build_field turned the value "0" into an empty value.

build_field also refuses a value that contains the field delimiter, which
would otherwise add fields to the request.

The new tests build each request and have the SIP server's own parser read
it, so a request that the server would read differently fails.

To test:
1) prove t/Koha/SIP2/RequestBuilder.t
2) perl misc/sip_cli_emulator.pl against a SIP server still builds and sends
   the messages

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to