You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2009/08/06 15:37:07 UTC

svn commit: r801642 - /sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java

Author: bdelacretaz
Date: Thu Aug  6 13:37:06 2009
New Revision: 801642

URL: http://svn.apache.org/viewvc?rev=801642&view=rev
Log:
SLING-1074 - SlingLogWriterTest failed under Windows

Modified:
    sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java

Modified: sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java?rev=801642&r1=801641&r2=801642&view=diff
==============================================================================
--- sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java (original)
+++ sling/trunk/bundles/commons/log/src/test/java/org/apache/sling/commons/log/internal/slf4j/SlingLogWriterTest.java Thu Aug  6 13:37:06 2009
@@ -160,8 +160,8 @@
 
     public void test_daily_rotation() throws IOException {
         final String base = getBase();
-        final SlingLoggerWriter slfw = createLogWriter(base, -1,
-            "'.'yyyy-MM-dd");
+        final String limit = "'.'yyyy-MM-dd";
+        SlingLoggerWriter slfw = createLogWriter(base, -1, limit);
         setNow(slfw, july21);
 
         // only base file should exist with size 0 (for now)
@@ -187,7 +187,10 @@
         // simulate July 23rd
         setNow(slfw, july21 + 24*60*60*1000L);
         forceRotate(slfw);
+        // setLastModified fails under Windows if file is still open in logger
+        slfw.close();
         test.setLastModified(july21);
+        slfw = createLogWriter(base, -1, limit);
 
         // rotate the file now
         slfw.checkRotate();