Commit 042ca6ad authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Minor fix in JobDAO

parent 811fe56c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -122,16 +122,16 @@ public class JobDAO {
        jobSummary.setResults(getResults(rs.getString("results")));
        
        // Retrieve error information if any
        ErrorSummary errorSummary = new ErrorSummary();
        errorSummary.setMessage(rs.getString("error_message"));
        String errorType = rs.getString("error_type");
        if (errorType != null) {
            ErrorSummary errorSummary = new ErrorSummary();
            errorSummary.setMessage(rs.getString("error_message"));
            errorSummary.setType(ErrorType.fromValue(rs.getString("error_type")));
        }
            errorSummary.setHasDetail(rs.getBoolean("error_has_detail"));
            errorSummary.setDetailMessage(rs.getString("error_detail"));

            jobSummary.setErrorSummary(errorSummary);
        }
        
        return jobSummary;
    }
+3 −0
Original line number Diff line number Diff line
@@ -72,6 +72,9 @@ public class JobDAOTest {
        assertTrue(dao.getJob("123").isPresent());
        assertEquals(ExecutionPhase.PENDING, dao.getJob("123").get().getPhase());

        // uses the job retrieved from DAO to perform the update (reproduced a bug in job update)
        job = dao.getJob("123").get();

        job.setPhase(ExecutionPhase.EXECUTING);
        dao.updateJob(job);