Search in sources :

Example 6 with JobStatusResult

use of org.apache.airavata.gfac.core.monitor.JobStatusResult in project airavata by apache.

the class UGEEmailParser method parseEmail.

@Override
public JobStatusResult parseEmail(Message message) throws MessagingException, AiravataException {
    JobStatusResult jobStatusResult = new JobStatusResult();
    parseContent(message, jobStatusResult);
    return jobStatusResult;
}
Also used : JobStatusResult(org.apache.airavata.gfac.core.monitor.JobStatusResult)

Example 7 with JobStatusResult

use of org.apache.airavata.gfac.core.monitor.JobStatusResult in project airavata by apache.

the class PBSEmailParserTest method parseContent_non_ASCII.

@Test
public void parseContent_non_ASCII() throws Exception {
    PBSEmailParser parser = new PBSEmailParser();
    // test for non ascii contents
    String nonascii = "PBS Job Id: 33.torque_server\n" + "Job Name:   A2085606929\n" + "Exec host:  compute-0/0-9\n" + "Begun execution";
    JobStatusResult jsr = new JobStatusResult();
    parser.parseContent(nonascii, jsr);
    Assert.assertNotNull(jsr.getJobId());
    Assert.assertEquals("33.torque_server", jsr.getJobId());
    Assert.assertEquals("A2085606929", jsr.getJobName());
    Assert.assertEquals(JobState.ACTIVE, jsr.getState());
}
Also used : JobStatusResult(org.apache.airavata.gfac.core.monitor.JobStatusResult) Test(org.junit.Test)

Aggregations

JobStatusResult (org.apache.airavata.gfac.core.monitor.JobStatusResult)7 AiravataException (org.apache.airavata.common.exception.AiravataException)2 IOException (java.io.IOException)1 Flags (javax.mail.Flags)1 Message (javax.mail.Message)1 MessagingException (javax.mail.MessagingException)1 TaskContext (org.apache.airavata.gfac.core.context.TaskContext)1 Test (org.junit.Test)1