Search in sources :

Example 31 with JobIdImpl

use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.

the class JobLoggerTest method testGetJobLogFilename.

@Test
public void testGetJobLogFilename() {
    JobId id = new JobIdImpl(1123, "readableName");
    assertThat(JobLogger.getJobLogRelativePath(id), is("1123/1123"));
}
Also used : JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 32 with JobIdImpl

use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.

the class TaskLoggerTest method testGetJobLogFilename.

@Test
public void testGetJobLogFilename() {
    JobId jobId = new JobIdImpl(1123, "readableName");
    TaskId taskId = TaskIdImpl.createTaskId(jobId, "taskreadableName", 123123);
    assertThat(TaskLogger.getTaskLogRelativePath(taskId), is("1123/1123t123123"));
}
Also used : TaskId(org.ow2.proactive.scheduler.common.task.TaskId) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) JobId(org.ow2.proactive.scheduler.common.job.JobId) Test(org.junit.Test)

Example 33 with JobIdImpl

use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.

the class JobEmailNotificationTest method testJobRestartedFromError.

@Test
public void testJobRestartedFromError() throws Exception {
    InternalJob job = createJob(USER_EMAIL);
    job.setId(new JobIdImpl(123890, job.getName()));
    job.setStatus(JobStatus.RUNNING);
    Map<String, String> genericInfo = job.getGenericInformation();
    genericInfo.put("NOTIFICATION_EVENTS", "Job restarted from error");
    job.setGenericInformation(genericInfo);
    boolean sent = sendNotification(job, SchedulerEvent.JOB_RESTARTED_FROM_ERROR, stubbedSender);
    assertTrue(sent);
    verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job restarted from error"), contains("Status: Running"));
    verifyNoMoreInteractions(stubbedSender);
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) Matchers.anyString(org.mockito.Matchers.anyString) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 34 with JobIdImpl

use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.

the class JobEmailNotificationTest method testFinished.

@Test
public void testFinished() 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 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: Finished"));
    verifyNoMoreInteractions(stubbedSender);
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) Matchers.anyString(org.mockito.Matchers.anyString) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Example 35 with JobIdImpl

use of org.ow2.proactive.scheduler.job.JobIdImpl in project scheduling by ow2-proactive.

the class JobEmailNotificationTest method testJobSubmitted.

@Test
public void testJobSubmitted() 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 submitted");
    job.setGenericInformation(genericInfo);
    boolean sent = sendNotification(job, SchedulerEvent.JOB_SUBMITTED, stubbedSender);
    assertTrue(sent);
    verify(stubbedSender).sender(eq(USER_EMAIL), contains("ProActive Job 123890 : Job submitted"), contains("Status: Pending"));
    verifyNoMoreInteractions(stubbedSender);
}
Also used : InternalJob(org.ow2.proactive.scheduler.job.InternalJob) JobIdImpl(org.ow2.proactive.scheduler.job.JobIdImpl) Matchers.anyString(org.mockito.Matchers.anyString) Matchers.containsString(org.hamcrest.Matchers.containsString) Test(org.junit.Test)

Aggregations

JobIdImpl (org.ow2.proactive.scheduler.job.JobIdImpl)85 Test (org.junit.Test)70 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)36 JobId (org.ow2.proactive.scheduler.common.job.JobId)34 InternalTaskFlowJob (org.ow2.proactive.scheduler.job.InternalTaskFlowJob)26 TaskId (org.ow2.proactive.scheduler.common.task.TaskId)24 InternalScriptTask (org.ow2.proactive.scheduler.task.internal.InternalScriptTask)24 InternalTask (org.ow2.proactive.scheduler.task.internal.InternalTask)24 ArrayList (java.util.ArrayList)20 ExecuterInformation (org.ow2.proactive.scheduler.task.internal.ExecuterInformation)13 TaskResultImpl (org.ow2.proactive.scheduler.task.TaskResultImpl)12 Matchers.containsString (org.hamcrest.Matchers.containsString)10 Matchers.anyString (org.mockito.Matchers.anyString)10 ScriptExecutableContainer (org.ow2.proactive.scheduler.task.containers.ScriptExecutableContainer)9 TaskContext (org.ow2.proactive.scheduler.task.context.TaskContext)9 TaskInfoImpl (org.ow2.proactive.scheduler.task.TaskInfoImpl)8 SimpleScript (org.ow2.proactive.scripting.SimpleScript)8 TaskScript (org.ow2.proactive.scripting.TaskScript)8 NodeDataSpacesURIs (org.ow2.proactive.scheduler.task.context.NodeDataSpacesURIs)7 InProcessTaskExecutor (org.ow2.proactive.scheduler.task.executors.InProcessTaskExecutor)6