[logback-dev] svn commit: r2391 - logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling

noreply.ceki at qos.ch noreply.ceki at qos.ch
Fri Jul 31 16:05:16 CEST 2009


Author: ceki
Date: Fri Jul 31 16:05:16 2009
New Revision: 2391

Modified:
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/ScaffoldingForRollingTests.java
   logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFileNamingAndTriggeringPolicyTest.java

Log:
- making all existing test pass on Linux

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/ScaffoldingForRollingTests.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/ScaffoldingForRollingTests.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/ScaffoldingForRollingTests.java	Fri Jul 31 16:05:16 2009
@@ -75,9 +75,17 @@
     assertEquals(witnessList, stringList);
   }
 
-  public static void contentCheck(String outputDirStr, int runLength,
+  public static void sortedContentCheck(String outputDirStr, int runLength,
       String prefix) throws IOException {
     File[] fileArray = getFilesInDirectory(outputDirStr);
+    Arrays.sort(fileArray, new Comparator<File>() {
+      public int compare(File o1, File o2) {
+        String o1Name = o1.getName();
+        String o2Name = o2.getName();
+        return (o1Name.compareTo(o2Name));
+      }
+    }
+    );
     fileContentCheck(fileArray, runLength, prefix);
   }
 

Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFileNamingAndTriggeringPolicyTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFileNamingAndTriggeringPolicyTest.java	(original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/rolling/SizeAndTimeBasedFileNamingAndTriggeringPolicyTest.java	Fri Jul 31 16:05:16 2009
@@ -87,7 +87,7 @@
 
     massageExpectedFilesToCorresponToCurrentTarget(file);
     existenceCheck(expectedFilenameList);
-    contentCheck(randomOutputDir, runLength, prefix);
+    sortedContentCheck(randomOutputDir, runLength, prefix);
   }
 
   @Test
@@ -116,7 +116,7 @@
     }
 
     existenceCheck(expectedFilenameList);
-    contentCheck(randomOutputDir, runLength, prefix);
+    sortedContentCheck(randomOutputDir, runLength, prefix);
   }
 
   void massageExpectedFilesToCorresponToCurrentTarget(String file) {


More information about the logback-dev mailing list