1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
6 use Time::HiRes qw/gettimeofday/;
9 use DBICTest; # do not remove even though it is not used
13 for (1 .. $src_count) {
16 package DBICTest::NS::Stress::Schema::Result::T$_;
17 use base qw/DBIx::Class::Core/;
18 __PACKAGE__->table($_);
19 __PACKAGE__->add_columns (
20 id => { data_type => 'integer', is_auto_increment => 1 },
21 data => { data_type => 'varchar', size => 255 },
23 __PACKAGE__->set_primary_key('id');
24 __PACKAGE__->add_unique_constraint(['data']);
30 package DBICTest::NS::Stress::Schema;
32 use base qw/DBIx::Class::Schema/;
35 return $_[1] eq ( __PACKAGE__ . '::Result' )
36 ? ( map { __PACKAGE__ . "::Result::T$_" } 1 .. $::src_count )
42 is (DBICTest::NS::Stress::Schema->sources, 0, 'Start with no sources');
45 note gettimeofday . ":\tload_namespaces start";
46 DBICTest::NS::Stress::Schema->load_namespaces;
47 note gettimeofday . ":\tload_namespaces finished";
49 is (DBICTest::NS::Stress::Schema->sources, $src_count, 'All sources attached');