[Bast-commits] r4337 - in DBIx-Class/0.08/branches/replication_dedux: . lib/DBIx/Class lib/DBIx/Class/Schema t

jnapiorkowski at dev.catalyst.perl.org jnapiorkowski at dev.catalyst.perl.org
Mon May 5 21:50:12 BST 2008


Author: jnapiorkowski
Date: 2008-05-05 21:50:11 +0100 (Mon, 05 May 2008)
New Revision: 4337

Removed:
   DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/AtQueryInterval.pm
   DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/Job.pm
   DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/QueryInterval.pm
   DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/Role/
   DBIx-Class/0.08/branches/replication_dedux/t/99schema_roles.t
Modified:
   DBIx-Class/0.08/branches/replication_dedux/
   DBIx-Class/0.08/branches/replication_dedux/Changes
   DBIx-Class/0.08/branches/replication_dedux/Makefile.PL
   DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/StartupCheck.pm
   DBIx-Class/0.08/branches/replication_dedux/t/03podcoverage.t
Log:
 r8434 at dev (orig r4321):  matthewt | 2008-05-05 12:55:23 -0500
 reverse r4290 since we -do- -not- currently want these namespaces indexed
 r8435 at dev (orig r4326):  jnapiorkowski | 2008-05-05 13:33:57 -0500
 removed query count stuff from trunk so we can play with this on a branch instead
 r8436 at dev (orig r4330):  matthewt | 2008-05-05 14:59:31 -0500
 this was meant to be deleted with the rest of the Moose stuff
 r8437 at dev (orig r4331):  matthewt | 2008-05-05 15:00:18 -0500
 make override follow Replication -> Replicated rename
 r8438 at dev (orig r4332):  matthewt | 2008-05-05 15:00:49 -0500
 restore debolaz's cleanup patch since it's not what I thought it was and probably the right thing to do; mea culpa
 r8439 at dev (orig r4333):  matthewt | 2008-05-05 15:22:17 -0500
 missed another package line
 r8440 at dev (orig r4334):  matthewt | 2008-05-05 15:32:58 -0500
 improvements to the META.yml magic
 r8442 at dev (orig r4336):  matthewt | 2008-05-05 15:46:21 -0500
 no author notes in Changes if you're already in CONTRIBUTORS please, once you have that and a commit bit you're just another poor bastard stuck maintaining an ORM, just like I am



Property changes on: DBIx-Class/0.08/branches/replication_dedux
___________________________________________________________________
Name: svk:merge
   - 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510
   + 168d5346-440b-0410-b799-f706be625ff1:/DBIx-Class-current:2207
462d4d0c-b505-0410-bf8e-ce8f877b3390:/local/bast/DBIx-Class:3159
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class:32260
9c88509d-e914-0410-b01c-b9530614cbfe:/local/DBIx-Class-CDBICompat:54993
9c88509d-e914-0410-b01c-b9530614cbfe:/vendor/DBIx-Class:31122
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/cdbicompat_integration:4160
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/file_column:3920
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/on_disconnect_do:3694
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/oracle_sequence:4173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/savepoints:4223
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/storage-ms-access:4142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/branches/versioned_enhancements:4125
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/DBIx-Class/0.08/trunk:4336
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-C3:318
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-current:2222
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-joins:173
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class-resultset:570
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/datetime:1716
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_compat:1855
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/find_unique_query_fixes:2142
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/inflate:1988
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/many_to_many:2025
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/re_refactor_bugfix:1944
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/reorganize_tests:1827
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset-new-refactor:1766
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_2_electric_boogaloo:2175
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/resultset_cleanup:2102
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/branches/DBIx-Class/sqlt_tests_refactor:2043
bd8105ee-0ff8-0310-8827-fb3f25b6796d:/trunk/DBIx-Class:3606
fe160bb6-dc1c-0410-9f2b-d64a711b54a5:/local/DBIC-trunk-0.08:10510

Modified: DBIx-Class/0.08/branches/replication_dedux/Changes
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/Changes	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/Changes	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,7 +1,8 @@
 Revision history for DBIx::Class
 
+        - make ash's build_requires/META.yml fixes work better
         - is_deferable support on relations used by the SQL::Translator
-          parser (Anders Nor Berle)
+          parser
         - Refactored DBIx::Class::Schema::Versioned
         - Syntax errors from resultset components are now reported correctly
         - sqltargs respected correctly in deploy et al.
@@ -9,8 +10,8 @@
           nested transactions if auto_savepoint is set in connect_info.
         - Changed naming scheme for constraints and keys in the sqlt parser;
           names should now be consistent and collision-free.
-        - Improve handling of explicit key attr in ResultSet::find (zby)
-        - Add warnings for non-unique ResultSet::find queries (zby)
+        - Improve handling of explicit key attr in ResultSet::find
+        - Add warnings for non-unique ResultSet::find queries
 
 0.08010 2008-03-01 10:30
         - Fix t/94versioning.t so it passes with latest SQL::Translator

Modified: DBIx-Class/0.08/branches/replication_dedux/Makefile.PL
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/Makefile.PL	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/Makefile.PL	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,5 +1,9 @@
 use inc::Module::Install 0.67;
+use strict;
+use warnings;
 
+use 5.006001; # delete this line if you want to send patches for earlier.
+
 name     'DBIx-Class';
 perl_version '5.006001';
 all_from 'lib/DBIx/Class.pm';
@@ -35,11 +39,19 @@
 tests "t/*.t t/*/*.t";
 
 # re-build README and require CDBI modules for testing if we're in a checkout
-if( -e 'inc/.author' ) {
-  build_requires 'DBIx::ContextualFetch';
-  build_requires 'Class::Trigger';
-  build_requires 'Time::Piece';
 
+my @force_build_requires_if_author = qw(
+  DBIx::ContextualFetch
+  Class::Trigger
+  Time::Piece
+);
+
+if ($Module::Install::AUTHOR) {
+
+  foreach my $module (@force_build_requires_if_author) {
+    build_requires $module;
+  }
+
   system('pod2text lib/DBIx/Class.pm > README');
 }
 
@@ -53,16 +65,23 @@
 if ($Module::Install::AUTHOR) {
   # Need to do this _after_ WriteAll else it looses track of them
   Meta->{values}{build_requires} = [ grep {
-    $_->[0] !~ /
-      DBIx::ContextualFetch |
-      Class::Trigger |
-      Time::Piece
-    /x;
+    my $ok = 1;
+    foreach my $module (@force_build_requires_if_author) {
+      if ($_->[0] =~ /$module/) {
+        $ok = 0;
+        last;
+      }
+    }
+    $ok;
   } @{Meta->{values}{build_requires}} ];
 
   my @scalar_keys = Module::Install::Metadata::Meta_TupleKeys();
-  sub Module::Install::Metadata::Meta_TupleKeys {
-    return @scalar_keys, 'resources';
+  my $cr = Module::Install::Metadata->can("Meta_TupleKeys");
+  {
+    no warnings 'redefine';
+    *Module::Install::Metadata::Meta_TupleKeys = sub {
+      return $cr->(@_), 'resources';
+    };
   }
   Meta->{values}{resources} = [ 
     [ 'MailingList', 'http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class' ],

Deleted: DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/AtQueryInterval.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/AtQueryInterval.pm	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/AtQueryInterval.pm	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,91 +0,0 @@
-package DBIx::Class::Schema::AtQueryInterval;
-
-use Moose;
-
-=head1 NAME
-
-DBIx::Class::Schema::Role::AtQueryInterval; Defines a job control interval.
-
-=head1 SYNOPSIS
-
-The following example shows how to define a job control interval and assign it
-to a particular L<DBIx::Class::Schema::Job> for a L<DBIx::Class::Schema>
-
-    my $job = DBIx::Class::Schema->new(runs => sub { print 'did job'});
-    my $interval = DBIx::Class::Schema::Interval->new(every => 10);
-    
-    if($interval->matches($query_count)) {
-    	print "I indentified the query count as matching";
-    }
-    
-    ## $schema->isa(DBIx::Class::Schema);
-    $schema->create_and_add_at_query_intervals($interval => $job);
-    
-=head1 DESCRIPTION
-
-An AtQueryInterval is a plan object that will execute a certain
-
-=head1 ATTRIBUTES
-
-This package defines the following attributes.
-
-=head2 job (DBIx::Class::Schema::Job)
-
-This is the job which will run at the specified query interval
-
-=cut
-
-has 'job' => (
-  is=>'ro',
-  isa=>'DBIx::Class::Schema::Job',
-  required=>1,
-  handles=>['execute'],
-);
-
-
-=head2 interval (Int)
-
-This is the interval we are watching for
-
-=cut
-
-has 'interval' => (
-  is=>'ro',
-  isa=>'DBIx::Class::Schema::QueryInterval',
-  required=>1,
-  handles=>['matches'],
-);
-
-
-=head1 METHODS
-
-This module defines the following methods.
-
-=head2 execute_if_matches ($query_count, @args)
-
-Does the $query_count match the defined interval?  Returns a Boolean.
-
-=cut
-
-sub execute_if_matches {
-  my ($self, $query_count, @args) = @_;
-  if($self->matches($query_count)) {
-  	return $self->execute(@args);
-  } else {
-  	return;
-  }
-}
-
-
-=head1 AUTHORS
-
-See L<DBIx::Class> for more information regarding authors.
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-
-
-1;
\ No newline at end of file

Deleted: DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/Job.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/Job.pm	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/Job.pm	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,92 +0,0 @@
-package DBIx::Class::Schema::Job;
-
-use Moose;
-use Moose::Util::TypeConstraints;
-
-=head1 NAME
-
-DBIx::Class::Schema::Job; A job associated with a Schema
-
-=head1 SYNOPSIS
-
-The following example creates a new job and then executes it.
-
-    my $job = DBIx::Class::Schema->new(runs => sub { print 'did job'});
-    $job->execute; # 'did job' -> STDOUT
-
-=head1 DESCRIPTION
-
-This is a base class intended to hold code that get's executed by the schema
-according to rules known to the schema.  Subclassers may wish to override how
-the L</runs> attribute is defined in order to create custom behavior.
-
-=head1 SUBTYPES
-
-This package defines the following subtypes
-
-=head2 Handler
-
-A coderef based type that the job runs when L</execute> is called.
-
-=cut
-
-subtype 'DBIx::Class::Schema::Job::Handler'
-    => as 'CodeRef';
-    
-coerce 'DBIx::Class::Schema::Job::Handler'
-    => from 'Str'
-    => via {
-    	my $handler_method = $_; 
-        sub {
-        	my $job = shift @_;
-        	my $target = shift @_;
-        	$target->$handler_method($job, @_);
-        };                 
-    };
-
-=head1 ATTRIBUTES
-
-This package defines the following attributes.
-
-=head2 runs
-
-This is a coderef which is de-reffed by L</execute> and is passed the job object
-(ie $self), and any additional arguments passed to L</execute>
-
-=cut
-
-has 'runs' => (
-  is=>'ro',
-  isa=>'DBIx::Class::Schema::Job::Handler',
-  coerce=>1,
-  required=>1,
-);
-
-
-=head1 METHODS
-
-This module defines the following methods.
-
-=head2 execute ($schema, $query_interval)
-
-Method called by the L<DBIx::Class::Schema> when it wants a given job to run.
-
-=cut
-
-sub execute {
-	return $_[0]->runs->(@_);
-}
-
-
-=head1 AUTHORS
-
-See L<DBIx::Class> for more information regarding authors.
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-
-
-1;
\ No newline at end of file

Deleted: DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/QueryInterval.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/QueryInterval.pm	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/Schema/QueryInterval.pm	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,93 +0,0 @@
-package DBIx::Class::Schema::QueryInterval;
-
-use Moose;
-
-=head1 NAME
-
-DBIx::Class::Schema::Role::QueryInterval; Defines a job control interval.
-
-=head1 SYNOPSIS
-
-The following example shows how to define a job control interval and assign it
-to a particular L<DBIx::Class::Schema::Job> for a L<DBIx::Class::Schema>
-
-    my $job = DBIx::Class::Schema->new(runs => sub { print 'did job'});
-    my $interval = DBIx::Class::Schema::Interval->new(every => 10);
-    
-    if($interval->matches($query_count)) {
-    	print "I indentified the query count as matching";
-    }
-    
-    ## $schema->isa(DBIx::Class::Schema);
-    $schema->create_and_add_at_query_intervals($interval => $job);
-    
-=head1 DESCRIPTION
-
-A Query Interval defines a reoccuring period based on the query count from a
-given offset.  For example, you can define a query interval of 10 queries
-with an offset of 1 query.  This interval identifies query number 11, 21, 31,
-and so on.
-
-=head1 ATTRIBUTES
-
-This package defines the following attributes.
-
-=head2 every (Int)
-
-This is the 'size' of the gap identifying a query as matching a particular
-interval.  Think, "I match every X queries".
-
-=cut
-
-has 'every' => (
-  is=>'ro',
-  isa=>'Int',
-  required=>1,
-);
-
-
-=head2 offset (Int)
-
-This is a number of queries from the start of all queries to offset the match
-counting mechanism.  This is basically added to the L</every> attribute to 
-identify a query as matching the interval we wish to define.
-
-=cut
-
-has 'offset' => (
-  is=>'ro',
-  isa=>'Int',
-  required=>1,
-  default=>0,
-);
-
-
-=head1 METHODS
-
-This module defines the following methods.
-
-=head2 matches ($query_count)
-
-Does the $query_count match the defined interval?  Returns a Boolean.
-
-=cut
-
-sub matches {
-  my ($self, $query_count) = @_;
-  my $offset_count = $query_count - $self->offset;
-  return $offset_count % $self->every ? 0:1;
-}
-
-
-=head1 AUTHORS
-
-See L<DBIx::Class> for more information regarding authors.
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
-
-
-1;
\ No newline at end of file

Modified: DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/StartupCheck.pm
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/StartupCheck.pm	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/lib/DBIx/Class/StartupCheck.pm	2008-05-05 20:50:11 UTC (rev 4337)
@@ -2,7 +2,8 @@
 
 BEGIN {
 
-    { package TestRHBug; use overload bool => sub { 0 } }
+    { package # don't want this in PAUSE
+        TestRHBug; use overload bool => sub { 0 } }
 
     sub _has_bug_34925 {
 	my %thing;

Modified: DBIx-Class/0.08/branches/replication_dedux/t/03podcoverage.t
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/03podcoverage.t	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/t/03podcoverage.t	2008-05-05 20:50:11 UTC (rev 4337)
@@ -100,7 +100,7 @@
 
 # must kill authors.
 
-    'DBIx::Class::Storage::DBI::Replication' => { skip => 1 },
+    'DBIx::Class::Storage::DBI::Replicated' => { skip => 1 },
 };
 
 foreach my $module (@modules) {

Deleted: DBIx-Class/0.08/branches/replication_dedux/t/99schema_roles.t
===================================================================
--- DBIx-Class/0.08/branches/replication_dedux/t/99schema_roles.t	2008-05-05 20:46:21 UTC (rev 4336)
+++ DBIx-Class/0.08/branches/replication_dedux/t/99schema_roles.t	2008-05-05 20:50:11 UTC (rev 4337)
@@ -1,192 +0,0 @@
-use strict;
-use warnings;
-use lib qw(t/lib);
-use Test::More;
-
-BEGIN {
-    eval "use Moose";
-    plan $@
-        ? ( skip_all => 'needs Moose for testing' )
-        : ( tests => 35 );
-}
-
-=head1 NAME
-
-DBICNGTest::Schema::ResultSet:Person; Example Resultset
-
-=head1 DESCRIPTION
-
-Tests for the various Schema roles you can either use or apply
-
-=head1 TESTS
-
-=head2 initialize database
-
-create a schema and setup
-
-=cut
-
-use_ok 'DBICNGTest::Schema';
-
-ok my $db_file = Path::Class::File->new(qw/t var DBIxClassNG.db/)
-    => 'created a path for the test database';
-
-unlink $db_file;
-
-ok my $schema = DBICNGTest::Schema->connect_and_setup($db_file)
-    => 'Created a good Schema';
-
-is ref $schema->source('Person'), 'DBIx::Class::ResultSource::Table'
-    => 'Found Expected Person Source';
-    
-is $schema->resultset('Person')->count, 5
-    => 'Got the correct number of people';
-
-is $schema->resultset('Gender')->count, 3
-    => 'Got the correct number of genders';
-
-
-=head2 check query counter
-
-Test the query counter role
-
-=cut
-
-use_ok 'DBIx::Class::Storage::DBI::Role::QueryCounter';
-DBIx::Class::Storage::DBI::Role::QueryCounter->meta->apply($schema->storage);
-
-is $schema->storage->query_count, 0
-    => 'Query Count is zero';
-    
-is $schema->resultset('Person')->find(1)->name, 'john'
-    => 'Found John!';
-
-is $schema->resultset('Person')->find(2)->name, 'dan'
-    => 'Found Dan!';
-
-is $schema->storage->query_count, 2
-    => 'Query Count is two'; 
-
-
-=head2 check at query interval 
-    
-Test the role for associating events with a given query interval
-
-=cut
-
-use_ok 'DBIx::Class::Schema::Role::AtQueryInterval';
-DBIx::Class::Schema::Role::AtQueryInterval->meta->apply($schema);
-
-ok my $job1 = $schema->create_job(runs=>sub { 'hello'})
-    => 'Created a job';
-
-is $job1->execute, 'hello',
-    => 'Got expected information from the job';
-
-ok my $job2 = $schema->create_job(runs=>'job_handler_echo')
-    => 'Created a job';
-
-is $job2->execute($schema, 'hello1'), 'hello1',
-    => 'Got expected information from the job';
-
-ok my $interval1 = $schema->create_query_interval(every=>10)
-    => 'Created an interval';
-
-ok $interval1->matches(10)
-    => 'correctly matched 10';
-
-ok $interval1->matches(20)
-    => 'correctly matched 20';
-
-ok !$interval1->matches(22)
-    => 'correctly didnt matched 22';
-
-ok my $interval2 = $schema->create_query_interval(every=>10, offset=>2)
-    => 'Created an interval';
-
-ok $interval2->matches(12)
-    => 'correctly matched 12';
-
-ok $interval2->matches(22)
-    => 'correctly matched 22';
-
-ok !$interval2->matches(25)
-    => 'correctly didnt matched 25';
-    
-ok my $at = $schema->create_at_query_interval(interval=>$interval2, job=>$job2)
-    => 'created the at query interval object';
-    
-is $at->execute_if_matches(32, $schema, 'hello2'), 'hello2'
-    => 'Got correct return';
-    
-ok $schema->at_query_intervals([$at])
-    => 'added job to run at a given interval';
-
-is_deeply [$schema->execute_jobs_at_query_interval(42, 'hello4')], ['hello4']
-    => 'got expected job return value';
-    
-=head2 create jobs via express method
-
-Using the express method, build a bunch of jobs
-
-=cut
-
-ok my @ats = $schema->create_and_add_at_query_intervals(
-
-    {every => 10} => {
-        runs => sub {10},
-    },
-    {every => 20} => {
-        runs => sub {20},
-    },
-    {every => 30} => {
-        runs => sub {30},
-    },
-    {every => 101} => [
-        {runs => sub {101.1}},
-        {runs => sub {101.2}},       
-    ],
-           
-) => 'created express method at query intervals';
-
-
-is_deeply [$schema->execute_jobs_at_query_interval(10)], [10]
-    => 'Got Expected return for 10';
-
-is_deeply [$schema->execute_jobs_at_query_interval(12, 'hello5')], ['hello5']
-    => 'Got Expected return for 12';
-       
-is_deeply [$schema->execute_jobs_at_query_interval(20)], [10,20]
-    => 'Got Expected return for 20';
-
-is_deeply [$schema->execute_jobs_at_query_interval(30)], [10,30]
-    => 'Got Expected return for 30';
-    
-is_deeply [$schema->execute_jobs_at_query_interval(60)], [10,20,30]
-    => 'Got Expected return for 60';    
-     
-is_deeply [$schema->execute_jobs_at_query_interval(101)], [101.1,101.2]
-    => 'Got Expected return for 101';
-   
-   
-
-
-
-=head2 cleanup
-
-Cleanup after ourselves
-
-=cut
-
-unlink $db_file;
-
-
-=head1 AUTHORS
-
-See L<DBIx::Class> for more information regarding authors.
-
-=head1 LICENSE
-
-You may distribute this code under the same terms as Perl itself.
-
-=cut
\ No newline at end of file




More information about the Bast-commits mailing list