@Test public void testGetTotalInMonth() throws Exception { Calendar cal = new GregorianCalendar(); Long count = visitorCounterDao.getTotal(cal.get(Calendar.MONTH) + 1, cal.get(Calendar.YEAR)); System.out.println(count); }
@Test public void testGetTotalInDate() throws Exception { Calendar cal = new GregorianCalendar(); System.out.println(cal); Calendar start = (Calendar) cal.clone(); start.add(Calendar.DAY_OF_WEEK, start.getFirstDayOfWeek() - start.get(Calendar.DAY_OF_WEEK)); // and add six days to the end date Calendar end = (Calendar) start.clone(); end.add(Calendar.DAY_OF_YEAR, 6); Long count = visitorCounterDao.getTotal(start.getTime(), end.getTime()); System.out.println(count); }
@Test public void testGetTotal() throws Exception { Long count = visitorCounterDao.getTotal(); System.out.println(count); }