2011-03-16 08:50:31 +00:00
|
|
|
use strict;
|
|
|
|
use Hydra::Schema;
|
|
|
|
use Hydra::Helper::Nix;
|
|
|
|
|
|
|
|
my $db = openHydraDB;
|
|
|
|
|
|
|
|
my @sources = $db->sources;
|
|
|
|
my $nrtables = scalar(@sources);
|
|
|
|
|
2011-12-05 14:21:43 +00:00
|
|
|
use Test::Simple tests => 44;
|
2011-03-16 08:50:31 +00:00
|
|
|
|
|
|
|
foreach my $source (@sources) {
|
2011-03-16 09:01:09 +00:00
|
|
|
my $title = "Basic select query for $source";
|
2011-12-05 14:21:43 +00:00
|
|
|
if ($source eq "SchemaVersion") {
|
|
|
|
ok(scalar($db->resultset($source)->all) == 1, $title);
|
|
|
|
} elsif( $source !~ m/^(LatestSucceeded|JobStatus|ActiveJobs)/) {
|
|
|
|
ok(scalar($db->resultset($source)->all) == 0, $title);
|
2011-03-16 09:01:09 +00:00
|
|
|
}
|
|
|
|
else {
|
2011-12-05 14:21:43 +00:00
|
|
|
ok(scalar($db->resultset($source)->search({},{ bind => ["", "", ""] })) == 0, $title);
|
2011-03-16 08:50:31 +00:00
|
|
|
}
|
|
|
|
}
|
2011-03-16 09:01:09 +00:00
|
|
|
|