assertEquals(query.getParameterValue("id"), bean.getId());
}
public void testUpdateQuery() throws Exception {
EntityManager em = jpaService.getEntityManager();
SLASummaryBean bean = addRecordToSLASummaryTable("test-sla-summary", SLAStatus.IN_PROCESS);
// UPDATE_SLA_SUMMARY_FOR_STATUS_ACTUAL_TIMES
Query query = SLASummaryQueryExecutor.getInstance().getUpdateQuery(
SLASummaryQuery.UPDATE_SLA_SUMMARY_FOR_STATUS_ACTUAL_TIMES, bean, em);
assertEquals(query.getParameterValue("jobId"), bean.getId());
assertEquals(query.getParameterValue("slaStatus"), bean.getSLAStatus().toString());
assertEquals(query.getParameterValue("lastModifiedTS"), bean.getLastModifiedTimestamp());
assertEquals(query.getParameterValue("eventStatus"), bean.getEventStatus().toString());
assertEquals(query.getParameterValue("jobStatus"), bean.getJobStatus());
assertEquals(query.getParameterValue("eventProcessed"), bean.getEventProcessed());
assertEquals(query.getParameterValue("actualStartTS"), bean.getActualStartTimestamp());
assertEquals(query.getParameterValue("actualEndTS"), bean.getActualEndTimestamp());
assertEquals(query.getParameterValue("actualDuration"), bean.getActualDuration());
// UPDATE_SLA_SUMMARY_REGISTRATION
query = SLASummaryQueryExecutor.getInstance().getUpdateQuery(SLASummaryQuery.UPDATE_SLA_SUMMARY_ALL, bean, em);
assertEquals(query.getParameterValue("appName"), bean.getAppName());
assertEquals(query.getParameterValue("appType"), bean.getAppType().toString());
assertEquals(query.getParameterValue("nominalTime"), bean.getNominalTimestamp());
assertEquals(query.getParameterValue("expectedStartTime"), bean.getExpectedStartTimestamp());
assertEquals(query.getParameterValue("expectedEndTime"), bean.getExpectedEndTimestamp());
assertEquals(query.getParameterValue("expectedDuration"), bean.getExpectedDuration());
assertEquals(query.getParameterValue("jobStatus"), bean.getJobStatus());
assertEquals(query.getParameterValue("slaStatus"), bean.getSLAStatus().toString());
assertEquals(query.getParameterValue("eventStatus"), bean.getEventStatus().toString());
assertEquals(query.getParameterValue("lastModTime"), bean.getLastModifiedTimestamp());
assertEquals(query.getParameterValue("user"), bean.getUser());
assertEquals(query.getParameterValue("parentId"), bean.getParentId());
assertEquals(query.getParameterValue("eventProcessed"), bean.getEventProcessed());
assertEquals(query.getParameterValue("actualDuration"), bean.getActualDuration());
assertEquals(query.getParameterValue("actualEndTS"), bean.getActualEndTimestamp());
assertEquals(query.getParameterValue("actualStartTS"), bean.getActualStartTimestamp());
assertEquals(query.getParameterValue("jobId"), bean.getId());
em.close();
}