3 #----------------------------------------------------------------
4 # Code for testing the container API
5 #----------------------------------------------------------------
7 require '../oils_header.pl';
8 use vars qw/ $user $authtoken /;
9 use strict; use warnings;
14 my $username = shift || 'admin';
15 my $password = shift || 'open-ils';
17 my $create_method = 'open-ils.circ.copy_note.create';
18 my $retrieve_method = 'open-ils.circ.copy_note.retrieve.all';
19 my $delete_method = 'open-ils.circ.copy_note.delete';
23 osrf_connect($config);
24 oils_login($username, $password);
25 oils_fetch_session($authtoken);
32 #----------------------------------------------------------------
38 my $note = Fieldmapper::asset::copy_note->new;
40 $note->owning_copy($copyid);
41 $note->creator($user->id);
42 $note->title("Test Note 1");
43 $note->value("This copy needs to be fixed - $_");
47 'open-ils.circ', $create_method, $authtoken, $note );
49 push(@ids_created, $id);
50 printl("Created copy note $id");
55 my $notes = simplereq(
56 'open-ils.circ', $retrieve_method,
57 {authtoken => $authtoken, itemid => $copyid});
58 oils_event_die($notes);
59 printl("Retrieved: [".$_->id."] ".$_->value) for @$notes;
63 for my $id (@ids_created) {
65 'open-ils.circ', $delete_method, $authtoken, $id);
66 oils_event_die($stat);
67 printl("Deleted note $id");