[lsc-changes] r281 - lsc/trunk/src/test/java/org/lsc/utils/directory

jclarke at lsc-project.org jclarke at lsc-project.org
Wed Jul 1 19:16:44 CEST 2009


Author: jclarke
Date: 2009-07-01 19:16:44 +0200 (Wed, 01 Jul 2009)
New Revision: 281

Modified:
   lsc/trunk/src/test/java/org/lsc/utils/directory/ADTest.java
Log:
Silly fix to avoid imprecision in date calculation. AD's lastLogonTimestamp is only precise within 2 weeks anyway

Modified: lsc/trunk/src/test/java/org/lsc/utils/directory/ADTest.java
===================================================================
--- lsc/trunk/src/test/java/org/lsc/utils/directory/ADTest.java	2009-07-01 08:34:57 UTC (rev 280)
+++ lsc/trunk/src/test/java/org/lsc/utils/directory/ADTest.java	2009-07-01 17:16:44 UTC (rev 281)
@@ -107,7 +107,7 @@
     	long secondsSinceReference = (now.getTimeInMillis() - then.getTimeInMillis()) / 1000;
     	int numWeeksFromReference = (int)(secondsSinceReference / (60 * 60 * 24 * 7));
     	
-    	assertEquals(numWeeksFromReference, numWeeksFromLastLogon);
+    	assertTrue(numWeeksFromReference <= numWeeksFromLastLogon + 1 && numWeeksFromReference >= numWeeksFromLastLogon - 1);
     }
 
 }



More information about the lsc-changes mailing list