- StatDB db = new StatDB();\r
- Date earliestRec = db.getEarliestRecord();\r
- // System.out.println(earliestRec);\r
+ Calendar cal = Calendar.getInstance();\r
+ cal.add(Calendar.MONTH, -5);\r
+ Timestamp from = new Timestamp(cal.getTimeInMillis());\r
+ cal.add(Calendar.MONTH, 1);\r
+ Timestamp to = new Timestamp(cal.getTimeInMillis());\r
+ StatCollection sc = StatCollection.newStatCollecton(from, to);\r
+ Totals t = Totals.sumStats(sc.getAllStat());\r
+\r
+ //System.out.println(sc.getAllStat());\r
+ \r
+ assertEquals(t.getTotal(), statdb.getTotalJobsCount(from, to));\r
+ assertEquals(t.getAbandoned(), statdb.getAbandonedCount(from, to));\r
+ assertEquals(t.getCancelled(), statdb.getCancelledCount(from, to));\r
+ assertEquals(t.getIncomplete(), statdb.getIncompleteCount(from, to));\r
+\r