use of org.opencastproject.job.jpa.JpaJob in project opencast by opencast.
the class DispatchableComparatorTest method testLessThanByDateCreated.
@Test
public void testLessThanByDateCreated() {
// Test first less than second: same job type, same status, different date
JpaJob j5 = createJob(5L, "non-wf", Status.RESTART, dtPlusOneHour);
assertEquals("Jobs with earlier created date should be less than jobs with later created date", -1, dispatchableComparator.compare(j1, j5));
}
use of org.opencastproject.job.jpa.JpaJob in project opencast by opencast.
the class DispatchableComparatorTest method testEquals.
@Test
public void testEquals() {
// Test equals: same job type, same status, same date
JpaJob j2 = createJob(2L, "non-wf", Status.RESTART, dt);
assertEquals("Two jobs with equal type, status and creation date must be considered equal", 0, dispatchableComparator.compare(j1, j2));
}
use of org.opencastproject.job.jpa.JpaJob in project opencast by opencast.
the class DispatchableComparatorTest method testLessThanByJobType.
@Test
public void testLessThanByJobType() {
// Test first less than second: different job type, same status, same date
JpaJob j4 = createJob(4L, ServiceRegistryJpaImpl.TYPE_WORKFLOW, Status.RESTART, dt);
assertEquals("Non-workflow jobs should be less than workflow jobs", -1, dispatchableComparator.compare(j1, j4));
}
use of org.opencastproject.job.jpa.JpaJob in project opencast by opencast.
the class DispatchableComparatorTest method testGreaterThanByJobStatus.
@Test
public void testGreaterThanByJobStatus() {
// Test first greater than second: same job type, different status, same date
JpaJob j3 = createJob(3L, "non-wf", Status.QUEUED, dt);
assertEquals("Jobs with RESTART status should be less than those with QUEUED status", 1, dispatchableComparator.compare(j3, j1));
}
use of org.opencastproject.job.jpa.JpaJob in project opencast by opencast.
the class DispatchableComparatorTest method testLessThanByJobStatus.
@Test
public void testLessThanByJobStatus() {
// Test first less than second: same job type, different status, same date
JpaJob j3 = createJob(3L, "non-wf", Status.QUEUED, dt);
assertEquals("Jobs with RESTART status should be less than those with QUEUED status", -1, dispatchableComparator.compare(j1, j3));
}
Aggregations