new Timestamp(cal.getTimeInMillis()), new Timestamp(\r
new Date().getTime()), Services.TcoffeeWS, false);\r
assertNotNull(jobs);\r
- assertEquals(jobs.size(), 67);\r
+ assertEquals(jobs.size(), 47);\r
\r
jobs = statdb.readData(new Timestamp(cal.getTimeInMillis()),\r
new Timestamp(new Date().getTime()), Services.ClustalWS,\r
false);\r
\r
assertNotNull(jobs);\r
- assertEquals(jobs.size(), 159);\r
+ assertEquals(jobs.size(), 144);\r
\r
jobs = statdb.readData(new Timestamp(cal.getTimeInMillis()),\r
new Timestamp(new Date().getTime()), Services.MafftWS,\r
false);\r
assertNotNull(jobs);\r
- assertEquals(jobs.size(), 163);\r
+ assertEquals(jobs.size(), 149);\r
\r
jobs = statdb.readData(new Timestamp(cal.getTimeInMillis()),\r
new Timestamp(new Date().getTime()), Services.ProbconsWS,\r
false);\r
assertNotNull(jobs);\r
- assertEquals(jobs.size(), 13);\r
+ assertEquals(jobs.size(), 12);\r
\r
jobs = statdb.readData(new Timestamp(cal.getTimeInMillis()),\r
new Timestamp(new Date().getTime()), Services.MuscleWS,\r
false);\r
assertNotNull(jobs);\r
- assertEquals(jobs.size(), 84);\r
+ assertEquals(jobs.size(), 76);\r
\r
} catch (SQLException e) {\r
e.printStackTrace();\r
Assert.fail(e.getMessage());\r
}\r
}\r
+\r
+ @Test\r
+ public void testGetEarliestRecord() {\r
+\r
+ try {\r
+ StatDB db = new StatDB();\r
+ Date earliestRec = db.getEarliestRecord();\r
+ // System.out.println(earliestRec);\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ Assert.fail(e.getLocalizedMessage());\r
+ }\r
+\r
+ }\r
}\r
+++ /dev/null
-package compbio.stat.collector;\r
-\r
-import java.util.Date;\r
-\r
-import org.testng.Assert;\r
-import org.testng.annotations.Test;\r
-\r
-import compbio.stat.collector.StatManager.DateRoller;\r
-\r
-public class StatManagerTester {\r
-\r
- @Test\r
- public void testDateRoller() {\r
- DateRoller dr = new DateRoller(new Date());\r
- int counter = 0;\r
- while (dr.hasNext()) {\r
- dr.next();\r
- counter++;\r
- }\r
- Assert.assertEquals(12, counter);\r
- }\r
-}\r
--- /dev/null
+package compbio.stat.servlet.util;\r
+\r
+import java.sql.SQLException;\r
+import java.util.Calendar;\r
+import java.util.Date;\r
+import java.util.GregorianCalendar;\r
+import java.util.Map;\r
+\r
+import org.testng.Assert;\r
+import org.testng.annotations.Test;\r
+\r
+public class StatCollectionTester {\r
+\r
+ @Test\r
+ public void testGetStats() {\r
+ Map<Date, StatCollection> stats;\r
+ Calendar cal = GregorianCalendar.getInstance();\r
+ cal.add(Calendar.DAY_OF_MONTH, -25);\r
+\r
+ try {\r
+ stats = StatCollection.getStats(cal.getTime());\r
+\r
+ // System.out.println(stats);\r
+ for (Map.Entry<Date, Totals> a : StatCollection\r
+ .getTotalStats(stats).entrySet()) {\r
+ System.out.println(a);\r
+ }\r
+ } catch (SQLException e) {\r
+ e.printStackTrace();\r
+ Assert.fail(e.getMessage());\r
+ }\r
+\r
+ }\r
+\r
+}\r