5 use Test::More tests => 11;
8 use File::Temp qw/tempdir/;
13 use_ok( 'WebPAC::Output::Estraier' );
14 use_ok( 'WebPAC::Search::Estraier' );
15 use_ok( 'Log::Log4perl' );
18 Log::Log4perl::init('./conf/log.conf');
19 ok(my $log = Log::Log4perl->get_logger('WebPAC.test'), "get_logger");
22 masterurl => 'http://localhost:1978/',
25 database => 'webpac2test',
26 encoding => 'iso-8859-2',
31 ok(my $est = new WebPAC::Output::Estraier( %{ $config } ), "new WebPAC::Output::Estraier");
33 ok(my $list = $est->master( action => 'nodelist' ), "nodelist");
35 like($list , qr/$config->{database}/, "found $config->{database}");
41 'display' => [ 'foo' ],
42 'search' => [ 'demo source '],
47 'search' => [ 'bar' ],
48 'lookup_key' => [ 'bar' ],
50 'filename' => [ 'out/thes/001.html' ],
55 ok($est->add( id => 42, ds => $ds, type => 'search' ), "add");
57 ok($est = new WebPAC::Search::Estraier( %{ $config } ), "new WebPAC::Search::Estraier");
62 ok(my @res = $est->search(
64 get_attr => [ qw/ID Source/ ],
66 ), "search $query, max: $max");
68 cmp_ok(($#res + 1), '==', $max, "$max hits");