You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/28 01:10:08 UTC
svn commit: r1306045 -
/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java
Author: sebb
Date: Tue Mar 27 23:10:08 2012
New Revision: 1306045
URL: http://svn.apache.org/viewvc?rev=1306045&view=rev
Log:
Use super-class rather than specific implementation
Modified:
commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java
Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java?rev=1306045&r1=1306044&r2=1306045&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java Tue Mar 27 23:10:08 2012
@@ -27,7 +27,7 @@ import static org.junit.Assert.*;
public class CSVLexerTest {
- private CSVLexer getLexer(String input, CSVFormat format) {
+ private Lexer getLexer(String input, CSVFormat format) {
return new CSVLexer(format, new ExtendedBufferedReader(new StringReader(input)));
}
@@ -40,7 +40,7 @@ public class CSVLexerTest {
@Test
public void testNextToken1() throws IOException {
String code = "abc,def, hijk, lmnop, qrst,uv ,wxy ,z , ,";
- CSVLexer parser = getLexer(code, CSVFormat.DEFAULT.withSurroundingSpacesIgnored(true));
+ Lexer parser = getLexer(code, CSVFormat.DEFAULT.withSurroundingSpacesIgnored(true));
assertTokenEquals(TOKEN, "abc", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "def", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "hijk", parser.nextToken(new Token()));
@@ -66,7 +66,7 @@ public class CSVLexerTest {
String code = "1,2,3,\na,b x,c\n#foo\n\nd,e,\n\n";
CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#');
- CSVLexer parser = getLexer(code, format);
+ Lexer parser = getLexer(code, format);
assertTokenEquals(TOKEN, "1", parser.nextToken(new Token()));
@@ -93,7 +93,7 @@ public class CSVLexerTest {
*/
String code = "a,\\,,b\n\\,,";
CSVFormat format = CSVFormat.DEFAULT.withCommentStart('#');
- CSVLexer parser = getLexer(code, format);
+ Lexer parser = getLexer(code, format);
assertTokenEquals(TOKEN, "a", parser.nextToken(new Token()));
// an unquoted single backslash is not an escape char
@@ -115,7 +115,7 @@ public class CSVLexerTest {
* a, " foo " ,b
*/
String code = "a,\"foo\",b\na, \" foo\",b\na,\"foo \" ,b\na, \" foo \" ,b";
- CSVLexer parser = getLexer(code, CSVFormat.DEFAULT.withSurroundingSpacesIgnored(true));
+ Lexer parser = getLexer(code, CSVFormat.DEFAULT.withSurroundingSpacesIgnored(true));
assertTokenEquals(TOKEN, "a", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "foo", parser.nextToken(new Token()));
assertTokenEquals(EORECORD, "b", parser.nextToken(new Token()));
@@ -135,7 +135,7 @@ public class CSVLexerTest {
@Test
public void testNextToken5() throws IOException {
String code = "a,\"foo\n\",b\n\"foo\n baar ,,,\"\n\"\n\t \n\"";
- CSVLexer parser = getLexer(code, CSVFormat.DEFAULT);
+ Lexer parser = getLexer(code, CSVFormat.DEFAULT);
assertTokenEquals(TOKEN, "a", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "foo\n", parser.nextToken(new Token()));
assertTokenEquals(EORECORD, "b", parser.nextToken(new Token()));
@@ -154,7 +154,7 @@ public class CSVLexerTest {
*/
String code = "a;'b and '' more\n'\n!comment;;;;\n;;";
CSVFormat format = CSVFormat.DEFAULT.withDelimiter(';').withEncapsulator('\'').withCommentStart('!');
- CSVLexer parser = getLexer(code, format);
+ Lexer parser = getLexer(code, format);
assertTokenEquals(TOKEN, "a", parser.nextToken(new Token()));
assertTokenEquals(EORECORD, "b and ' more\n", parser.nextToken(new Token()));
}
@@ -163,7 +163,7 @@ public class CSVLexerTest {
@Test
public void testDelimiterIsWhitespace() throws IOException {
String code = "one\ttwo\t\tfour \t five\t six";
- CSVLexer parser = getLexer(code, CSVFormat.TDF);
+ Lexer parser = getLexer(code, CSVFormat.TDF);
assertTokenEquals(TOKEN, "one", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "two", parser.nextToken(new Token()));
assertTokenEquals(TOKEN, "", parser.nextToken(new Token()));