Skip to content
Snippets Groups Projects
Commit 042ca6ad authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Minor fix in JobDAO

parent 811fe56c
No related branches found
No related tags found
No related merge requests found
...@@ -122,16 +122,16 @@ public class JobDAO { ...@@ -122,16 +122,16 @@ public class JobDAO {
jobSummary.setResults(getResults(rs.getString("results"))); jobSummary.setResults(getResults(rs.getString("results")));
// Retrieve error information if any // Retrieve error information if any
ErrorSummary errorSummary = new ErrorSummary();
errorSummary.setMessage(rs.getString("error_message"));
String errorType = rs.getString("error_type"); String errorType = rs.getString("error_type");
if (errorType != null) { if (errorType != null) {
ErrorSummary errorSummary = new ErrorSummary();
errorSummary.setMessage(rs.getString("error_message"));
errorSummary.setType(ErrorType.fromValue(rs.getString("error_type"))); errorSummary.setType(ErrorType.fromValue(rs.getString("error_type")));
}
errorSummary.setHasDetail(rs.getBoolean("error_has_detail")); errorSummary.setHasDetail(rs.getBoolean("error_has_detail"));
errorSummary.setDetailMessage(rs.getString("error_detail")); errorSummary.setDetailMessage(rs.getString("error_detail"));
jobSummary.setErrorSummary(errorSummary); jobSummary.setErrorSummary(errorSummary);
}
return jobSummary; return jobSummary;
} }
......
...@@ -72,6 +72,9 @@ public class JobDAOTest { ...@@ -72,6 +72,9 @@ public class JobDAOTest {
assertTrue(dao.getJob("123").isPresent()); assertTrue(dao.getJob("123").isPresent());
assertEquals(ExecutionPhase.PENDING, dao.getJob("123").get().getPhase()); 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); job.setPhase(ExecutionPhase.EXECUTING);
dao.updateJob(job); dao.updateJob(job);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment