CallableQuery extends CallableJob implements Callable<Void> { public String getReplacedReportQuery() { return replacedReportQuery; } CallableQuery();  CallableQuery(PlannedJob plannedJob, JobDao dao,
                       Reporting reporting, String hostname,
                       MailInfo mailInfo, Session session,
                       SupportedDriver driver, String reportRootPath,
                       int attemptNumber); static String[] cleanupQuery(String[] parts); static String getJobReportDir(String rootPath, PlannedJob plannedJob); static String getJobReportPath(String reportJobPath, PlannedJob plannedJob); @VisibleForTesting static void writeReportToLocal(PersistentResultSet result, String rootPath, PlannedJob plannedJob); @VisibleForTesting static String createMessageContent(PersistentResultSet results, JobSpec spec,
                                             String replacedReportQuery); static StringBuilder createInlineResults(PersistentResultSet results, JobSpec spec); static String makeAttachmentText(PersistentResultSet results); String getReplacedQuery(); String getReplacedReportQuery(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj); static Logger LOG; static final String TSV; static final String TAB; static final String ENTER; static final String NULL; static final String QUERY_SPLITTER; }
@Test public void testReplacedReportQuery() { JobSpec aJob = TestAgent.getTestJob("Mark Rothko", dao); aJob.setResultQuery("select * from blah where dt=${YYYMMDDHH}"); dao.createJob(aJob); PlannedJob pj = new PlannedJob(aJob, Utils.getCurrentTime()); CallableQuery cq = new CallableQuery(pj, dao, null, "example.com", null, null, null, null, 1); String expected = "select * from blah where dt=1970010100"; Assert.assertEquals(expected, cq.getReplacedReportQuery()); }