/[webpac2]/trunk/t/7-est.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/t/7-est.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 80 - (hide annotations)
Mon Nov 21 14:42:16 2005 UTC (18 years, 5 months ago) by dpavlin
File MIME type: application/x-troff
File size: 748 byte(s)
 r9001@llin:  dpavlin | 2005-11-21 15:29:13 +0100
 added WebPAC::Search::Estraier which should be callable from outside
 WebPAC (e.g. Catalyst)

1 dpavlin 80 #!/usr/bin/perl -w
2    
3     use strict;
4    
5     use Test::More tests => 16;
6     use Test::Exception;
7     use Cwd qw/abs_path/;
8     use File::Temp qw/tempdir/;
9     use Data::Dumper;
10     use blib;
11    
12     BEGIN {
13     use_ok( 'WebPAC::Search::Estraier' );
14     use_ok( 'Log::Log4perl' );
15     }
16    
17     Log::Log4perl::init('./conf/log.conf');
18     ok(my $log = Log::Log4perl->get_logger('WebPAC.test'), "get_logger");
19    
20     ok(my $est = new WebPAC::Search::Estraier(
21     url => 'http://localhost:1978/node/webpac2',
22     user => 'admin',
23     passwd => 'admin',
24     encoding => 'iso-8859-2',
25     log => $log,
26     ), "new");
27    
28     my $query = 'ivan';
29     my $max = 3;
30    
31     ok(my @res = $est->search(
32     query => $query,
33     max => $max,
34     attr => [ qw/PersonalName/ ],
35     ), "search $query, max: $max");
36    
37     cmp_ok($#res, '==', $max, "$max hits");
38    
39     diag Dumper(\@res);
40    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26