[Bast-commits] r4121 - DBIx-Class/0.08/trunk/t
teejay at dev.catalyst.perl.org
teejay at dev.catalyst.perl.org
Tue Mar 4 20:18:45 GMT 2008
Author: teejay
Date: 2008-03-04 20:18:45 +0000 (Tue, 04 Mar 2008)
New Revision: 4121
Added:
DBIx-Class/0.08/trunk/t/93storage_replication.t
Log:
works but shouldn't
Added: DBIx-Class/0.08/trunk/t/93storage_replication.t
===================================================================
--- DBIx-Class/0.08/trunk/t/93storage_replication.t (rev 0)
+++ DBIx-Class/0.08/trunk/t/93storage_replication.t 2008-03-04 20:18:45 UTC (rev 4121)
@@ -0,0 +1,46 @@
+use strict;
+use warnings;
+use lib qw(t/lib);
+
+use File::Copy;
+
+use DBICTest;
+
+use Test::More;
+plan tests => 1;
+
+my $schema = DBICTest->init_schema();
+
+$schema->storage_type( '::DBI::Replication' );
+
+
+my $db_file1 = "t/var/DBIxClass.db";
+my $db_file2 = "t/var/DBIxClass_slave1.db";
+my $db_file3 = "t/var/DBIxClass_slave2.db";
+my $dsn1 = $ENV{"DBICTEST_DSN"} || "dbi:SQLite:${db_file1}";
+my $dsn2 = $ENV{"DBICTEST_DSN2"} || "dbi:SQLite:${db_file2}";
+my $dsn3 = $ENV{"DBICTEST_DSN3"} || "dbi:SQLite:${db_file3}";
+
+$schema->connect( [
+ [ $dsn1, '', '', { AutoCommit => 1 } ],
+ [ $dsn2, '', '', { priority => 10 } ],
+ [ $dsn3, '', '', { priority => 10 } ]
+ ]
+ );
+
+$schema->populate('Artist', [
+ [ qw/artistid name/ ],
+ [ 4, 'Ozric Tentacles']
+ ]);
+
+# try and read (should fail)
+my $new_artist = $schema->resultset('Artist')->find(4);
+
+warn "artist : $new_artist\n";
+
+# try and read (should succede after faked synchronisation)
+copy($db_file1, $db_file2);
+
+unlink $db_file2;
+
+ok(1,"These aren't the tests you're looking for");
More information about the Bast-commits
mailing list