job.setType(JobType.valueOf(rs.getString("jobType"))); job.setCode(rs.getString("code")); job.setResultQuery(rs.getString("resultQuery")); job.setResultTable(rs.getString("resultTable")); job.setCronString(rs.getString("cronString"));
@Test public void testCreateMessageContent() { JobSpec aJob = TestAgent.getTestJob("Broken Social Scene", dao); aJob.setResultQuery("select * from blah where dt=${YYYMMDDHH}"); dao.createJob(aJob); PlannedJob pj = new PlannedJob(aJob, Utils.getCurrentTime());
@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()); }
"(ID INTEGER, AVAL INTEGER);\n" + "INSERT INTO test111 VALUES (%s, %s);", id1, aval1)); aJob.setResultQuery("select * from test111 limit 10"); aJob.setResultEmail(null); dao.createJob(aJob);