[Bast-commits] r4240 - DBIx-Class/0.08/trunk/t
debolaz at dev.catalyst.perl.org
debolaz at dev.catalyst.perl.org
Tue Mar 25 04:03:33 GMT 2008
Author: debolaz
Date: 2008-03-25 04:03:32 +0000 (Tue, 25 Mar 2008)
New Revision: 4240
Modified:
DBIx-Class/0.08/trunk/t/71mysql.t
DBIx-Class/0.08/trunk/t/72pg.t
Log:
Back all savepoint tests out of (mysql|pg).t
There's not a dire need to have them there, the only thing they
would be testing are the ->_svp_* methods on Storage, which are
tested in 98savepoints.t anyway.
I kept the changes in 72pg.t that was neccesary for it to run
to completion though.
Modified: DBIx-Class/0.08/trunk/t/71mysql.t
===================================================================
--- DBIx-Class/0.08/trunk/t/71mysql.t 2008-03-25 02:33:50 UTC (rev 4239)
+++ DBIx-Class/0.08/trunk/t/71mysql.t 2008-03-25 04:03:32 UTC (rev 4240)
@@ -1,11 +1,10 @@
use strict;
-use warnings;
+use warnings;
use Test::More;
use lib qw(t/lib);
use DBICTest;
use DBI::Const::GetInfoType;
-use DBICTest::Stats;
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/};
@@ -14,18 +13,15 @@
plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
-plan tests => 7;
+plan tests => 5;
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
my $dbh = $schema->storage->dbh;
-my $stats = new DBICTest::Stats();
-$schema->storage->debugobj($stats);
-$schema->storage->debug(1);
$dbh->do("DROP TABLE IF EXISTS artist;");
-$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10)) ENGINE=InnoDB;");
+$dbh->do("CREATE TABLE artist (artistid INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), charfield CHAR(10));");
#'dbi:mysql:host=localhost;database=dbic_test', 'dbic_test', '');
@@ -72,28 +68,6 @@
},
};
-$schema->txn_begin;
-
-my $arty = $schema->resultset('Artist')->find(1);
-
-my $name = $arty->name;
-
-$schema->storage->_svp_begin ("mysavepoint");
-
-$arty->update({ name => 'Jheephizzy' });
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', 'Jheephizzy', 'Name changed');
-
-$schema->storage->_svp_rollback ("mysavepoint");
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', $name, 'Name rolled back');
-
-$schema->txn_commit;
-
SKIP: {
my $mysql_version = $dbh->get_info( $GetInfoType{SQL_DBMS_VER} );
skip "Cannot determine MySQL server version", 1 if !$mysql_version;
Modified: DBIx-Class/0.08/trunk/t/72pg.t
===================================================================
--- DBIx-Class/0.08/trunk/t/72pg.t 2008-03-25 02:33:50 UTC (rev 4239)
+++ DBIx-Class/0.08/trunk/t/72pg.t 2008-03-25 04:03:32 UTC (rev 4240)
@@ -4,7 +4,6 @@
use Test::More;
use lib qw(t/lib);
use DBICTest;
-use DBICTest::Stats;
{
package DBICTest::Schema::Casecheck;
@@ -28,10 +27,10 @@
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
. ' (note: creates and drops tables named artist and casecheck!)' unless ($dsn && $user);
-plan tests => 34;
+plan tests => 32;
DBICTest::Schema->load_classes( 'Casecheck' );
-my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { auto_savepoint => 1});
+my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
# Check that datetime_parser returns correctly before we explicitly connect.
SKIP: {
@@ -46,10 +45,6 @@
}
my $dbh = $schema->storage->dbh;
-my $stats = new DBICTest::Stats();
-$schema->storage->debugobj($stats);
-$schema->storage->debug(1);
-
$schema->source("Artist")->name("testschema.artist");
$schema->source("SequenceTest")->name("testschema.sequence_test");
$dbh->do("CREATE SCHEMA testschema;");
@@ -188,8 +183,8 @@
SKIP: {
skip "Oracle Auto-PK tests are broken", 16;
+
# test auto increment using sequences WITHOUT triggers
-
for (1..5) {
my $st = $schema->resultset('SequenceTest')->create({ name => 'foo' });
is($st->pkid1, $_, "Oracle Auto-PK without trigger: First primary key");
@@ -200,28 +195,6 @@
is($st->pkid1, 55, "Oracle Auto-PK without trigger: First primary key set manually");
}
-$schema->txn_begin;
-
-my $arty = $schema->resultset('Artist')->find(1);
-
-my $name = $arty->name;
-
-$schema->storage->_svp_begin ("mysavepoint");
-
-$arty->update({ name => 'Jheephizzy' });
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', 'Jheephizzy', 'Name changed');
-
-$schema->storage->_svp_rollback ("mysavepoint");
-
-$arty->discard_changes;
-
-cmp_ok($arty->name, 'eq', $name, 'Name rolled back');
-
-$schema->txn_commit;
-
END {
if($dbh) {
$dbh->do("DROP TABLE testschema.artist;");
More information about the Bast-commits
mailing list