Fixed 24247. Fix invalid assumption in junit-test: testChangedDataSet
authorStefan Hühner <stefan.huehner@openbravo.com>
Tue, 02 Jul 2013 14:51:54 +0200
changeset 20710 844e3b805e0b
parent 20709 8f287e597c1d
child 20711 0b9c6c0013da
Fixed 24247. Fix invalid assumption in junit-test: testChangedDataSet
When selecting a date for which we assume that after it any dataset
has changed do not pick arbitrarily 600 days before today, but pick 0
date (smallest possible date ever).
src-test/org/openbravo/test/system/SystemServiceTest.java
--- a/src-test/org/openbravo/test/system/SystemServiceTest.java	Tue Jul 02 12:36:06 2013 +0200
+++ b/src-test/org/openbravo/test/system/SystemServiceTest.java	Tue Jul 02 14:51:54 2013 +0200
@@ -54,9 +54,8 @@
           .getInstance().hasChanged(ds, tomorrow));
     }
 
-    // 600 days in the past
-    final long manyDays = (long) 600 * ONEDAY;
-    final Date past = new Date(System.currentTimeMillis() - manyDays);
+    // pick smallest possible date in past to ensure that there is always a change in some dataset after this date
+    final Date past = new Date(0);
     for (DataSet ds : dss) {
       if (!DataSetService.getInstance().hasData(ds)) {
         continue;