commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1022740 - /commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
Date Thu, 14 Oct 2010 22:25:17 GMT
Author: ggregory
Date: Thu Oct 14 22:25:17 2010
New Revision: 1022740

URL: http://svn.apache.org/viewvc?rev=1022740&view=rev
Log:
Improve unit test code coverage.

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

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java?rev=1022740&r1=1022739&r2=1022740&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
Thu Oct 14 22:25:17 2010
@@ -218,7 +218,7 @@ public class LineIteratorTestCase extend
     /**
      * Test the iterator using only the nextLine() method.
      */
-    public void testNextLineOnlyWithEncoding() throws Exception {
+    public void testNextLineOnlyNullEncoding() throws Exception {
         String encoding = null;
 
         File testFile = new File(getTestDirectory(), "LineIterator-nextOnly.txt");
@@ -229,6 +229,19 @@ public class LineIteratorTestCase extend
     }
 
     /**
+     * Test the iterator using only the nextLine() method.
+     */
+    public void testNextLineOnlyUtf8Encoding() throws Exception {
+        String encoding = "UTF-8";
+
+        File testFile = new File(getTestDirectory(), "LineIterator-nextOnly.txt");
+        List<String> lines = createLinesFile(testFile, encoding, 3);
+
+        LineIterator iterator = FileUtils.lineIterator(testFile, encoding);
+        assertLines(lines, iterator);
+    }
+
+    /**
      * Test the iterator using only the next() method.
      */
     public void testNextOnly() throws Exception {



Mime
View raw message