You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2010/10/15 00:25:17 UTC
svn commit: r1022740 -
/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
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 {