Fix for testcases
[jabaws.git] / webservices / compbio / stat / collector / ExecutionStatCollector.java
index 785f659..ec35a15 100644 (file)
@@ -102,7 +102,13 @@ public class ExecutionStatCollector implements Runnable {
                return ((System.currentTimeMillis() - jd.jobdir.lastModified()) / (1000 * 60 * 60)) > timeOutInHours;\r
        }\r
 \r
+   /* Make sure that collectStatistics methods was called prior to calling this! \r
+       * TODO consider running collectStatistics from here on the first call \r
+       */\r
        StatProcessor getStats() {\r
+               if(stats.isEmpty()) {\r
+                       log.info("Please make sure collectStatistics method was called prior to calling getStats()!");\r
+               }\r
                return new StatProcessor(stats);\r
        }\r
 \r
@@ -314,7 +320,7 @@ public class ExecutionStatCollector implements Runnable {
                }\r
        }\r
 \r
-       private void collectStatistics() {\r
+       void collectStatistics() {\r
                File[] files = workDirectory.listFiles(directories);\r
                for (File file : files) {\r
                        JobDirectory jd = new JobDirectory(file);\r