3 #----------------------------------------------------------------
4 # Code for testing the container API
5 #----------------------------------------------------------------
7 require '../oils_header.pl';
8 use vars qw/ $apputils $memcache $user $authtoken $authtime /;
9 use strict; use warnings;
11 #----------------------------------------------------------------
12 err("\nusage: $0 <config> <oils_login_username> ".
13 " <oils_login_password> <name> <org>\n".
14 "Where <name> is the copy location name and <org> is the \n".
15 "org that houses the new location object\n") unless $ARGV[4];
16 #----------------------------------------------------------------
25 osrf_connect($config);
26 oils_login($username, $password);
27 my $cl =create_cl($name, $org);
35 #----------------------------------------------------------------
38 my( $name, $org ) = @_;
40 my $cl = Fieldmapper::asset::copy_location->new;
41 $cl->owning_lib($org);
48 CIRC(), 'open-ils.circ.copy_location.create', $authtoken, $cl );
50 oils_event_die($resp);
51 printl("Copy location $name successfully created");
59 CIRC(), 'open-ils.circ.copy_location.retrieve.all', $authtoken, $org ) );
64 $cl->name( 'test_' . $cl->name );
66 CIRC(), 'open-ils.circ.copy_location.update', $authtoken, $cl );
67 oils_event_die($resp);
68 printl("Successfully set copy location name to ".$cl->name);
74 CIRC(), 'open-ils.circ.copy_location.delete', $authtoken, $cl->id );
75 oils_event_die($resp);
76 printl("Copy location successfully deleted");