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

noreply.ceki at qos.ch noreply.ceki at qos.ch
Thu Jul 30 23:30:59 CEST 2009


Author: ceki
Date: Thu Jul 30 23:30:59 2009
New Revision: 2386

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

Log:
Added another test case

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	Thu Jul 30 23:30:59 2009
@@ -128,9 +128,38 @@
     massageExpectedFilesToCorresponToCurrentTarget(file);
     existenceCheck(expectedFilenameList);
     contentCheck(runLength, prefix);
-   
   }
 
+  @Test
+  public void noCompression_FileNotSet_NoRestart_2() throws Exception {
+    String testId = "test1";
+    initRFA(rfa1, null);
+    sizeThreshold = 300;
+    initTRBP(rfa1, tbrp1, randomOutputDir + testId + "-%d{" + DATE_PATTERN
+        + "}-%i.txt", sizeThreshold, currentTime, 0);
+
+    addExpectedFileName(testId, getDateOfCurrentPeriodsStart(),
+        fileIndexCounter, false);
+
+    incCurrentTime(100);
+    tbrp1.timeBasedTriggering.setCurrentTime(currentTime);
+
+    int runLength = 100;
+    String prefix = "Hello -----------------";
+    
+    for (int i = 0; i < runLength; i++) {
+      String msg = prefix + i;
+      rfa1.doAppend(msg);
+      addExpectedFileNamedIfItsTime(testId, msg, false);
+      incCurrentTime(20);
+      tbrp1.timeBasedTriggering.setCurrentTime(currentTime);
+    }
+
+    existenceCheck(expectedFilenameList);
+    contentCheck(runLength, prefix);
+  }
+
+  
   void existenceCheck(String filename) {
     assertTrue("File " + filename + " does not exist", new File(filename)
         .exists());


More information about the logback-dev mailing list