/** * Runs QA checks against the data. * * @param modelId * @return * @throws Exception */ public boolean testSingleModelDataQuality(Long modelId) throws Exception { Connection conn = SharedApplication.getInstance().getROConnection(); // Get list of queries in properties file Properties props = new Properties(); String path = this.getClass().getName().replace('.', '/') + ".properties"; InputStream ins = Thread.currentThread().getContextClassLoader().getResourceAsStream(path); if (ins == null) { ins = Action.class.getResourceAsStream(path); } props.load(ins); Enumeration<?> elements = props.propertyNames(); boolean passed = true; try { while (elements.hasMoreElements()) { String queryName = elements.nextElement().toString(); log.debug("Running data validation test " + queryName + "'..."); passed = passed & testSingleModelDataQuality(modelId, queryName, conn); } } finally { SharedApplication.closeConnection(conn, null); } if (passed) { log.debug("++++++++ Model #" + modelId + " PASSED all data validation tests ++++++++"); } else { // The fail message is printed in the deligated method, so no need to reprint here. } return passed; }