From 8645ef631b7b7b59ba766dfe8a0a52288a80b7e0 Mon Sep 17 00:00:00 2001 From: pop Date: Tue, 15 Apr 2003 20:55:14 +0000 Subject: [PATCH] Tuned to DEBIAN Stable pkgs --- perl/Makefile.PL.in | 4 +-- perl/demo/zebra.cfg | 2 +- perl/t/03_record_update.t | 68 ++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in index 5ead531..d023d3a 100644 --- a/perl/Makefile.PL.in +++ b/perl/Makefile.PL.in @@ -6,10 +6,10 @@ WriteMakefile( 'INC' => "-I../index -I../include @YAZINC@", 'LIBS' => "-L../index -lzebra -L../data1 -ldata1 @TCL_LIB@ @YAZLIB@ @ZPERL_LIBS@", 'OPTIMIZE' => '-g', - 'PREREQ_FATAL' => 1, +# 'PREREQ_FATAL' => 1, 'PREREQ_PM' => { 'Scalar::Util' => '1.0', - 'Test::More' => '0.45', + 'Test::More' => '0.40', } ); diff --git a/perl/demo/zebra.cfg b/perl/demo/zebra.cfg index f7b6625..b8deadc 100644 --- a/perl/demo/zebra.cfg +++ b/perl/demo/zebra.cfg @@ -27,4 +27,4 @@ demo2.database: demo2 demo2.storeKeys: 1 demo2.storeData: 1 - +isam:b diff --git a/perl/t/03_record_update.t b/perl/t/03_record_update.t index ab15e07..d390be5 100644 --- a/perl/t/03_record_update.t +++ b/perl/t/03_record_update.t @@ -1,6 +1,6 @@ #!perl # ============================================================================= -# $Id: 03_record_update.t,v 1.3 2003-03-13 04:25:18 pop Exp $ +# $Id: 03_record_update.t,v 1.4 2003-04-15 20:55:14 pop Exp $ # # Perl API header # ============================================================================= @@ -8,19 +8,19 @@ BEGIN { if ($ENV{PERL_CORE}) { chdir 't' if -d 't'; } - push (@INC,'demo','blib/lib','blib/arch'); + unshift (@INC,'demo','blib/lib','blib/arch'); } use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 17; # ---------------------------------------------------------------------------- # Session opening and closing BEGIN { use_ok('IDZebra'); - IDZebra::logFile("test.log"); +# IDZebra::logFile("test.log"); use_ok('IDZebra::Session'); use_ok('pod'); } @@ -37,6 +37,9 @@ isa_ok($sess,"IDZebra::Session"); # per record update my $rec1=`cat lib/IDZebra/Data1.pm`; my $rec2=`cat lib/IDZebra/Filter.pm`; +my $rec3=`cat lib/IDZebra/Session.pm`; + +# IDZebra::logLevel(15); my ($sysno, $stat); @@ -76,6 +79,63 @@ ok(($stat->{updated} == 0), "Updated 0 records"); ok(($sysno < 0),"Inserted record got invalid sysno"); +$sess->begin_trans; +$sysno = $sess->update_record(data => $rec2, + recordType => 'grs.perl.pod', + groupName => "demo1", + ); + +$sysno = $sess->update_record(data => $rec2, + recordType => 'grs.perl.pod', + groupName => "demo1", + ); + +$stat = $sess->end_trans; +ok(($stat->{inserted} == 0), "Inserted 0 records"); +ok(($stat->{updated} == 1), "Updated $stat->{updated} records"); +ok(($sysno > 0),"Inserted got valid sysno"); + +$sess->begin_trans; +$sysno = $sess->delete_record(data => $rec3, + recordType => 'grs.perl.pod', + groupName => "demo1", + ); +$stat = $sess->end_trans; + + +$sess->begin_trans; +$sysno = $sess->update_record(data => $rec2, + recordType => 'grs.perl.pod', + groupName => "demo1", + ); + +foreach my $i (1..100) { + $sysno = $sess->update_record(data => $rec2, + recordType => 'grs.perl.pod', + groupName => "demo1", + force => 1, + ); +} +foreach my $i (1..10) { + $sysno = $sess->update_record(data => $rec3, + recordType => 'grs.perl.pod', + groupName => "demo1", + force => 1, + ); +} +foreach my $i (1..10) { + $sysno = $sess->update_record(data => $rec2, + recordType => 'grs.perl.pod', + groupName => "demo1", + force => 1, + ); +} + + +$stat = $sess->end_trans; +ok(($stat->{inserted} == 1), "Inserted $stat->{inserted} records"); +ok(($stat->{updated} == 120), "Updated $stat->{updated} records"); +ok(($sysno > 0),"Inserted got valid sysno"); # ---------------------------------------------------------------------------- # Close session -- 1.7.10.4