[interchange-cvs] interchange - heins modified 6 files
interchange-cvs at icdevgroup.org
interchange-cvs at icdevgroup.org
Sat Jul 12 10:40:00 EDT 2003
User: heins
Date: 2003-07-12 13:40:43 GMT
Modified: dist/test/products tests.asc
Modified: lib/Vend/Table DB_File.pm GDBM.pm InMemory.pm LDAP.pm
Modified: SDBM.pm
Log:
* Add stubs for log_error and errstr routines in the appropriate
modules.
* Add test for programmatic error handling capabilities.
Revision Changes Path
2.11 +37 -7 interchange/dist/test/products/tests.asc
rev 2.11, prev_rev 2.10
Index: tests.asc
===================================================================
RCS file: /var/cvs/interchange/dist/test/products/tests.asc,v
retrieving revision 2.10
retrieving revision 2.11
diff -u -r2.10 -r2.11
--- tests.asc 7 Jul 2003 20:37:38 -0000 2.10
+++ tests.asc 12 Jul 2003 13:40:43 -0000 2.11
@@ -1963,6 +1963,7 @@
%%%
000130
%%
+Clear: [error all=1]
Set: [error name=junk set="An error"]
Test: [error all=1 keep=1]
Show_delete: [error all=1 show_error=1]
@@ -2285,20 +2286,49 @@
%%
Test [PREFIX-alternate] using $Values->{mv_item_alternate} == 4
%%%
-999999
+000149
%%
-[the test] [perl]
-# Make this come out right
-return 'The expected result as a regex.';
+[perl nonsql]
+ my $db = $Db{nonsql};
+ $db->config('Read_only', 1);
+ my @errs;
+ $db->set_field(71, 'val1', 20)
+ or push @errs, $db->errstr;
+
+ $db->set_slice(71, { val1 => 20 })
+ or push @errs, $db->errstr;
+
+ $db->query('update nonsql set val1 = 20 where code = 70')
+ or push @errs, $db->errstr;
+
+ return join "\n", @errs;
[/perl]
+Die on an error...
+[try foo]
+[perl nonsql]
+ my $db = $Db{nonsql};
+ $db->config('DIE_ERROR', 1);
+ $db->set_field(71, 'val1', 20)
+ or push @errs, $db->errstr;
+ return join "", @errs;
+[/perl]
+[/try]
+[catch foo]
+ Error from die: $ERROR$
+[/catch]
+
%%
-The expected result as a regex.
+Attempt to write nonsql::val1::71 in read-only table.*\s*
+Attempt to set slice of 71 in read-only table nonsql.*\s*
+Attempt to write read-only table nonsql.*\s*
+Die on an error...\s+
+Error from die: Attempt to write
%%
-The NOT expected result.
+
%%
%%
-Skeleton test.
+Test DB error handling
%%%
999999
%%
2.9 +4 -2 interchange/lib/Vend/Table/DB_File.pm
rev 2.9, prev_rev 2.8
Index: DB_File.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/DB_File.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- DB_File.pm 12 Jul 2003 04:47:10 -0000 2.8
+++ DB_File.pm 12 Jul 2003 13:40:43 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Table::DB_File - Access an Interchange table stored in a DB file hash
#
-# $Id: DB_File.pm,v 2.8 2003/07/12 04:47:10 mheins Exp $
+# $Id: DB_File.pm,v 2.9 2003/07/12 13:40:43 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -31,7 +31,7 @@
use Vend::Table::Common;
@ISA = qw(Vend::Table::Common);
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
sub create {
my ($class, $config, $columns, $filename) = @_;
@@ -135,11 +135,13 @@
*config = \&Vend::Table::Common::config;
*delete_record = \&Vend::Table::Common::delete_record;
*each_record = \&Vend::Table::Common::each_record;
+*errstr = \&Vend::Table::Common::errstr;
*field = \&Vend::Table::Common::field;
*field_accessor = \&Vend::Table::Common::field_accessor;
*field_settor = \&Vend::Table::Common::field_settor;
*inc_field = \&Vend::Table::Common::inc_field;
*isopen = \&Vend::Table::Common::isopen;
+*log_error = \&Vend::Table::Common::log_error;
*name = \&Vend::Table::Common::name;
*numeric = \&Vend::Table::Common::numeric;
*quote = \&Vend::Table::Common::quote;
2.9 +4 -2 interchange/lib/Vend/Table/GDBM.pm
rev 2.9, prev_rev 2.8
Index: GDBM.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/GDBM.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- GDBM.pm 12 Jul 2003 04:47:10 -0000 2.8
+++ GDBM.pm 12 Jul 2003 13:40:43 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Table::GDBM - Access an Interchange table stored in a GDBM file
#
-# $Id: GDBM.pm,v 2.8 2003/07/12 04:47:10 mheins Exp $
+# $Id: GDBM.pm,v 2.9 2003/07/12 13:40:43 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -30,7 +30,7 @@
use Vend::Table::Common;
@ISA = qw(Vend::Table::Common);
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
sub new {
my ($class, $obj) = @_;
@@ -137,11 +137,13 @@
*config = \&Vend::Table::Common::config;
*delete_record = \&Vend::Table::Common::delete_record;
*each_record = \&Vend::Table::Common::each_record;
+*errstr = \&Vend::Table::Common::errstr;
*field = \&Vend::Table::Common::field;
*field_accessor = \&Vend::Table::Common::field_accessor;
*field_settor = \&Vend::Table::Common::field_settor;
*inc_field = \&Vend::Table::Common::inc_field;
*isopen = \&Vend::Table::Common::isopen;
+*log_error = \&Vend::Table::Common::log_error;
*name = \&Vend::Table::Common::name;
*numeric = \&Vend::Table::Common::numeric;
*quote = \&Vend::Table::Common::quote;
2.12 +4 -2 interchange/lib/Vend/Table/InMemory.pm
rev 2.12, prev_rev 2.11
Index: InMemory.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/InMemory.pm,v
retrieving revision 2.11
retrieving revision 2.12
diff -u -r2.11 -r2.12
--- InMemory.pm 12 Jul 2003 04:47:10 -0000 2.11
+++ InMemory.pm 12 Jul 2003 13:40:43 -0000 2.12
@@ -1,6 +1,6 @@
# Vend::Table::InMemory - Store an Interchange table in memory
#
-# $Id: InMemory.pm,v 2.11 2003/07/12 04:47:10 mheins Exp $
+# $Id: InMemory.pm,v 2.12 2003/07/12 13:40:43 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -26,7 +26,7 @@
package Vend::Table::InMemory;
use Vend::Table::Common qw(!config !columns);
@ISA = qw/Vend::Table::Common/;
-$VERSION = substr(q$Revision: 2.11 $, 10);
+$VERSION = substr(q$Revision: 2.12 $, 10);
use strict;
# 0: column names
@@ -230,7 +230,9 @@
# Unfortunate hack need for Safe searches
*test_column = \&Vend::Table::Common::test_column;
*column_index = \&Vend::Table::Common::column_index;
+*errstr = \&Vend::Table::Common::errstr;
*field = \&Vend::Table::Common::field;
+*log_error = \&Vend::Table::Common::log_error;
*name = \&Vend::Table::Common::name;
*numeric = \&Vend::Table::Common::numeric;
*set_field = \&Vend::Table::Common::set_field;
2.9 +4 -2 interchange/lib/Vend/Table/LDAP.pm
rev 2.9, prev_rev 2.8
Index: LDAP.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/LDAP.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- LDAP.pm 12 Jul 2003 04:47:10 -0000 2.8
+++ LDAP.pm 12 Jul 2003 13:40:43 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Table::LDAP - Interchange LDAP pseudo-table access
#
-# $Id: LDAP.pm,v 2.8 2003/07/12 04:47:10 mheins Exp $
+# $Id: LDAP.pm,v 2.9 2003/07/12 13:40:43 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -25,7 +25,7 @@
package Vend::Table::LDAP;
@ISA = qw/Vend::Table::Common/;
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
use strict;
use vars qw(
@@ -684,6 +684,8 @@
# Unfortunate hack need for Safe searches
*column_index = \&Vend::Table::Common::column_index;
*column_exists = \&Vend::Table::Common::column_exists;
+*errstr = \&Vend::Table::Common::errstr;
+*log_error = \&Vend::Table::Common::log_error;
*name = \&Vend::Table::Common::name;
*numeric = \&Vend::Table::Common::numeric;
*isopen = \&Vend::Table::Common::isopen;
2.9 +5 -3 interchange/lib/Vend/Table/SDBM.pm
rev 2.9, prev_rev 2.8
Index: SDBM.pm
===================================================================
RCS file: /var/cvs/interchange/lib/Vend/Table/SDBM.pm,v
retrieving revision 2.8
retrieving revision 2.9
diff -u -r2.8 -r2.9
--- SDBM.pm 12 Jul 2003 04:47:10 -0000 2.8
+++ SDBM.pm 12 Jul 2003 13:40:43 -0000 2.9
@@ -1,6 +1,6 @@
# Vend::Table::SDBM - Access an Interchange table stored in Perl's internal SDBM
#
-# $Id: SDBM.pm,v 2.8 2003/07/12 04:47:10 mheins Exp $
+# $Id: SDBM.pm,v 2.9 2003/07/12 13:40:43 mheins Exp $
#
# Copyright (C) 2002-2003 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
@@ -24,7 +24,7 @@
# MA 02111-1307 USA.
package Vend::Table::SDBM;
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
use strict;
use Fcntl;
use SDBM_File;
@@ -32,7 +32,7 @@
use Vend::Table::Common;
@ISA = qw(Vend::Table::Common);
-$VERSION = substr(q$Revision: 2.8 $, 10);
+$VERSION = substr(q$Revision: 2.9 $, 10);
sub create {
my ($class, $config, $columns, $filename) = @_;
@@ -141,11 +141,13 @@
*config = \&Vend::Table::Common::config;
*delete_record = \&Vend::Table::Common::delete_record;
*each_record = \&Vend::Table::Common::each_record;
+*errstr = \&Vend::Table::Common::errstr;
*field = \&Vend::Table::Common::field;
*field_accessor = \&Vend::Table::Common::field_accessor;
*field_settor = \&Vend::Table::Common::field_settor;
*isopen = \&Vend::Table::Common::isopen;
*inc_field = \&Vend::Table::Common::inc_field;
+*log_error = \&Vend::Table::Common::log_error;
*name = \&Vend::Table::Common::name;
*numeric = \&Vend::Table::Common::numeric;
*quote = \&Vend::Table::Common::quote;
More information about the interchange-cvs
mailing list