use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.
the class JobEmailNotificationTest method testJobPendingToRun.
@Test
public void testJobPendingToRun() throws Exception {
InternalJob job = createJob(USER_EMAIL);
job.setId(new JobIdImpl(123890, job.getName()));
job.setStatus(JobStatus.PENDING);
Map<String, String> genericInfo = job.getGenericInformation();
genericInfo.put("NOTIFICATION_EVENTS", "Job pending to running");
job.setGenericInformation(genericInfo);
boolean sent = sendNotification(job, SchedulerEvent.JOB_PENDING_TO_RUNNING, stubbedSender);
assertTrue(sent);
verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job pending to running"), contains("Status: Pending"));
verifyNoMoreInteractions(stubbedSender);
}
use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.
the class JobEmailNotificationTest method testKilled.
@Test
public void testKilled() throws Exception {
InternalJob job = createJob(USER_EMAIL);
job.setId(new JobIdImpl(123890, job.getName()));
job.setStatus(JobStatus.KILLED);
Map<String, String> genericInfo = job.getGenericInformation();
genericInfo.put("NOTIFICATION_EVENTS", "Job running to finished");
job.setGenericInformation(genericInfo);
boolean sent = sendNotification(job, SchedulerEvent.JOB_RUNNING_TO_FINISHED, stubbedSender);
assertTrue(sent);
verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job running to finished"), contains("Status: Killed"));
verifyNoMoreInteractions(stubbedSender);
}
use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.
the class JobEmailNotificationTest method testJobChangePriority.
@Test
public void testJobChangePriority() throws Exception {
InternalJob job = createJob(USER_EMAIL);
job.setId(new JobIdImpl(123890, job.getName()));
job.setStatus(JobStatus.STALLED);
Map<String, String> genericInfo = job.getGenericInformation();
genericInfo.put("NOTIFICATION_EVENTS", "Job change priority");
job.setGenericInformation(genericInfo);
boolean sent = sendNotification(job, SchedulerEvent.JOB_CHANGE_PRIORITY, stubbedSender);
assertTrue(sent);
verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job change priority"), contains("Status: Stalled"));
verifyNoMoreInteractions(stubbedSender);
}
use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.
the class JobEmailNotificationTest method testPendingToFinished.
@Test
public void testPendingToFinished() throws Exception {
InternalJob job = createJob(USER_EMAIL);
job.setId(new JobIdImpl(123890, job.getName()));
job.setStatus(JobStatus.FINISHED);
Map<String, String> genericInfo = job.getGenericInformation();
genericInfo.put("NOTIFICATION_EVENTS", "Job pending to finished");
job.setGenericInformation(genericInfo);
boolean sent = sendNotification(job, SchedulerEvent.JOB_PENDING_TO_FINISHED, stubbedSender);
assertTrue(sent);
verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job pending to finished"), contains("Status: Finished"));
verifyNoMoreInteractions(stubbedSender);
}
use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.
the class JobEmailNotificationTest method testJobInError.
@Test
public void testJobInError() throws Exception {
InternalJob job = createJob(USER_EMAIL);
job.setId(new JobIdImpl(123890, job.getName()));
job.setStatus(JobStatus.IN_ERROR);
Map<String, String> genericInfo = job.getGenericInformation();
genericInfo.put("NOTIFICATION_EVENTS", "Job In-Error");
job.setGenericInformation(genericInfo);
boolean sent = sendNotification(job, SchedulerEvent.JOB_IN_ERROR, stubbedSender);
assertTrue(sent);
verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job In-Error"), contains("Status: In-Error"));
verifyNoMoreInteractions(stubbedSender);
}
Aggregations