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 2DE6CD23E for ; Tue, 16 Oct 2012 18:21:39 +0000 (UTC) Received: (qmail 24623 invoked by uid 500); 16 Oct 2012 18:21:39 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 24557 invoked by uid 500); 16 Oct 2012 18:21:38 -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 24548 invoked by uid 99); 16 Oct 2012 18:21:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2012 18:21:38 +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, 16 Oct 2012 18:21:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3D80F23888E3 for ; Tue, 16 Oct 2012 18:20:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1398911 - in /commons/proper/csv/trunk/src: main/java/org/apache/commons/csv/ test/java/org/apache/commons/csv/ Date: Tue, 16 Oct 2012 18:20:52 -0000 To: commits@commons.apache.org From: ggregory@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121016182053.3D80F23888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ggregory Date: Tue Oct 16 18:20:52 2012 New Revision: 1398911 URL: http://svn.apache.org/viewvc?rev=1398911&view=rev Log: Rename "line separator" to "record separator". Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java?rev=1398911&r1=1398910&r2=1398911&view=diff ============================================================================== --- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java (original) +++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVFormat.java Tue Oct 16 18:20:52 2012 @@ -55,7 +55,7 @@ public class CSVFormat implements Serial private final Character escape; private final boolean ignoreSurroundingSpaces; // Should leading/trailing spaces be ignored around values? private final boolean ignoreEmptyLines; - private final String lineSeparator; // for outputs + private final String recordSeparator; // for outputs private final String[] header; /** @@ -77,7 +77,7 @@ public class CSVFormat implements Serial .withDelimiter(COMMA) .withQuoteChar(DOUBLE_QUOTE) .withIgnoreEmptyLines(true) - .withLineSeparator(CRLF); + .withRecordSeparator(CRLF); /** * Comma separated format as defined by RFC 4180. @@ -92,7 +92,7 @@ public class CSVFormat implements Serial PRISTINE .withDelimiter(COMMA) .withQuoteChar(DOUBLE_QUOTE) - .withLineSeparator(CRLF); + .withRecordSeparator(CRLF); /** * Excel file format (using a comma as the value delimiter). Note that the actual value delimiter used by Excel is @@ -108,7 +108,7 @@ public class CSVFormat implements Serial PRISTINE .withDelimiter(COMMA) .withQuoteChar(DOUBLE_QUOTE) - .withLineSeparator(CRLF); + .withRecordSeparator(CRLF); /** Tab-delimited format, with quote; leading and trailing spaces ignored. */ public static final CSVFormat TDF = @@ -117,7 +117,7 @@ public class CSVFormat implements Serial .withQuoteChar(DOUBLE_QUOTE) .withIgnoreSurroundingSpaces(true) .withIgnoreEmptyLines(true) - .withLineSeparator(CRLF); + .withRecordSeparator(CRLF); /** * Default MySQL format used by the SELECT INTO OUTFILE and LOAD DATA INFILE operations. This is @@ -131,7 +131,7 @@ public class CSVFormat implements Serial PRISTINE .withDelimiter(TAB) .withEscape(ESCAPE) - .withLineSeparator(LF); + .withRecordSeparator(LF); /** * Creates a basic CSV format. @@ -161,7 +161,7 @@ public class CSVFormat implements Serial * true when whitespaces enclosing values should be ignored * @param ignoreEmptyLines * true when the parser should skip empty lines - * @param lineSeparator + * @param recordSeparator * the line separator to use for output * @param header * the header @@ -181,7 +181,7 @@ public class CSVFormat implements Serial this.escape = escape; this.ignoreSurroundingSpaces = ignoreSurroundingSpaces; this.ignoreEmptyLines = ignoreEmptyLines; - this.lineSeparator = lineSeparator; + this.recordSeparator = lineSeparator; this.header = header; } @@ -262,7 +262,7 @@ public class CSVFormat implements Serial */ public CSVFormat withDelimiter(final char delimiter) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -301,7 +301,7 @@ public class CSVFormat implements Serial throw new IllegalArgumentException("The quoteChar cannot be a line break"); } return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -353,7 +353,7 @@ public class CSVFormat implements Serial throw new IllegalArgumentException("The comment start character cannot be a line break"); } return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -403,7 +403,7 @@ public class CSVFormat implements Serial throw new IllegalArgumentException("The escape character cannot be a line break"); } return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -435,7 +435,7 @@ public class CSVFormat implements Serial */ public CSVFormat withIgnoreSurroundingSpaces(final boolean ignoreSurroundingSpaces) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -458,7 +458,7 @@ public class CSVFormat implements Serial */ public CSVFormat withIgnoreEmptyLines(final boolean ignoreEmptyLines) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -466,34 +466,34 @@ public class CSVFormat implements Serial * * @return the line separator */ - public String getLineSeparator() { - return lineSeparator; + public String getRecordSeparator() { + return recordSeparator; } /** - * Returns a copy of this format using the specified output line separator. + * Returns a copy of this format using the specified output record separator. * - * @param lineSeparator - * the line separator to use for output. + * @param recordSeparator + * the record separator to use for output. * - * @return A copy of this format using the specified output line separator + * @return A copy of this format using the specified output record separator */ - public CSVFormat withLineSeparator(final char lineSeparator) { + public CSVFormat withRecordSeparator(final char recordSeparator) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, String.valueOf(lineSeparator), header); + ignoreSurroundingSpaces, ignoreEmptyLines, String.valueOf(recordSeparator), header); } /** - * Returns a copy of this format using the specified output line separator. + * Returns a copy of this format using the specified output record separator. * - * @param lineSeparator - * the line separator to use for output. + * @param recordSeparator + * the record separator to use for output. * - * @return A copy of this format using the specified output line separator + * @return A copy of this format using the specified output record separator */ - public CSVFormat withLineSeparator(final String lineSeparator) { + public CSVFormat withRecordSeparator(final String recordSeparator) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** @@ -506,7 +506,7 @@ public class CSVFormat implements Serial */ public CSVFormat withQuotePolicy(final Quote quotePolicy) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } String[] getHeader() { @@ -534,7 +534,7 @@ public class CSVFormat implements Serial */ public CSVFormat withHeader(final String... header) { return new CSVFormat(delimiter, quoteChar, quotePolicy, commentStart, escape, - ignoreSurroundingSpaces, ignoreEmptyLines, lineSeparator, header); + ignoreSurroundingSpaces, ignoreEmptyLines, recordSeparator, header); } /** Modified: commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java?rev=1398911&r1=1398910&r2=1398911&view=diff ============================================================================== --- commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java (original) +++ commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVPrinter.java Tue Oct 16 18:20:52 2012 @@ -70,7 +70,7 @@ public class CSVPrinter implements Flush * Outputs the line separator. */ public void println() throws IOException { - out.append(format.getLineSeparator()); + out.append(format.getRecordSeparator()); newLine = true; } Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java?rev=1398911&r1=1398910&r2=1398911&view=diff ============================================================================== --- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java (original) +++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java Tue Oct 16 18:20:52 2012 @@ -46,7 +46,7 @@ public class CSVFormatTest { format.withQuoteChar('?'); format.withQuotePolicy(Quote.ALL); format.withCommentStart('?'); - format.withLineSeparator("?"); + format.withRecordSeparator("?"); format.withEscape('?'); format.withIgnoreSurroundingSpaces(false); format.withIgnoreEmptyLines(false); @@ -55,7 +55,7 @@ public class CSVFormatTest { assertEquals('!', format.getQuoteChar().charValue()); assertEquals('!', format.getCommentStart().charValue()); assertEquals('!', format.getEscape().charValue()); - assertEquals(CRLF, format.getLineSeparator()); + assertEquals(CRLF, format.getRecordSeparator()); assertTrue(format.getIgnoreSurroundingSpaces()); assertTrue(format.getIgnoreEmptyLines()); @@ -71,7 +71,7 @@ public class CSVFormatTest { assertEquals('?', format.withQuoteChar('?').getQuoteChar().charValue()); assertEquals(Quote.ALL, format.withQuotePolicy(Quote.ALL).getQuotePolicy()); assertEquals('?', format.withCommentStart('?').getCommentStart().charValue()); - assertEquals("?", format.withLineSeparator("?").getLineSeparator()); + assertEquals("?", format.withRecordSeparator("?").getRecordSeparator()); assertEquals('?', format.withEscape('?').getEscape().charValue()); assertFalse(format.withIgnoreSurroundingSpaces(false).getIgnoreSurroundingSpaces()); @@ -214,7 +214,7 @@ public class CSVFormatTest { assertEquals("delimiter", CSVFormat.DEFAULT.getDelimiter(), format.getDelimiter()); assertEquals("encapsulator", CSVFormat.DEFAULT.getQuoteChar(), format.getQuoteChar()); assertEquals("comment start", CSVFormat.DEFAULT.getCommentStart(), format.getCommentStart()); - assertEquals("line separator", CSVFormat.DEFAULT.getLineSeparator(), format.getLineSeparator()); + assertEquals("line separator", CSVFormat.DEFAULT.getRecordSeparator(), format.getRecordSeparator()); assertEquals("escape", CSVFormat.DEFAULT.getEscape(), format.getEscape()); assertEquals("trim", CSVFormat.DEFAULT.getIgnoreSurroundingSpaces(), format.getIgnoreSurroundingSpaces()); assertEquals("empty lines", CSVFormat.DEFAULT.getIgnoreEmptyLines(), format.getIgnoreEmptyLines()); Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java?rev=1398911&r1=1398910&r2=1398911&view=diff ============================================================================== --- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java (original) +++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java Tue Oct 16 18:20:52 2012 @@ -313,7 +313,7 @@ public class CSVParserTest { final CSVFormat format = new CSVFormat(',').withQuoteChar('\'').withEscape('/') - .withIgnoreEmptyLines(true).withLineSeparator(CRLF); + .withIgnoreEmptyLines(true).withRecordSeparator(CRLF); final CSVParser parser = new CSVParser(code, format); final List records = parser.getRecords(); @@ -343,7 +343,7 @@ public class CSVParserTest { final CSVFormat format = new CSVFormat(',').withEscape('/') - .withIgnoreEmptyLines(true).withLineSeparator(CRLF); + .withIgnoreEmptyLines(true).withRecordSeparator(CRLF); final CSVParser parser = new CSVParser(code, format); final List records = parser.getRecords(); @@ -622,7 +622,7 @@ public class CSVParserTest { @Test public void testGetRecordWithMultiiLineValues() throws Exception { final CSVParser parser = new CSVParser("\"a\r\n1\",\"a\r\n2\"" + CRLF + "\"b\r\n1\",\"b\r\n2\"" + CRLF + "\"c\r\n1\",\"c\r\n2\"", - CSVFormat.DEFAULT.withLineSeparator(CRLF)); + CSVFormat.DEFAULT.withRecordSeparator(CRLF)); CSVRecord record; assertEquals(0, parser.getRecordNumber()); assertEquals(0, parser.getLineNumber()); @@ -654,7 +654,7 @@ public class CSVParserTest { } private void validateRecordNumbers(String lineSeparator) throws IOException { - final CSVParser parser = new CSVParser("a" + lineSeparator + "b" + lineSeparator + "c", CSVFormat.DEFAULT.withLineSeparator(lineSeparator)); + final CSVParser parser = new CSVParser("a" + lineSeparator + "b" + lineSeparator + "c", CSVFormat.DEFAULT.withRecordSeparator(lineSeparator)); CSVRecord record; assertEquals(0, parser.getRecordNumber()); assertNotNull(record = parser.nextRecord()); @@ -671,7 +671,7 @@ public class CSVParserTest { } private void validateLineNumbers(String lineSeparator) throws IOException { - final CSVParser parser = new CSVParser("a" + lineSeparator + "b" + lineSeparator + "c", CSVFormat.DEFAULT.withLineSeparator(lineSeparator)); + final CSVParser parser = new CSVParser("a" + lineSeparator + "b" + lineSeparator + "c", CSVFormat.DEFAULT.withRecordSeparator(lineSeparator)); assertEquals(0, parser.getLineNumber()); assertNotNull(parser.nextRecord()); assertEquals(1, parser.getLineNumber()); Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java?rev=1398911&r1=1398910&r2=1398911&view=diff ============================================================================== --- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java (original) +++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVPrinterTest.java Tue Oct 16 18:20:52 2012 @@ -51,7 +51,7 @@ public class CSVPrinterTest { return sb.toString(); } - String lineSeparator = CSVFormat.DEFAULT.getLineSeparator(); + String recordSeparator = CSVFormat.DEFAULT.getRecordSeparator(); public void doOneRandom(final CSVFormat format) throws Exception { final Random r = new Random(); @@ -155,7 +155,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecords(new String[][] { { "r1c1", "r1c2" }, { "r2c1", "r2c2" } }); - assertEquals("r1c1,r1c2" + lineSeparator + "r2c1,r2c2" + lineSeparator, sw.toString()); + assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString()); } @Test @@ -163,7 +163,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecords(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }), Arrays.asList(new String[] { "r2c1", "r2c2" }) }); - assertEquals("r1c1,r1c2" + lineSeparator + "r2c1,r2c2" + lineSeparator, sw.toString()); + assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString()); } @Test @@ -171,7 +171,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecords(Arrays.asList(new String[][] { { "r1c1", "r1c2" }, { "r2c1", "r2c2" } })); - assertEquals("r1c1,r1c2" + lineSeparator + "r2c1,r2c2" + lineSeparator, sw.toString()); + assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString()); } @Test @@ -180,7 +180,7 @@ public class CSVPrinterTest { final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecords(Arrays.asList(new List[] { Arrays.asList(new String[] { "r1c1", "r1c2" }), Arrays.asList(new String[] { "r2c1", "r2c2" }) })); - assertEquals("r1c1,r1c2" + lineSeparator + "r2c1,r2c2" + lineSeparator, sw.toString()); + assertEquals("r1c1,r1c2" + recordSeparator + "r2c1,r2c2" + recordSeparator, sw.toString()); } @Test @@ -188,7 +188,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecord("a", "b"); - assertEquals("a,b" + lineSeparator, sw.toString()); + assertEquals("a,b" + recordSeparator, sw.toString()); } @Test @@ -196,7 +196,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.EXCEL); printer.printRecord("a,b", "b"); - assertEquals("\"a,b\",b" + lineSeparator, sw.toString()); + assertEquals("\"a,b\",b" + recordSeparator, sw.toString()); } @Test @@ -211,7 +211,7 @@ public class CSVPrinterTest { stmt.execute("insert into TEST values(2, 'r2')"); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecords(stmt.executeQuery("select ID, NAME from TEST")); - assertEquals("1,r1" + lineSeparator + "2,r2" + lineSeparator, sw.toString()); + assertEquals("1,r1" + recordSeparator + "2,r2" + recordSeparator, sw.toString()); } finally { connection.close(); } @@ -223,7 +223,7 @@ public class CSVPrinterTest { final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentStart('#')); printer.printComment("This is a comment\non multiple lines"); - assertEquals("# This is a comment" + lineSeparator + "# on multiple lines" + lineSeparator, sw.toString()); + assertEquals("# This is a comment" + recordSeparator + "# on multiple lines" + recordSeparator, sw.toString()); } @Test @@ -231,7 +231,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", "b"); - assertEquals("a,b" + lineSeparator, sw.toString()); + assertEquals("a,b" + recordSeparator, sw.toString()); } @Test @@ -239,7 +239,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a,b", "b"); - assertEquals("\"a,b\",b" + lineSeparator, sw.toString()); + assertEquals("\"a,b\",b" + recordSeparator, sw.toString()); } @Test @@ -247,7 +247,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a, b", "b "); - assertEquals("\"a, b\",\"b \"" + lineSeparator, sw.toString()); + assertEquals("\"a, b\",\"b \"" + recordSeparator, sw.toString()); } @Test @@ -255,7 +255,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", "b\"c"); - assertEquals("a,\"b\"\"c\"" + lineSeparator, sw.toString()); + assertEquals("a,\"b\"\"c\"" + recordSeparator, sw.toString()); } @Test @@ -263,7 +263,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", "b\nc"); - assertEquals("a,\"b\nc\"" + lineSeparator, sw.toString()); + assertEquals("a,\"b\nc\"" + recordSeparator, sw.toString()); } @Test @@ -271,7 +271,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", "b\r\nc"); - assertEquals("a,\"b\r\nc\"" + lineSeparator, sw.toString()); + assertEquals("a,\"b\r\nc\"" + recordSeparator, sw.toString()); } @Test @@ -279,7 +279,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", "b\\c"); - assertEquals("a,b\\c" + lineSeparator, sw.toString()); + assertEquals("a,b\\c" + recordSeparator, sw.toString()); } @Test @@ -287,7 +287,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT); printer.printRecord("a", null, "b"); - assertEquals("a,,b" + lineSeparator, sw.toString()); + assertEquals("a,,b" + recordSeparator, sw.toString()); } @Test @@ -295,7 +295,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuotePolicy(Quote.ALL)); printer.printRecord("a", "b\nc", "d"); - assertEquals("\"a\",\"b\nc\",\"d\"" + lineSeparator, sw.toString()); + assertEquals("\"a\",\"b\nc\",\"d\"" + recordSeparator, sw.toString()); } @Test @@ -303,7 +303,7 @@ public class CSVPrinterTest { final StringWriter sw = new StringWriter(); final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuotePolicy(Quote.NON_NUMERIC)); printer.printRecord("a", "b\nc", Integer.valueOf(1)); - assertEquals("\"a\",\"b\nc\",1" + lineSeparator, sw.toString()); + assertEquals("\"a\",\"b\nc\",1" + recordSeparator, sw.toString()); } @Test @@ -320,7 +320,7 @@ public class CSVPrinterTest { final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withCommentStart('#')); printer.printComment("This is a comment"); - assertEquals("# This is a comment" + lineSeparator, sw.toString()); + assertEquals("# This is a comment" + recordSeparator, sw.toString()); } }