Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5B3399CD for ; Tue, 27 Mar 2012 23:10:33 +0000 (UTC) Received: (qmail 87297 invoked by uid 500); 27 Mar 2012 23:10:33 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 87223 invoked by uid 500); 27 Mar 2012 23:10:33 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 87216 invoked by uid 99); 27 Mar 2012 23:10:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 23:10:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 23:10:30 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BB2EF23888FE for ; Tue, 27 Mar 2012 23:10:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1306045 - /commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexerTest.java Date: Tue, 27 Mar 2012 23:10:08 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120327231008.BB2EF23888FE@eris.apache.org> 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()));