use of com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus in project pinot by linkedin.
the class TestAnomalyJobManager method testFindByStatus.
@Test(dependsOnMethods = { "testUpdateStatusAndJobEndTime" })
public void testFindByStatus() {
JobStatus status = JobStatus.COMPLETED;
List<JobDTO> anomalyJobs = jobDAO.findByStatus(status);
Assert.assertEquals(anomalyJobs.size(), 2);
Assert.assertEquals(anomalyJobs.get(0).getStatus(), status);
}
use of com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus in project pinot by linkedin.
the class TestAnomalyJobManager method testDeleteRecordsOlderThanDaysWithStatus.
@Test(dependsOnMethods = { "testFindByStatus" })
public void testDeleteRecordsOlderThanDaysWithStatus() {
JobStatus status = JobStatus.COMPLETED;
int numRecordsDeleted = jobDAO.deleteRecordsOlderThanDaysWithStatus(0, status);
Assert.assertEquals(numRecordsDeleted, 2);
List<JobDTO> anomalyJobs = jobDAO.findByStatus(status);
Assert.assertEquals(anomalyJobs.size(), 0);
}
use of com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus in project pinot by linkedin.
the class TestAnomalyJobManager method testUpdateStatusAndJobEndTime.
@Test(dependsOnMethods = { "testFindAll" })
public void testUpdateStatusAndJobEndTime() {
JobStatus status = JobStatus.COMPLETED;
long jobEndTime = System.currentTimeMillis();
jobDAO.updateStatusAndJobEndTimeForJobIds(Sets.newHashSet(anomalyJobId1, anomalyJobId3), status, jobEndTime);
JobDTO anomalyJob = jobDAO.findById(anomalyJobId1);
Assert.assertEquals(anomalyJob.getStatus(), status);
Assert.assertEquals(anomalyJob.getScheduleEndTime(), jobEndTime);
printAll("After testUpdateStatusAndJobEndTime");
}