@@ -0,0 +1,1425 @@
+package org.ensembl.healthcheck.testcase.eg_compara;%0A%0Aimport org.ensembl.healthcheck.DatabaseRegistryEntry;%0Aimport org.ensembl.healthcheck.DatabaseType;%0Aimport org.ensembl.healthcheck.ReportManager;%0Aimport org.ensembl.healthcheck.Team;%0Aimport org.ensembl.healthcheck.testcase.AbstractTemplatedTestCase;%0Aimport org.ensembl.healthcheck.util.SqlTemplate;%0A%0Apublic class MemberProductionCounts extends AbstractTemplatedTestCase %7B%0A%0A%09public MemberProductionCounts() %7B%0A%09%09setTeamResponsible(Team.ENSEMBL_GENOMES);%0A%09%09appliesToType(DatabaseType.COMPARA);%0A%09%09setDescription(%22Checks whether member_production_counts is populated%22);%0A%09%7D%0A%0A%09@Override%0A%09protected boolean runTest(DatabaseRegistryEntry dbre) %7B%0A%09%09SqlTemplate srv = getSqlTemplate(dbre);%0A%09%09boolean result = true;%0A%09%09if(srv.queryForDefaultObject(%22SELECT COUNT(*) FROM member_production_counts INNER JOIN member USING (stable_id)%22, Integer.class)==0) %7B%0A%09%09%09ReportManager.problem(this, dbre.getConnection(), %22No entries found in member_production_counts linked to member%22);%0A%09%09%09result = false;%0A%09%09%7D%0A%09%09Integer cnt = srv.queryForDefaultObject(%22SELECT COUNT(*) FROM member_production_counts WHERE stable_id NOT IN (SELECT stable_id FROM member WHERE source_name = 'ENSEMBLGENE')%22, Integer.class);%0A%09%09if(cnt%3E0) %7B%0A%09%09%09ReportManager.problem(this, dbre.getConnection(), cnt+%22 entries found in member_production_counts that are not linked to member%22);%0A%09%09%09result = false;%0A%09%09%7D%0A%09%09return result;%0A%09%7D%0A%0A%7D%0A

Check that member_production_counts table is fully populated