Search in sources :

Example 1 with JobStatus

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);
}
Also used : JobStatus(com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus) JobDTO(com.linkedin.thirdeye.datalayer.dto.JobDTO) Test(org.testng.annotations.Test)

Example 2 with JobStatus

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);
}
Also used : JobStatus(com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus) JobDTO(com.linkedin.thirdeye.datalayer.dto.JobDTO) Test(org.testng.annotations.Test)

Example 3 with JobStatus

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");
}
Also used : JobStatus(com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus) JobDTO(com.linkedin.thirdeye.datalayer.dto.JobDTO) Test(org.testng.annotations.Test)

Aggregations

JobStatus (com.linkedin.thirdeye.anomaly.job.JobConstants.JobStatus)3 JobDTO (com.linkedin.thirdeye.datalayer.dto.JobDTO)3 Test (org.testng.annotations.Test)3