tests against stock test data and live Evergreen
[working/Evergreen.git] / Open-ILS / src / perlmods / live_t / 00-simple.t
1 #!perl
2
3 use Test::More tests => 2;
4
5 diag("Simple tests against the open-ils.storage service and the stock test data.");
6
7 use strict; use warnings;
8 use OpenSRF::System;
9 use OpenSRF::AppSession;
10 use OpenILS::Utils::Fieldmapper;
11 use OpenSRF::Utils::SettingsClient;
12
13 my $config = `osrf_config --sysconfdir`;
14 chomp $config;
15 $config .= '/opensrf_core.xml';
16
17 OpenSRF::System->bootstrap_client(config_file => $config);
18 Fieldmapper->import(IDL =>
19     OpenSRF::Utils::SettingsClient->new->config_value("IDL"));
20  
21 my $ses = OpenSRF::AppSession->create('open-ils.storage');
22 my $req = $ses->request('open-ils.storage.direct.actor.user.retrieve', 1);
23 if (my $resp = $req->recv) {
24     if (my $user = $resp->content) {
25         is(
26             ref $user,
27             'Fieldmapper::actor::user',
28             'open-ils.storage.direct.actor.user.retrieve returned aou object'
29         );
30         is(
31             $user->usrname,
32             'admin',
33             'User with id = 1 is admin user'
34         );
35     }
36 }
37