]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/support-scripts/test-scripts/cstore_simple.pl
Fix empty statuses filter
[working/Evergreen.git] / Open-ILS / src / support-scripts / test-scripts / cstore_simple.pl
1 #!/usr/bin/perl
2 #----------------------------------------------------------------
3 # Simple cstore example
4 #----------------------------------------------------------------
5
6 require '../oils_header.pl';
7 use strict; use warnings;
8 use OpenSRF::AppSession;
9 use OpenILS::Utils::Fieldmapper;
10
11 my $config = shift; # path to opensrf_core.xml
12 osrf_connect($config); # connect to jabber
13
14 my $ses = OpenSRF::AppSession->create("open-ils.cstore");
15 $ses->connect;
16
17 my $req = $ses->request('open-ils.cstore.transaction.begin');
18 my $stat = $req->gather(1);
19 die "cannot start transaction\n" unless $stat;
20
21 my $btype = Fieldmapper::config::billing_type->new;
22 $btype->name('Test 1');
23 $btype->owner(1);
24
25 $req = $ses->request('open-ils.cstore.direct.config.billing_type.create', $btype);
26 $stat = $req->gather(1);
27 die "cannot create object\n" unless $stat;
28 print "create returned $stat\n";
29
30 $req = $ses->request('open-ils.cstore.transaction.rollback');
31 $stat = $req->gather(1);
32 die "cannot rollback transaction\n" unless $stat;
33
34 $ses->disconnect;
35
36