commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1347831 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java
Date Thu, 07 Jun 2012 23:33:20 GMT
Author: sebb
Date: Thu Jun  7 23:33:19 2012
New Revision: 1347831

URL: http://svn.apache.org/viewvc?rev=1347831&view=rev
Log:
Make test easier to follow by using multiple strings

Modified:
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java?rev=1347831&r1=1347830&r2=1347831&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/TailerTest.java Thu
Jun  7 23:33:19 2012
@@ -244,11 +244,13 @@ public class TailerTest extends FileBase
     }
 
     /** Append a string to a file */
-    private void writeString(File file, String string) throws Exception {
+    private void writeString(File file, String ... strings) throws Exception {
         FileWriter writer = null;
         try {
             writer = new FileWriter(file, true);
-            writer.write(string);
+            for (String string : strings) {
+                writer.write(string);
+            }
         } finally {
             IOUtils.closeQuietly(writer);
         }
@@ -301,8 +303,7 @@ public class TailerTest extends FileBase
         thread.start();
 
         // Write some lines to the file
-        writeString(file, "CRLF\r\nLF\nCR\rCRCR\r\rtrail");
-        //                 1       2   3   4    
+        writeString(file, "CRLF\r\n", "LF\n", "CR\r", "CRCR\r\r", "trail");
         final long testDelayMillis = delayMillis * 10;
         Thread.sleep(testDelayMillis);
         List<String> lines = listener.getLines();



Mime
View raw message