@@ -0,0 +1,2640 @@
+/*%0A * Copyright (C) 2004 EBI, GRL%0A * %0A * This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by%0A * the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.%0A * %0A * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or%0A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.%0A * %0A * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation,%0A * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA%0A */%0A%0Apackage org.ensembl.healthcheck.testcase.variation;%0A%0Aimport java.sql.Connection;%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.SingleDatabaseTestCase;%0Aimport org.ensembl.healthcheck.util.DBUtils;%0A%0A/**%0A * Check that the variation table does not contain anomalities%0A */%0Apublic class Variation extends SingleDatabaseTestCase %7B%0A%0A%09/**%0A%09 * Creates a new instance of Variation%0A%09 */%0A%09public Variation() %7B%0A%0A%09%09addToGroup(%22variation-release%22);%0A%09%09%0A%09%09setDescription(%22Checks that the variation table does not have blank evidence statuses%22);%0A%09%09setTeamResponsible(Team.VARIATION);%0A%0A%09%7D%0A%0A%09// ---------------------------------------------------------------------%0A%0A%09/**%0A%09 * Check that the variation table does not have blank evidence statuses%0A%09 * %0A%09 * @param dbre%0A%09 *          The database to check.%0A%09 * @return true if the test passed.%0A%09 */%0A%09public boolean run(DatabaseRegistryEntry dbre) %7B%0A%0A%09%09Connection con = dbre.getConnection();%0A%09%09boolean result = true;%0A%09%09%0A%09%09try %7B%09%09%09%09%0A%09%09%09// Check for empty but non-null evidence statuses %0A%09%09%09if (!checkCountIsZero(con,%22variation%22,%22evidence = '' %22)) %7B%0A%09%09%09%09ReportManager.problem(this, con, %22Variations with blank evidence statuses%22);%0A%09%09%09%09result = false;%0A%09%09%09%7D%0A%09%09%09%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09ReportManager.problem(this, con, %22HealthCheck caused an exception: %22 + e.getMessage());%0A%09%09%09result = false;%0A%09%09%7D%0A%09%09%0A%09%09return result;%0A%0A%09%7D // run%0A%0A%09// -----------------------------------------------------------------%0A%0A%09/**%0A%09 * This only applies to variation databases.%0A%09 */%0A%09public void types() %7B%0A%0A%09%09removeAppliesToType(DatabaseType.OTHERFEATURES);%0A%09%09removeAppliesToType(DatabaseType.CDNA);%0A%09%09removeAppliesToType(DatabaseType.CORE);%0A%09%09removeAppliesToType(DatabaseType.VEGA);%0A%0A%09%7D%0A%0A%7D // Variation%0A

Check for blank (non-null) evidence statuses