@Test public void testGettingLoggingData() { List<SystemLogDb> loggingData = sysLogImpl.getLoggingData(); assertNull(loggingData); }
@SuppressWarnings("unchecked") @Override public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { sqlWhere = ""; } else { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); } catch (Exception e1) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1); } } return system; }
SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { sqlWhere = ""; } else { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); } catch (Exception e1) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1); } } return system; } }
SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { sqlWhere = ""; } else { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); } catch (Exception e1) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1); } } return system; }  }
SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { sqlWhere = ""; } else { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); } catch (Exception e1) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1); } } return system; }  @SuppressWarnings("unchecked") @Override List<SystemLogDb> getLoggingData(); @SuppressWarnings("unchecked") @Override List<SystemLogDb> getSystemAlertData(); }
SystemLogDbDaoImpl implements SystemLogDbDao { @SuppressWarnings("unchecked") @Override public List<SystemLogDb> getLoggingData() { Session session = HibernateSession.getSession(); Transaction tx = session.beginTransaction(); List<SystemLogDb> system = null; try { String sqlWhere = null; if (PolicyController.isjUnit()) { sqlWhere = ""; } else { sqlWhere = "date > DATE_SUB(curdate(), INTERVAL 5 DAY) ORDER BY date DESC limit " + PolicyController.getLogTableLimit() + ""; } Criteria cr = session.createCriteria(SystemLogDb.class); cr.add(Restrictions.sqlRestriction(sqlWhere)); system = cr.list(); tx.commit(); } catch (Exception e) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Querying SystemLogDb Table" + e); } finally { try { session.close(); } catch (Exception e1) { logger.error(XACMLErrorConstants.ERROR_PROCESS_FLOW + "Error While Closing Connection/Statement" + e1); } } return system; }  @SuppressWarnings("unchecked") @Override List<SystemLogDb> getLoggingData(); @SuppressWarnings("unchecked") @Override List<SystemLogDb> getSystemAlertData();  }