From 16a184a8dc56262c85565808ce0681ebc7903cef Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 22 Aug 2013 15:41:07 -0400 Subject: [PATCH] TestUtils --- .../perlmods/lib/OpenILS/Utils/Cronscript.pm.in | 25 --------------- .../src/perlmods/lib/OpenILS/Utils/TestUtils.pm | 36 ++++++++++++++++++++++ 2 files changed, 36 insertions(+), 25 deletions(-) create mode 100644 Open-ILS/src/perlmods/lib/OpenILS/Utils/TestUtils.pm diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm.in b/Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm.in index 26607f56c7..32ac711ce5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm.in +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/Cronscript.pm.in @@ -401,31 +401,6 @@ sub cache { return $self->{memcache}; } -sub register_workstation { - my ($self,$name,$lib) = (shift,shift,shift); - my $resp = $apputils->simplereq( - 'open-ils.actor', - 'open-ils.actor.workstation.register', - $self->authtoken, $name, $lib); - return $resp; -} - -sub do_checkout { - my ($self,$args) = (shift,shift); - my $resp = $apputils->simplereq( - 'open-ils.circ', - 'open-ils.circ.checkout.full', $self->authtoken, $args); - return $resp; -} - -sub do_checkin { - my ($self,$args) = (shift,shift); - my $resp = $apputils->simplereq( - 'open-ils.circ', - 'open-ils.circ.checkin', $self->authtoken, $args ); - return $resp; -} - 1; __END__ diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/TestUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/TestUtils.pm new file mode 100644 index 0000000000..c98f39d4c1 --- /dev/null +++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/TestUtils.pm @@ -0,0 +1,36 @@ +package OpenILS::Utils::TestUtils; +use base "OpenILS::Utils::Cronscript"; + +# The purpose of this module is to consolidate common routines that may +# be used by the integration tests in src/perlmods/live_t/ + +use strict; use warnings; + +my $apputils = 'OpenILS::Application::AppUtils'; + +sub register_workstation { + my ($self,$name,$lib) = (shift,shift,shift); + my $resp = $apputils->simplereq( + 'open-ils.actor', + 'open-ils.actor.workstation.register', + $self->authtoken, $name, $lib); + return $resp; +} + +sub do_checkout { + my ($self,$args) = (shift,shift); + my $resp = $apputils->simplereq( + 'open-ils.circ', + 'open-ils.circ.checkout.full', $self->authtoken, $args); + return $resp; +} + +sub do_checkin { + my ($self,$args) = (shift,shift); + my $resp = $apputils->simplereq( + 'open-ils.circ', + 'open-ils.circ.checkin', $self->authtoken, $args ); + return $resp; +} + +1; -- 2.11.0